diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 0f4f3d9ae..3cdaa6179 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -87,5 +87,5 @@ jobs: - name: Build and bring up containers without cache working-directory: ./marketplace-build run: | - docker compose build --no-cache --build-arg BUILD_ENV=${{ inputs.build_env }} + docker compose build --no-cache --build-arg BUILD_ENV=${{ inputs.build_env }} --build-arg BUILD_VERSION=${{ inputs.release_version }} docker compose up --force-recreate -d diff --git a/marketplace-build/docker-compose.yml b/marketplace-build/docker-compose.yml index 5ba3d718d..4b61cc430 100644 --- a/marketplace-build/docker-compose.yml +++ b/marketplace-build/docker-compose.yml @@ -51,6 +51,8 @@ services: build: context: ../marketplace-service dockerfile: Dockerfile + args: + - BUILD_VERSION=${BUILD_VERSION} ports: - "8080:8080" depends_on: diff --git a/marketplace-service/Dockerfile b/marketplace-service/Dockerfile index 8a963d725..95f00a3c3 100644 --- a/marketplace-service/Dockerfile +++ b/marketplace-service/Dockerfile @@ -11,7 +11,8 @@ WORKDIR /app RUN rm -rf /usr/local/tomcat/webapps/ROOT # Copy the WAR file to the webapps directory in Tomcat -COPY --from=build-api /app/target/marketplace-service-0.0.1-SNAPSHOT.war /usr/local/tomcat/webapps/marketplace-service.war +ARG BUILD_VERSION +COPY --from=build-api /app/target/marketplace-service-${BUILD_VERSION}.war /usr/local/tomcat/webapps/marketplace-service.war # Expose port 8080 EXPOSE 8080