From 2267058bd2c7e74b3cb451649d8f09b2f0d341cf Mon Sep 17 00:00:00 2001 From: Sreenadh S <32409698+sree96@users.noreply.github.com> Date: Wed, 23 Oct 2024 11:01:44 +0530 Subject: [PATCH] [INJIVER-586] - add workflow for mvn build (#206) * [INJIVER-586] - add workflow for mvn build Signed-off-by: Sreenadh S <32409698+sree96@users.noreply.github.com> * [INJIVER-586] - update nexus url Signed-off-by: Sreenadh S <32409698+sree96@users.noreply.github.com> * [INJIVER-586] - update pom with git plugin and other details Signed-off-by: Sreenadh S <32409698+sree96@users.noreply.github.com> * [INJIVER-586] - update pom with gpg-plugin Signed-off-by: Sreenadh S <32409698+sree96@users.noreply.github.com> * [INJIVER-586] - update pom Signed-off-by: Sreenadh S <32409698+sree96@users.noreply.github.com> * [INJIVER-586] - add docker build workflow Signed-off-by: Sreenadh S <32409698+sree96@users.noreply.github.com> * [INJIVER-586] - add docker build workflow Signed-off-by: Sreenadh S <32409698+sree96@users.noreply.github.com> * [INJIVER-586] - add docker build workflow Signed-off-by: Sreenadh S <32409698+sree96@users.noreply.github.com> * [INJIVER-586] - update jar executble file mod Signed-off-by: Sreenadh S <32409698+sree96@users.noreply.github.com> --------- Signed-off-by: Sreenadh S <32409698+sree96@users.noreply.github.com> --- .github/workflows/push-trigger.yml | 49 ++++++ pom.xml | 189 +++++++++++++++++++++++- Dockerfile => verify-service/Dockerfile | 2 +- verify-service/pom.xml | 26 +++- 4 files changed, 254 insertions(+), 12 deletions(-) rename Dockerfile => verify-service/Dockerfile (97%) diff --git a/.github/workflows/push-trigger.yml b/.github/workflows/push-trigger.yml index 7bf48513..04e20676 100644 --- a/.github/workflows/push-trigger.yml +++ b/.github/workflows/push-trigger.yml @@ -45,3 +45,52 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} ORG_KEY: ${{ secrets.ORG_KEY }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + + build-inji-verify-service: + uses: mosip/kattu/.github/workflows/maven-build.yml@master-java21 + with: + SERVICE_LOCATION: ./ + BUILD_ARTIFACT: inji-verify-service + secrets: + OSSRH_USER: ${{ secrets.OSSRH_USER }} + OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }} + OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} + GPG_SECRET: ${{ secrets.GPG_SECRET }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_INJI_TEAM }} + + + publish_to_nexus: + if: "${{ !contains(github.ref, 'master') && github.event_name != 'pull_request' }}" + needs: build-inji-verify-service + uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master-java21 + with: + SERVICE_LOCATION: ./ + secrets: + OSSRH_USER: ${{ secrets.OSSRH_USER }} + OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }} + OSSRH_URL: ${{ secrets.OSSRH_SNAPSHOT_URL }} + OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} + GPG_SECRET: ${{ secrets.GPG_SECRET }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + + build-dockers: + needs: build-inji-verify-service + strategy: + matrix: + include: + - SERVICE_LOCATION: 'verify-service' + SERVICE_NAME: 'inji-verify-service' + BUILD_ARTIFACT: 'inji-verify-service' + fail-fast: false + name: ${{ matrix.SERVICE_NAME }} + uses: mosip/kattu/.github/workflows/docker-build.yml@master-java21 + with: + SERVICE_LOCATION: ${{ matrix.SERVICE_LOCATION }} + SERVICE_NAME: ${{ matrix.SERVICE_NAME }} + BUILD_ARTIFACT: ${{ matrix.BUILD_ARTIFACT }} + secrets: + DEV_NAMESPACE_DOCKER_HUB: ${{ secrets.DEV_NAMESPACE_DOCKER_HUB }} + ACTOR_DOCKER_HUB: ${{ secrets.ACTOR_DOCKER_HUB }} + RELEASE_DOCKER_HUB: ${{ secrets.RELEASE_DOCKER_HUB }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + diff --git a/pom.xml b/pom.xml index aacd105f..ed12cb72 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.springframework.boot spring-boot-starter-parent - 3.3.4 + 3.2.3 io.mosip @@ -38,13 +38,56 @@ - - verify-service - + + + ossrh + CentralRepository + https://oss.sonatype.org/content/repositories/snapshots + default + + true + + + + central + MavenCentral + default + https://repo1.maven.org/maven2 + + false + + + + + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + UTF-8 + + + 21 + 21 + 3.8.1 + 3.2.3 21 - ${start-class} + 3.3.0 + 3.3.2 + 3.6.3 + + + verify-service + + org.springframework.boot @@ -62,12 +105,142 @@ - org.springframework.boot - spring-boot-maven-plugin + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + --pinentry-mode + loopback + + + + + + + pl.project13.maven + git-commit-id-plugin + 3.0.1 + + + get-the-git-infos + + revision + + validate + + + + true + ${project.build.outputDirectory}/git.properties + + ^git.build.(time|version)$ + ^git.commit.id.(abbrev|full)$ + + full + ${project.basedir}/.git + json + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven.compiler.version} + + true + ${maven.compiler.source} + ${maven.compiler.target} + + + + org.apache.maven.plugins + maven-javadoc-plugin + + true + + + + org.apache.maven.plugins + maven-war-plugin + ${maven.war.plugin.version} + + + + true + true + + + ${project.name} + ${project.version} + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven.javadoc.version} + + + attach-javadocs + + jar + + + + + none + + + + org.apache.maven.plugins + maven-jar-plugin + ${maven.jar.plugin.version} + + + + true + true + + + ${project.name} + ${project.version} + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.14 + true - true + ossrh + https://oss.sonatype.org/ + false + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + diff --git a/Dockerfile b/verify-service/Dockerfile similarity index 97% rename from Dockerfile rename to verify-service/Dockerfile index e6739beb..8a44ae91 100644 --- a/Dockerfile +++ b/verify-service/Dockerfile @@ -59,7 +59,7 @@ WORKDIR /home/${container_user} ENV work_dir=/home/${container_user} -ADD ./verify-service/target/verify-service-*.jar ./verify-service.jar +ADD ./target/verify-service-*.jar ./verify-service.jar #COPY ./target/mimoto-*.jar mimoto.jar # change permissions of file inside working dir diff --git a/verify-service/pom.xml b/verify-service/pom.xml index 26ad1162..ca3a0e1b 100644 --- a/verify-service/pom.xml +++ b/verify-service/pom.xml @@ -6,8 +6,7 @@ io.mosip verify-service-parent - 0.0.1-SNAPSHOT - ../pom.xml + 0.1.0-SNAPSHOT io.mosip @@ -16,15 +15,36 @@ verify-service verify-service jar + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-test + test + + org.springframework.boot spring-boot-maven-plugin + 3.2.3 - false + true + ZIP + + + + build-info + repackage + + +