From c98c163dea0e12996d3b1b0efd36ae28460dd6a7 Mon Sep 17 00:00:00 2001 From: Nikola Jankovic <41673484+jankonikola93@users.noreply.github.com> Date: Thu, 24 Oct 2024 10:54:38 +0200 Subject: [PATCH 01/11] Create docker-image.yml (#1) * Create docker-image.yml * Update docker-image.yml --- .github/workflows/docker-image.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..3b742c6 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,16 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Build the Docker image + run: docker build . --file helix-p4d/Dockerfile --tag jankonikola93/helix-p4d:$(date +%s) From 35725c4d6bcf9b6c32b213c18fd1088eed6aa6df Mon Sep 17 00:00:00 2001 From: Nikola Jankovic <41673484+jankonikola93@users.noreply.github.com> Date: Thu, 24 Oct 2024 11:29:02 +0200 Subject: [PATCH 02/11] Update Dockerfile --- helix-p4d/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-p4d/Dockerfile b/helix-p4d/Dockerfile index ce6b520..6cb7c3c 100644 --- a/helix-p4d/Dockerfile +++ b/helix-p4d/Dockerfile @@ -26,7 +26,7 @@ RUN apt-get update && apt-get install -y helix-p4d=2024.1-2625008~focal helix-sw COPY files/restore.sh /usr/local/bin/restore.sh COPY files/setup.sh /usr/local/bin/setup.sh COPY files/init.sh /usr/local/bin/init.sh -COPY files/latest_checkpoint.sh /usr/local/bin/latest_checkpoint.sh +# COPY files/latest_checkpoint.sh /usr/local/bin/latest_checkpoint.sh RUN \ chmod +x /usr/local/bin/restore.sh && \ From 4696ca1cd8472cd7260c3acc470e6a1d5ab38980 Mon Sep 17 00:00:00 2001 From: Nikola Jankovic <41673484+jankonikola93@users.noreply.github.com> Date: Thu, 24 Oct 2024 11:31:11 +0200 Subject: [PATCH 03/11] Update docker-image.yml --- .github/workflows/docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 3b742c6..257a19a 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -13,4 +13,4 @@ jobs: steps: - uses: actions/checkout@v4 - name: Build the Docker image - run: docker build . --file helix-p4d/Dockerfile --tag jankonikola93/helix-p4d:$(date +%s) + run: docker build ./helix-p4d --file Dockerfile --tag jankonikola93/helix-p4d:$(date +%s) From 656b61852f81a873d1b4a486f46640981569e1c4 Mon Sep 17 00:00:00 2001 From: Nikola Jankovic <41673484+jankonikola93@users.noreply.github.com> Date: Thu, 24 Oct 2024 12:00:16 +0200 Subject: [PATCH 04/11] Update docker-image.yml --- .github/workflows/docker-image.yml | 53 +++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 257a19a..68e08b5 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,16 +1,53 @@ -name: Docker Image CI +name: Publish Docker image on: push: - branches: [ "main" ] + branches: + - 'main' + +env: + REGISTRY: jankonikola93 + IMAGE_NAME: helix-p4d jobs: + push_to_registry: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + attestations: write + id-token: write + steps: + - name: Check out the repo + uses: actions/checkout@v4 - build: + - name: Log in to Docker Hub + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a + with: + registry: ${{ env.REGISTRY }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} - runs-on: ubuntu-latest + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: my-docker-hub-namespace/my-docker-hub-repository - steps: - - uses: actions/checkout@v4 - - name: Build the Docker image - run: docker build ./helix-p4d --file Dockerfile --tag jankonikola93/helix-p4d:$(date +%s) + - name: Build and push Docker image + id: push + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: ./helix-p4d + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v1 + with: + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} + subject-digest: ${{ steps.push.outputs.digest }} + push-to-registry: true From 71426f617f14da0e102d29885e116be88b7770df Mon Sep 17 00:00:00 2001 From: Nikola Jankovic <41673484+jankonikola93@users.noreply.github.com> Date: Thu, 24 Oct 2024 12:09:27 +0200 Subject: [PATCH 05/11] Update docker-image.yml --- .github/workflows/docker-image.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 68e08b5..8527a35 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -4,10 +4,12 @@ on: push: branches: - 'main' + tags: + - 'v*' env: - REGISTRY: jankonikola93 - IMAGE_NAME: helix-p4d + NAMESPACE: jankonikola93 + REPOSITORY: helix-p4d jobs: push_to_registry: @@ -23,9 +25,8 @@ jobs: uses: actions/checkout@v4 - name: Log in to Docker Hub - uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a + uses: docker/login-action@v3.3.0 with: - registry: ${{ env.REGISTRY }} username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} @@ -33,7 +34,7 @@ jobs: id: meta uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 with: - images: my-docker-hub-namespace/my-docker-hub-repository + images: ${{ env.NAMESPACE }}/${{ env.REPOSITORY }} - name: Build and push Docker image id: push @@ -48,6 +49,6 @@ jobs: - name: Generate artifact attestation uses: actions/attest-build-provenance@v1 with: - subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} + subject-name: ${{ env.NAMESPACE }}/${{ env.REPOSITORY}} subject-digest: ${{ steps.push.outputs.digest }} push-to-registry: true From 5a54b0f06fd0d56d181cc55dbde2e670ee18263e Mon Sep 17 00:00:00 2001 From: Nikola Jankovic <41673484+jankonikola93@users.noreply.github.com> Date: Thu, 24 Oct 2024 12:18:25 +0200 Subject: [PATCH 06/11] Update docker-image.yml --- .github/workflows/docker-image.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 8527a35..5e1036b 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -38,10 +38,9 @@ jobs: - name: Build and push Docker image id: push - uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + uses: docker/build-push-action@v6.9.0 with: context: ./helix-p4d - file: ./Dockerfile push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} From 3beb8dfe77e4f96668296b9432fda244d57f2ee7 Mon Sep 17 00:00:00 2001 From: Nikola Jankovic <41673484+jankonikola93@users.noreply.github.com> Date: Thu, 24 Oct 2024 12:23:43 +0200 Subject: [PATCH 07/11] Update Dockerfile --- helix-p4d/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helix-p4d/Dockerfile b/helix-p4d/Dockerfile index 6cb7c3c..3bb2cc3 100644 --- a/helix-p4d/Dockerfile +++ b/helix-p4d/Dockerfile @@ -21,12 +21,12 @@ RUN apt-get update && \ # Create perforce user and install Perforce Server # Do in-page search over https://package.perforce.com/apt/ubuntu/dists/focal/release/binary-amd64/Packages # for both "Package: helix-p4d" and "Package: helix-swarm-triggers". -RUN apt-get update && apt-get install -y helix-p4d=2024.1-2625008~focal helix-swarm-triggers=2024.3-2628402~focal +RUN apt-get update && apt-get install -y helix-p4d=2024.1-2661979~focal helix-swarm-triggers=2024.5-2666202~focal # Add external files COPY files/restore.sh /usr/local/bin/restore.sh COPY files/setup.sh /usr/local/bin/setup.sh COPY files/init.sh /usr/local/bin/init.sh -# COPY files/latest_checkpoint.sh /usr/local/bin/latest_checkpoint.sh +COPY files/latest_checkpoint.sh /usr/local/bin/latest_checkpoint.sh RUN \ chmod +x /usr/local/bin/restore.sh && \ From 5e63910bd95edb5161c36f9b81643d7f06fa8ec9 Mon Sep 17 00:00:00 2001 From: Nikola Jankovic <41673484+jankonikola93@users.noreply.github.com> Date: Thu, 24 Oct 2024 12:34:04 +0200 Subject: [PATCH 08/11] Update docker-image.yml --- .github/workflows/docker-image.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 5e1036b..af3ca12 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -44,10 +44,5 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - - - name: Generate artifact attestation - uses: actions/attest-build-provenance@v1 - with: - subject-name: ${{ env.NAMESPACE }}/${{ env.REPOSITORY}} - subject-digest: ${{ steps.push.outputs.digest }} - push-to-registry: true + sbom: true + provenance: true From a2afb05b663340d9b303d1fe92c10b90b4162517 Mon Sep 17 00:00:00 2001 From: Nikola Jankovic <41673484+jankonikola93@users.noreply.github.com> Date: Thu, 24 Oct 2024 12:38:13 +0200 Subject: [PATCH 09/11] Update docker-image.yml (#2) --- .github/workflows/docker-image.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index af3ca12..61c21f9 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -44,5 +44,3 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - sbom: true - provenance: true From 75f580788fc85704eaf88573dfb434ffdc55c591 Mon Sep 17 00:00:00 2001 From: Nikola Jankovic <41673484+jankonikola93@users.noreply.github.com> Date: Sat, 26 Oct 2024 07:26:28 +0200 Subject: [PATCH 10/11] Update docker-image.yml --- .github/workflows/docker-image.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 61c21f9..d94c002 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -6,10 +6,8 @@ on: - 'main' tags: - 'v*' - -env: - NAMESPACE: jankonikola93 - REPOSITORY: helix-p4d + paths-ignore: + - '-github/**' jobs: push_to_registry: @@ -34,7 +32,7 @@ jobs: id: meta uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 with: - images: ${{ env.NAMESPACE }}/${{ env.REPOSITORY }} + images: ${{ vars.DOCKER_NAMESPACE }}/${{ vars.DOCKER_REPOSITORY }} - name: Build and push Docker image id: push From 9333a857eded7dfd8a529e22ce3753097a5b0be7 Mon Sep 17 00:00:00 2001 From: Nikola Jankovic <41673484+jankonikola93@users.noreply.github.com> Date: Sat, 26 Oct 2024 07:28:17 +0200 Subject: [PATCH 11/11] Update docker-image.yml --- .github/workflows/docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index d94c002..0538314 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -7,7 +7,7 @@ on: tags: - 'v*' paths-ignore: - - '-github/**' + - '.github/**' jobs: push_to_registry: