Skip to content

Commit

Permalink
maven deploy cicd fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jecihjoy committed Jan 4, 2024
1 parent c5e75e5 commit 369f1bd
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 53 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/cicd_process.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: deploy to prod 8600
on:
# Manually triggered workflow using the "Run workflow" button
workflow_dispatch:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:

build:
Expand Down
60 changes: 22 additions & 38 deletions .github/workflows/mekom_cicd.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy to Mekom
name: Build and Publish

on:
# Manually triggered workflow using the "Run workflow" button
Expand All @@ -7,55 +7,39 @@ on:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest

#set up the build enviroment
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
cache: maven

# Build with Maven
- name: Build with Maven
run: mvn -B package -DskipTests


publish:
runs-on: ubuntu-latest
# Define dependencies, this job depends on the completion of the "build" job
needs: build

# Specify conditions for when this job should run
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}

# Set up enviroment for Publish

steps:
#set up the build enviroment
- name: Checkout Repository
uses: actions/checkout@v4
# Step 2: Set up JDK 8 for Publish
- name: Set up JDK 8 for Publish
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
server-id: mks-nexus
server-username: $MAVEN_USERNAME
server-password: $MAVEN_TOKEN

- name: Publish to Mekom repository
run: mvn -B deploy
- name: Build and Test
run: mvn -B package -DskipTests

env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
- name: Set settings.xml
uses: s4u/maven-settings-action@v3.0.0
with:
servers: |
[{
"id": "mks-repo",
"username": "${{ secrets.MAVEN_USERNAME }}",
"password": "${{ secrets.MAVEN_TOKEN }}"
},
{
"id": "mks-repo-snapshots",
"username": "${{ secrets.MAVEN_USERNAME }}",
"password": "${{ secrets.MAVEN_TOKEN }}"
}]
- name: Publish
run: mvn --batch-mode clean deploy -DskipTests
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.openmrs.module</groupId>
<artifactId>kenyacore</artifactId>
<version>3.0.1</version>
<version>2.9.4-SNAPSHOT</version>
</parent>

<artifactId>kenyacore-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion omod/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.openmrs.module</groupId>
<artifactId>kenyacore</artifactId>
<version>3.0.1</version>
<version>2.9.4-SNAPSHOT</version>
</parent>

<artifactId>kenyacore-omod</artifactId>
Expand Down
24 changes: 12 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>org.openmrs.module</groupId>
<artifactId>kenyacore</artifactId>
<version>3.0.1</version>
<version>2.9.4-SNAPSHOT</version>

<packaging>pom</packaging>
<name>KenyaCore</name>
Expand Down Expand Up @@ -250,16 +250,16 @@
</pluginRepository>
</pluginRepositories>

<distributionManagement>
<repository>
<id>mks-repo</id>
<name>Mekom Solutions Nexus Releases</name>
<url>https://nexus.mekomsolutions.net/repository/maven-releases</url>
</repository>
<snapshotRepository>
<id>mks-repo-snapshots</id>
<name>Mekom Solutions Nexus Snapshots</name>
<url>https://nexus.mekomsolutions.net/repository/maven-snapshots</url>
</snapshotRepository>
<distributionManagement>
<repository>
<id>mks-repo</id>
<name>Mekom Solutions Nexus Releases</name>
<url>https://nexus.mekomsolutions.net/repository/maven-releases</url>
</repository>
<snapshotRepository>
<id>mks-repo-snapshots</id>
<name>Mekom Solutions Nexus Snapshots</name>
<url>https://nexus.mekomsolutions.net/repository/maven-snapshots</url>
</snapshotRepository>
</distributionManagement>
</project>
2 changes: 1 addition & 1 deletion test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.openmrs.module</groupId>
<artifactId>kenyacore</artifactId>
<version>3.0.1</version>
<version>2.9.4-SNAPSHOT</version>
</parent>

<artifactId>kenyacore-test</artifactId>
Expand Down

0 comments on commit 369f1bd

Please sign in to comment.