From 10832d8eb3e1d90aef607e90c9dd5f1fd36a09ad Mon Sep 17 00:00:00 2001 From: Luca Trubbiani Date: Wed, 19 Jun 2024 11:39:19 +0200 Subject: [PATCH 1/5] update builder-tool.yaml --- .github/workflows/builder-tool.yaml | 2 ++ frontend/console | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/builder-tool.yaml b/.github/workflows/builder-tool.yaml index 3cd61e6d..54772a28 100644 --- a/.github/workflows/builder-tool.yaml +++ b/.github/workflows/builder-tool.yaml @@ -34,6 +34,8 @@ jobs: uses: docker/metadata-action@v5.5.1 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + labels: | + version=${{ github.sha }} flavor: | latest=true - name: Build and push Docker image diff --git a/frontend/console b/frontend/console index f7ce200a..99d1510b 160000 --- a/frontend/console +++ b/frontend/console @@ -1 +1 @@ -Subproject commit f7ce200af471d518bc68c1d445ce76b9831e56b3 +Subproject commit 99d1510b291b4a0cea5af3b470f60ea9a49b781c From cd78e01460ff58151c94b7dc8247033a091af834 Mon Sep 17 00:00:00 2001 From: Luca Trubbiani Date: Wed, 19 Jun 2024 13:17:21 +0200 Subject: [PATCH 2/5] Add tags to builder-tool.yaml --- .github/workflows/builder-tool.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/builder-tool.yaml b/.github/workflows/builder-tool.yaml index 54772a28..8559827e 100644 --- a/.github/workflows/builder-tool.yaml +++ b/.github/workflows/builder-tool.yaml @@ -34,6 +34,10 @@ jobs: uses: docker/metadata-action@v5.5.1 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=sha + type=ref,event=branch + type=raw,value=${{ github.sha }} labels: | version=${{ github.sha }} flavor: | From 5032aa4a86e51c112b334a4fb65dc12267e5558d Mon Sep 17 00:00:00 2001 From: Luca Trubbiani Date: Wed, 19 Jun 2024 14:21:37 +0200 Subject: [PATCH 3/5] Get only first 8 character of sha --- .github/workflows/builder-tool.yaml | 9 +++++---- application/src/main/resources/application.yml | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/builder-tool.yaml b/.github/workflows/builder-tool.yaml index 8559827e..addbb006 100644 --- a/.github/workflows/builder-tool.yaml +++ b/.github/workflows/builder-tool.yaml @@ -29,17 +29,18 @@ jobs: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract the first 5 characters of the SHA + id: extract_sha + run: echo "SHA_SHORT=${GITHUB_SHA:0:8}" >> $GITHUB_ENV - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v5.5.1 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | - type=sha - type=ref,event=branch - type=raw,value=${{ github.sha }} + type=raw,value=${{ env.SHA_SHORT }} labels: | - version=${{ github.sha }} + commit.sha=${{ github.sha }} flavor: | latest=true - name: Build and push Docker image diff --git a/application/src/main/resources/application.yml b/application/src/main/resources/application.yml index 55af327f..d2af7434 100644 --- a/application/src/main/resources/application.yml +++ b/application/src/main/resources/application.yml @@ -79,7 +79,7 @@ springdoc: # Kaniko config kaniko: image: ${KANIKO_IMAGE:gcr.io/kaniko-project/executor:latest} - init-image: ${KANIKO_INIT_IMAGE:ghcr.io/scc-digitalhub/digitalhub-core-builder-tool:latest} + init-image: ${KANIKO_INIT_IMAGE:ghcr.io/scc-digitalhub/digitalhub-core-builder-tool:629755fe1a91cf9de6090dbaa2e1035c7b4d3da8} image-prefix: ${KANIKO_IMAGE_PREFIX:dhcore} image-registry: ${KANIKO_IMAGE_REGISTRY:${registry.name}} secret: ${KANIKO_SECRET:${registry.secret}} From 3a8796206646f605ebb9d027e9d4480267e51afa Mon Sep 17 00:00:00 2001 From: Matteo Saloni Date: Thu, 20 Jun 2024 13:32:25 +0200 Subject: [PATCH 4/5] fix: clear edited files --- application/src/main/resources/application.yml | 2 +- frontend/console | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/src/main/resources/application.yml b/application/src/main/resources/application.yml index d2af7434..55af327f 100644 --- a/application/src/main/resources/application.yml +++ b/application/src/main/resources/application.yml @@ -79,7 +79,7 @@ springdoc: # Kaniko config kaniko: image: ${KANIKO_IMAGE:gcr.io/kaniko-project/executor:latest} - init-image: ${KANIKO_INIT_IMAGE:ghcr.io/scc-digitalhub/digitalhub-core-builder-tool:629755fe1a91cf9de6090dbaa2e1035c7b4d3da8} + init-image: ${KANIKO_INIT_IMAGE:ghcr.io/scc-digitalhub/digitalhub-core-builder-tool:latest} image-prefix: ${KANIKO_IMAGE_PREFIX:dhcore} image-registry: ${KANIKO_IMAGE_REGISTRY:${registry.name}} secret: ${KANIKO_SECRET:${registry.secret}} diff --git a/frontend/console b/frontend/console index 99d1510b..f7ce200a 160000 --- a/frontend/console +++ b/frontend/console @@ -1 +1 @@ -Subproject commit 99d1510b291b4a0cea5af3b470f60ea9a49b781c +Subproject commit f7ce200af471d518bc68c1d445ce76b9831e56b3 From df23b587930d8a691ec7e9f16c74d92f188685c1 Mon Sep 17 00:00:00 2001 From: Matteo Saloni Date: Thu, 20 Jun 2024 13:34:13 +0200 Subject: [PATCH 5/5] fix: resolve symlink copy for build-tool --- core-builder-tool/builder-tool.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-builder-tool/builder-tool.sh b/core-builder-tool/builder-tool.sh index d7bb7a36..66de7c2b 100755 --- a/core-builder-tool/builder-tool.sh +++ b/core-builder-tool/builder-tool.sh @@ -99,7 +99,7 @@ handle_error() { trap 'handle_error $LINENO "$BASH_COMMAND"' ERR # Copy everything from source directory to destination directory, excluding context-refs.txt -rsync -av --exclude='context-refs.txt' --exclude='Dockerfile' --include='.*' "$source_dir/" "$destination_dir/" +rsync -avL --exclude='context-refs.txt' --exclude='Dockerfile' --include='.*' "$source_dir/" "$destination_dir/" # Process context-refs.txt if [ -f "$source_dir/context-refs.txt" ]; then