Skip to content

Commit

Permalink
[INJIVER-586] - add workflow for mvn build (#206)
Browse files Browse the repository at this point in the history
* [INJIVER-586] - add workflow for mvn build

Signed-off-by: Sreenadh S <[email protected]>

* [INJIVER-586] - update nexus url

Signed-off-by: Sreenadh S <[email protected]>

* [INJIVER-586] - update pom with git plugin and other details

Signed-off-by: Sreenadh S <[email protected]>

* [INJIVER-586] - update pom with gpg-plugin

Signed-off-by: Sreenadh S <[email protected]>

* [INJIVER-586] - update pom

Signed-off-by: Sreenadh S <[email protected]>

* [INJIVER-586] - add docker build workflow

Signed-off-by: Sreenadh S <[email protected]>

* [INJIVER-586] - add docker build workflow

Signed-off-by: Sreenadh S <[email protected]>

* [INJIVER-586] - add docker build workflow

Signed-off-by: Sreenadh S <[email protected]>

* [INJIVER-586] - update jar executble file mod

Signed-off-by: Sreenadh S <[email protected]>

---------

Signed-off-by: Sreenadh S <[email protected]>
  • Loading branch information
sree96 authored Oct 23, 2024
1 parent 66c961d commit 2267058
Show file tree
Hide file tree
Showing 4 changed files with 254 additions and 12 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/push-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

189 changes: 181 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.4</version>
<version>3.2.3</version>
</parent>

<groupId>io.mosip</groupId>
Expand Down Expand Up @@ -38,13 +38,56 @@
</developer>
</developers>

<modules>
<module>verify-service</module>
</modules>
<repositories>
<repository>
<id>ossrh</id>
<name>CentralRepository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>central</id>
<name>MavenCentral</name>
<layout>default</layout>
<url>https://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<!-- maven -->
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.version>3.8.1</maven.compiler.version>
<spring.boot.version>3.2.3</spring.boot.version>
<java.version>21</java.version>
<spring-boot.run.main-class>${start-class}</spring-boot.run.main-class>
<maven.jar.plugin.version>3.3.0</maven.jar.plugin.version>
<maven.war.plugin.version>3.3.2</maven.war.plugin.version>
<maven.javadoc.version>3.6.3</maven.javadoc.version>
</properties>

<modules>
<module>verify-service</module>
</modules>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -62,12 +105,142 @@

<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<phase>validate</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
</includeOnlyProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
<format>json</format>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<aggregate>true</aggregate>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven.war.plugin.version}</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Project-Name>${project.name}</Project-Name>
<Project-Version>${project.version}</Project-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven.javadoc.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<doclint>none</doclint>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven.jar.plugin.version}</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Project-Name>${project.name}</Project-Name>
<Project-Version>${project.version}</Project-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.14</version>
<extensions>true</extensions>
<configuration>
<skip>true</skip>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile → verify-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 23 additions & 3 deletions verify-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
<parent>
<groupId>io.mosip</groupId>
<artifactId>verify-service-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
<version>0.1.0-SNAPSHOT</version>
</parent>

<groupId>io.mosip</groupId>
Expand All @@ -16,15 +15,36 @@
<name>verify-service</name>
<description>verify-service</description>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<skip>false</skip>
<executable>true</executable>
<layout>ZIP</layout>
</configuration>
<executions>
<execution>
<goals>
<goal>build-info</goal>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down

0 comments on commit 2267058

Please sign in to comment.