From 762b3ef0abfc6826113ae5244b72e4a67382a2f7 Mon Sep 17 00:00:00 2001 From: Julian Lechner Date: Thu, 14 May 2026 22:19:03 +0200 Subject: [PATCH] feat: docker and versioning stuff --- .env.example | 1 + .github/workflows/BuildDev.yml | 13 ++++-------- .github/workflows/BuildLatest.yml | 12 +++++------ .gitignore | 35 +++++++++++++++++++++++++++++++ .idea/.gitignore | 10 +++++++++ VERSION | 1 - docker-compose.yml | 7 ++++--- index.html | 3 +++ style.css | 10 +++++++++ 9 files changed, 72 insertions(+), 20 deletions(-) create mode 100644 .env.example create mode 100644 .gitignore create mode 100644 .idea/.gitignore delete mode 100644 VERSION diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..4a6a1b9 --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +MAIN_PORT=8080 diff --git a/.github/workflows/BuildDev.yml b/.github/workflows/BuildDev.yml index 2ea531c..209e937 100644 --- a/.github/workflows/BuildDev.yml +++ b/.github/workflows/BuildDev.yml @@ -24,19 +24,15 @@ jobs: id: version shell: bash run: | - version="$(tr -d '[:space:]' < VERSION)" + version="$(git rev-parse --short=12 HEAD)" - if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+([-.+][0-9A-Za-z.-]+)?$ ]]; then - echo "Invalid VERSION value: $version" >&2 + if [[ ! "$version" =~ ^[0-9a-f]{12}$ ]]; then + echo "Invalid git hash version: $version" >&2 exit 1 fi - docker_tag="${version//+/-}" - short_sha="${GITHUB_SHA::7}" - echo "value=$version" >> "$GITHUB_OUTPUT" - echo "docker_tag=$docker_tag" >> "$GITHUB_OUTPUT" - echo "dev_tag=${docker_tag}-dev.${short_sha}" >> "$GITHUB_OUTPUT" + echo "docker_tag=$version" >> "$GITHUB_OUTPUT" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -59,7 +55,6 @@ jobs: VCS_REF=${{ github.sha }} tags: | ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:dev - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.dev_tag }} labels: | org.opencontainers.image.version=${{ steps.version.outputs.value }} org.opencontainers.image.revision=${{ github.sha }} diff --git a/.github/workflows/BuildLatest.yml b/.github/workflows/BuildLatest.yml index 24b7d80..94cf8df 100644 --- a/.github/workflows/BuildLatest.yml +++ b/.github/workflows/BuildLatest.yml @@ -29,18 +29,16 @@ jobs: id: version shell: bash run: | - version="$(tr -d '[:space:]' < VERSION)" + version="$(git rev-parse --short=12 HEAD)" - if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+([-.+][0-9A-Za-z.-]+)?$ ]]; then - echo "Invalid VERSION value: $version" >&2 + if [[ ! "$version" =~ ^[0-9a-f]{12}$ ]]; then + echo "Invalid git hash version: $version" >&2 exit 1 fi - docker_tag="${version//+/-}" - echo "value=$version" >> "$GITHUB_OUTPUT" - echo "docker_tag=$docker_tag" >> "$GITHUB_OUTPUT" - echo "release_tag=v$docker_tag" >> "$GITHUB_OUTPUT" + echo "docker_tag=$version" >> "$GITHUB_OUTPUT" + echo "release_tag=v$version" >> "$GITHUB_OUTPUT" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a1f2916 --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +# OS files +.DS_Store +Thumbs.db +desktop.ini + +# IDE files +.idea/ +.vscode/ + +# Logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Environment files +.env +.env.* +!.env.example + +# Dependencies and build output +node_modules/ +dist/ +build/ +coverage/ + +# Docker/local runtime artifacts +*.pid +*.seed +*.pid.lock + +# Temporary files +tmp/ +temp/ +.cache/ diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..30cf57e --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,10 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Ignored default folder with query files +/queries/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/VERSION b/VERSION deleted file mode 100644 index 3eefcb9..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.0.0 diff --git a/docker-compose.yml b/docker-compose.yml index eba2772..258eac4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,14 +1,15 @@ services: portfolio: - image: docker.lechner-systems.at/lechnersystems/maintenance:${IMAGE_TAG} + image: docker.lechner-systems.at/lechnersystems/maintenance:${IMAGE_TAG:-latest} build: context: . dockerfile: Dockerfile restart: unless-stopped env_file: - - .env + - path: .env + required: false dns: - 192.168.100.2 - 192.168.100.6 ports: - - ${MAIN_PORT}:80 + - "${MAIN_PORT:-8080}:80" diff --git a/index.html b/index.html index f818409..1298d48 100644 --- a/index.html +++ b/index.html @@ -24,6 +24,9 @@ +43 660 9254001 + diff --git a/style.css b/style.css index 8d46065..facae7e 100644 --- a/style.css +++ b/style.css @@ -10,6 +10,9 @@ body { padding: 96px 24px; font: 20px Helvetica, sans-serif; color: #fff; + display: flex; + flex-direction: column; + align-items: center; } h1 { @@ -59,6 +62,13 @@ a:focus { text-decoration: none; } +.site-footer { + margin-top: auto; + padding-top: 48px; + font-size: 16px; + text-align: center; +} + @-moz-keyframes spin { 100% { -moz-transform: rotate(360deg);