Skip to content

Commit cfcf082

Browse files
committed
Update the package version when building the docker image
1 parent 62b34de commit cfcf082

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

.github/workflows/maven.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ jobs:
9191
uses: docker/build-push-action@v2
9292
with:
9393
push: true
94+
build-args: VERSION=0.1.${{ github.run_number }}
9495
tags: octopussamples/randomquotesjava:0.1.${{ github.run_number }}
9596

9697
- name: Build Docker Package Info

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ COPY pom.xml ./
66
RUN mvn dependency:resolve
77
RUN mvn dependency:tree
88

9+
# Update the package version
10+
ENV VERSION=0.0.1
11+
RUN mvn versions:set -DnewVersion=${VERSION}
12+
913
# Copy everything else and build
1014
COPY . ./
1115
RUN mvn package -DfinalName=app

0 commit comments

Comments
 (0)