Skip to content

Commit

Permalink
feat: making pom version aligned. (#83)
Browse files Browse the repository at this point in the history
* making pom version aligned.

* fix Dockerfile

* Add build step to merge
  • Loading branch information
mishraomp authored Aug 20, 2024
1 parent 7ec5265 commit aae0316
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 17 deletions.
48 changes: 32 additions & 16 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,42 @@ jobs:
name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}

- name: Tag Docker Image for app container
uses: shrink/actions-docker-registry-tag@v4
if: ${{ steps.changelog.outputs.version != '' }}
with:
registry: ghcr.io
repository: ${{ github.repository }}/nr-oracle-service
target: ${{ needs.vars.outputs.pr }}
tags: ${{ steps.changelog.outputs.version }}

- name: Tag Docker Image for init container
uses: shrink/actions-docker-registry-tag@v4
if: ${{ steps.changelog.outputs.version != '' }}
builds:
name: Builds
needs: semantic-release
runs-on: ubuntu-22.04
permissions:
packages: write
strategy:
matrix:
package: [ nr-oracle-service, nr-oracle-service-init ]
include:
- package: nr-oracle-service
build_file: Dockerfile
build_context: .
triggers: ('src/' 'pom.xml')
- package: nr-oracle-service-init
build_file: Dockerfile.certs
build_context: .
triggers: ('get_certs.sh' 'Dockerfile.certs')


steps:
- uses: actions/checkout@v4
- uses: bcgov-nr/action-builder-ghcr@v2.0.2
with:
registry: ghcr.io
repository: ${{ github.repository }}/nr-oracle-service-init
target: ${{ needs.vars.outputs.pr }}
tags: ${{ steps.changelog.outputs.version }}
package: ${{ matrix.package }}
tag: ${{ needs.semantic-release.outputs.tag }}
token: ${{ secrets.GITHUB_TOKEN }}
build_file: ${{ matrix.build_file }}
build_context: ${{ matrix.build_context }}
triggers: ${{ matrix.triggers }}
build_args: |
APP_VERSION=${{ needs.semantic-release.outputs.tag }}
helm-release:
runs-on: ubuntu-22.04
needs: [semantic-release]
needs: [builds,semantic-release]
if: ${{ needs.semantic-release.outputs.version != '' }}
steps:
- name: Checkout
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ jobs:
build_file: ${{ matrix.build_file }}
build_context: ${{ matrix.build_context }}
triggers: ${{ matrix.triggers }}

build_args: |
APP_VERSION=${{ github.event.number }}
deploys:
Expand Down
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-21 AS build
# Receiving app version
ARG APP_VERSION=0.0.1
COPY --chown=quarkus:quarkus mvnw /code/mvnw
COPY --chown=quarkus:quarkus .mvn /code/.mvn
COPY --chown=quarkus:quarkus pom.xml /code/
Expand All @@ -7,6 +9,10 @@ WORKDIR /code
RUN chmod +x mvnw
RUN ./mvnw -B org.apache.maven.plugins:maven-dependency-plugin:3.1.2:go-offline
COPY src /code/src

RUN ./mvnw versions:set -DnewVersion=${APP_VERSION} -f pom.xml -DskipTests -Dtests.skip=true -Dskip.unit.tests=true && \
./mvnw versions:commit -f pom.xml -DskipTests -Dtests.skip=true -Dskip.unit.tests=true

RUN ./mvnw package -Pnative -DskipTests
#RUN ./mvnw package -DskipTests for JVM mode
HEALTHCHECK --interval=300s --timeout=30s CMD ./mvnw --version || exit 1
Expand Down

0 comments on commit aae0316

Please sign in to comment.