Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: making pom version aligned. #83

Merged
merged 4 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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