From 8684c04e2f88d42b947d8915960142d8cd52bdae Mon Sep 17 00:00:00 2001 From: PRAFUL RAKHADE <99539100+Prafulrakhade@users.noreply.github.com> Date: Mon, 31 Jul 2023 10:01:49 +0530 Subject: [PATCH] =?UTF-8?q?[MOSIP-28241]=20Added=20build=20details=20in=20?= =?UTF-8?q?Dockerfile=20and=20docker=20build=20in=20push=5Ftr=E2=80=A6=20(?= =?UTF-8?q?#210)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [28241] Added build details in Dockerfile and docker build in push_trigger.yml file * [MOSIP-28241] Added build details in Dockerfile and docker build in push_trigger.yml file --- .github/workflows/push_trigger.yml | 10 +++++++--- consolidator/Dockerfile | 9 +++++++++ hub/Dockerfile | 9 +++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/push_trigger.yml b/.github/workflows/push_trigger.yml index 3b2f856..4b88851 100644 --- a/.github/workflows/push_trigger.yml +++ b/.github/workflows/push_trigger.yml @@ -72,11 +72,15 @@ jobs: - name: Build hub image run: | - docker build ./hub --file ./hub/Dockerfile --tag ${{ env.SERVICE_NAME }} - + cd "./${{env.SERVICE_LOCATION}}" + # docker build ./hub --file ./hub/Dockerfile --tag ${{ env.SERVICE_NAME }} + docker build . --build-arg SOURCE=mosip --build-arg COMMIT_HASH=$(git rev-parse HEAD) --build-arg COMMIT_ID=$(git rev-parse --short HEAD) --build-arg BUILD_TIME=${{steps.date.outputs.date}} --file Dockerfile --tag ${{ env.SERVICE_NAME }} - name: Build consolidator image run: | - docker build ./consolidator --file ./consolidator/Dockerfile --tag ${{ env.CONSOLIDATOR_SERVICE_NAME }} + cd "./${{env.SERVICE_LOCATION}}" + # docker build ./consolidator --file ./consolidator/Dockerfile --tag ${{ env.CONSOLIDATOR_SERVICE_NAME }} + docker build . --build-arg SOURCE=mosip --build-arg COMMIT_HASH=$(git rev-parse HEAD) --build-arg COMMIT_ID=$(git rev-parse --short HEAD) --build-arg BUILD_TIME=${{steps.date.outputs.date}} --file Dockerfile --tag ${{ env.SERVICE_NAME }} + - name: Log into registry run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin diff --git a/consolidator/Dockerfile b/consolidator/Dockerfile index 276fda8..1ca11e7 100644 --- a/consolidator/Dockerfile +++ b/consolidator/Dockerfile @@ -1,4 +1,13 @@ FROM openjdk:11 + +ARG SOURCE +ARG COMMIT_HASH +ARG COMMIT_ID +ARG BUILD_TIME +LABEL source=${SOURCE} +LABEL commit_hash=${COMMIT_HASH} +LABEL commit_id=${COMMIT_ID} +LABEL build_time=${BUILD_TIME} ARG consolidator_config_url ARG max_heap_size=2048m ARG ballerina_download_url=https://dist.ballerina.io/downloads/2201.0.0/ballerina-2201.0.0-swan-lake-linux-x64.deb diff --git a/hub/Dockerfile b/hub/Dockerfile index 89dc767..d17724e 100644 --- a/hub/Dockerfile +++ b/hub/Dockerfile @@ -1,4 +1,13 @@ FROM openjdk:11 + +ARG SOURCE +ARG COMMIT_HASH +ARG COMMIT_ID +ARG BUILD_TIME +LABEL source=${SOURCE} +LABEL commit_hash=${COMMIT_HASH} +LABEL commit_id=${COMMIT_ID} +LABEL build_time=${BUILD_TIME} ARG hub_config_url ARG max_heap_size=2048m ARG ballerina_download_url=https://dist.ballerina.io/downloads/2201.0.0/ballerina-2201.0.0-swan-lake-linux-x64.deb