From 52ada3f6d565a1582d188b567fe979238d05cd75 Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Sun, 18 Jan 2026 10:08:49 +1100 Subject: [PATCH] BE: VERSION_PREV removal Signed-off-by: jokob-sk --- .devcontainer/Dockerfile | 3 +-- .github/workflows/docker_prod.yml | 29 ++++++++++------------------- Dockerfile | 3 +-- 3 files changed, 12 insertions(+), 23 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index cd10f52e..8ac7cfff 100755 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -159,7 +159,6 @@ RUN install -d -o ${NETALERTX_USER} -g ${NETALERTX_GROUP} -m 700 ${READ_WRITE_FO # Copy version information into the image COPY --chown=${NETALERTX_USER}:${NETALERTX_GROUP} .[V]ERSION ${NETALERTX_APP}/.VERSION -COPY --chown=${NETALERTX_USER}:${NETALERTX_GROUP} .[V]ERSION ${NETALERTX_APP}/.VERSION_PREV # Copy the virtualenv from the builder stage (owned by readonly lock owner) COPY --from=builder --chown=${READONLY_UID}:${READONLY_GID} ${VIRTUAL_ENV} ${VIRTUAL_ENV} @@ -170,7 +169,7 @@ COPY --from=builder --chown=${READONLY_UID}:${READONLY_GID} ${VIRTUAL_ENV} ${VIR # although it may be quicker to do it before the copy, it keeps the image # layers smaller to do it after. # hadolint ignore=DL3018 -RUN for vfile in .VERSION .VERSION_PREV; do \ +RUN for vfile in .VERSION; do \ if [ ! -f "${NETALERTX_APP}/${vfile}" ]; then \ echo "DEVELOPMENT 00000000" > "${NETALERTX_APP}/${vfile}"; \ fi; \ diff --git a/.github/workflows/docker_prod.yml b/.github/workflows/docker_prod.yml index 978c1dc4..df793e77 100755 --- a/.github/workflows/docker_prod.yml +++ b/.github/workflows/docker_prod.yml @@ -11,8 +11,6 @@ name: Publish Docker image on: release: types: [published] - tags: - - '*.[1-9]+[0-9]?.[1-9]+*' jobs: docker: @@ -32,18 +30,6 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - # --- Previous approach Get release version from tag - - name: Set up dynamic build ARGs - id: getargs - run: echo "version=$(cat ./stable/VERSION)" >> $GITHUB_OUTPUT - - - name: Get release version - id: get_version_prev - run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}" - - - name: Create .VERSION file - run: echo "${{ steps.get_version.outputs.version }}" >> .VERSION_PREV - # --- Get release version from tag - name: Get release version id: get_version @@ -55,7 +41,6 @@ jobs: run: | echo "GITHUB_REF: $GITHUB_REF" echo "Version: '${{ steps.get_version.outputs.version }}'" - echo "Version prev: '${{ steps.get_version_prev.outputs.version }}'" # --- Write version to .VERSION file - name: Create .VERSION file @@ -74,17 +59,23 @@ jobs: type=semver,pattern={{version}},value=${{ steps.get_version.outputs.version }} type=semver,pattern={{major}}.{{minor}},value=${{ steps.get_version.outputs.version }} type=semver,pattern={{major}},value=${{ steps.get_version.outputs.version }} - type=ref,event=branch,suffix=-{{ sha }} - type=ref,event=pr - type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }} + type=raw,value=latest - name: Log in to Github Container Registry (GHCR) uses: docker/login-action@v3 with: registry: ghcr.io - username: jokob-sk + username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Login GHCR (jokob-sk legacy) + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: jokob-sk + password: ${{ secrets.GHCR_JOKOBSK_PAT }} + - name: Log in to DockerHub if: github.event_name != 'pull_request' uses: docker/login-action@v3 diff --git a/Dockerfile b/Dockerfile index 9dad6062..6d308642 100755 --- a/Dockerfile +++ b/Dockerfile @@ -156,7 +156,6 @@ RUN install -d -o ${NETALERTX_USER} -g ${NETALERTX_GROUP} -m 700 ${READ_WRITE_FO # Copy version information into the image COPY --chown=${NETALERTX_USER}:${NETALERTX_GROUP} .[V]ERSION ${NETALERTX_APP}/.VERSION -COPY --chown=${NETALERTX_USER}:${NETALERTX_GROUP} .[V]ERSION ${NETALERTX_APP}/.VERSION_PREV # Copy the virtualenv from the builder stage (owned by readonly lock owner) COPY --from=builder --chown=${READONLY_UID}:${READONLY_GID} ${VIRTUAL_ENV} ${VIRTUAL_ENV} @@ -167,7 +166,7 @@ COPY --from=builder --chown=${READONLY_UID}:${READONLY_GID} ${VIRTUAL_ENV} ${VIR # although it may be quicker to do it before the copy, it keeps the image # layers smaller to do it after. # hadolint ignore=DL3018 -RUN for vfile in .VERSION .VERSION_PREV; do \ +RUN for vfile in .VERSION; do \ if [ ! -f "${NETALERTX_APP}/${vfile}" ]; then \ echo "DEVELOPMENT 00000000" > "${NETALERTX_APP}/${vfile}"; \ fi; \