build: add makefile, dockerfile, ci and development stack

- build: add makefile, dockerfile, ci and development stack
- feat(config): add environment configuration and logger
- feat(server): add server lifecycle with health and version routes
- feat(db): add connection, contract check, migrations and stores
- feat(cli): add command dispatch and user management
- test(db): add integration tests against mysql
This commit is contained in:
bryanpedini committed 2026-11-19 15:46:12 +01:00
1 parent 45d1e307c6
commit 7089a6f408
46 files changed
+8456

No files matched your search

+65
View File
@@ -0,0 +1,65 @@
name: Build and publish image
on:
push:
tags: ['*']
concurrency:
group: coredns-web-ui-image
cancel-in-progress: false
jobs:
image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Resolve version
id: version
run: |
set -eu
version=${GITHUB_REF_NAME#v}
printf '%s\n' "$version" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$' || { echo "::error::tag $GITHUB_REF_NAME is not a semantic version" >&2; exit 1; }
echo "version=$version" >> "$GITHUB_OUTPUT"
case $version in *-*) echo latest=false ;; *) echo latest=true ;; esac >> "$GITHUB_OUTPUT"
- name: Test
run: |
set -eu
docker build --pull --target test -f dockerfile .
IT_ID="${GITHUB_RUN_ID}" scripts/integration.sh
- name: Build and test image
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
set -eu
commit=${GITHUB_SHA:0:12}
docker build --build-arg APP_VERSION="$VERSION" --build-arg COMMIT_ID="$commit" -f dockerfile -t coredns-web-ui:ci .
scripts/test-image.sh coredns-web-ui:ci "$VERSION" "$commit"
scripts/test-e2e.sh coredns-web-ui:ci
- name: Publish image
env:
GIT_HOST: ${{ vars.GIT_HOST }}
REGISTRY_USER: ${{ vars.REGISTRY_USER }}
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
VERSION: ${{ steps.version.outputs.version }}
LATEST: ${{ steps.version.outputs.latest }}
run: |
set -eu
test -n "$GIT_HOST" && test -n "$REGISTRY_USER" && test -n "$GIT_TOKEN"
image="${GIT_HOST}/${GITHUB_REPOSITORY}"
printf '%s' "$GIT_TOKEN" | docker login "$GIT_HOST" --username "$REGISTRY_USER" --password-stdin
trap 'docker logout "$GIT_HOST" >/dev/null 2>&1 || true' EXIT
docker tag coredns-web-ui:ci "${image}:${VERSION}"
docker push "${image}:${VERSION}"
if [ "$LATEST" = true ]; then
docker tag coredns-web-ui:ci "${image}:latest"
docker push "${image}:latest"
fi
- name: Remove local images
if: always()
env:
GIT_HOST: ${{ vars.GIT_HOST }}
VERSION: ${{ steps.version.outputs.version }}
run: |
docker image rm -f coredns-web-ui:ci "${GIT_HOST}/${GITHUB_REPOSITORY}:${VERSION}" "${GIT_HOST}/${GITHUB_REPOSITORY}:latest" >/dev/null 2>&1 || true