Skip to content

Commit af60bd5

Browse files
committed
Configure CI
1 parent 8da474f commit af60bd5

File tree

5 files changed

+244
-13
lines changed

5 files changed

+244
-13
lines changed

.github/workflows/main.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build with Maven
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
strategy:
13+
matrix:
14+
platform: [ ubuntu-latest ]
15+
java-version: [ 11 ]
16+
17+
runs-on: ${{ matrix.platform }}
18+
env:
19+
PLATFORM: ${{ matrix.platform }}
20+
JAVA_VERSION: ${{ matrix.java-version }}
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Set up JDK
25+
uses: actions/setup-java@v4
26+
with:
27+
distribution: 'temurin'
28+
java-version: ${{ matrix.java-version }}
29+
- name: Build with Maven
30+
id: build_with_maven
31+
run: |
32+
mvn clean verify --batch-mode --file pom.xml
33+
- uses: actions/upload-artifact@v4
34+
with:
35+
name: build_artifact
36+
path: ${{ github.workspace }}/omod/target/*.omod

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
on:
2+
push:
3+
tags:
4+
- '*' # Create release for every new tag
5+
6+
name: Create Release
7+
8+
jobs:
9+
build:
10+
name: Create Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
- name: Create Release Notes
16+
uses: openmrs/openmrs-contrib-create-release-notes@v1.0.3
17+
id: create-release-notes
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
with:
21+
head-ref: ${{ github.ref }}
22+
- name: Create Release
23+
id: create_release
24+
uses: actions/create-release@v1
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
with:
28+
tag_name: ${{ github.ref }}
29+
release_name: ${{ github.ref }}
30+
body: |
31+
## What's Changed
32+
${{ steps.create-release-notes.outputs.release-notes }}
33+
draft: false
34+
prerelease: false

bamboo-specs/bamboo.yml

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
---
2+
version: 2
3+
plan:
4+
project-key: DM
5+
key: DM
6+
name: Drools Module
7+
description: Build and deploy the Drools module
8+
stages:
9+
- Build and Test:
10+
manual: false
11+
final: false
12+
jobs:
13+
- Build and Test JDK 11
14+
- Deploy:
15+
manual: false
16+
final: false
17+
jobs:
18+
- Deploy to Maven
19+
- Release:
20+
manual: true
21+
final: false
22+
jobs:
23+
- Release to Maven
24+
Build and Test JDK 11:
25+
key: BTJ8
26+
tasks:
27+
- checkout:
28+
force-clean-build: false
29+
description: Checkout default repository
30+
- script:
31+
interpreter: SHELL
32+
scripts:
33+
- |-
34+
#!/bin/bash -eu
35+
36+
set -x
37+
38+
docker run -v m2-repo:/root/.m2/repository -v ${PWD}:/module --rm -w="/module" ${bamboo.build.docker.image.id} bash -c 'mvn clean package -B && chmod -R 777 .'
39+
description: Build and test
40+
artifact-subscriptions: []
41+
Deploy to Maven:
42+
key: DTM
43+
tasks:
44+
- checkout:
45+
force-clean-build: false
46+
description: Checkout default repository
47+
- script:
48+
interpreter: SHELL
49+
scripts:
50+
- |-
51+
#!/bin/bash -eu
52+
53+
set -x
54+
55+
docker pull ${bamboo.build.docker.image.id}
56+
57+
docker run -v m2-repo:/root/.m2/repository -v ~/.m2/settings.xml:/.m2/settings.xml:ro -v ${PWD}:/module --rm -w="/module" ${bamboo.build.docker.image.id} bash -c 'mvn deploy -B -DskipTests --settings /.m2/settings.xml'
58+
description: Deploy
59+
artifact-subscriptions: []
60+
Release to Maven:
61+
key: RTM
62+
tasks:
63+
- checkout:
64+
force-clean-build: 'false'
65+
description: Checkout Default Repository
66+
- checkout:
67+
repository: Release scripts
68+
path: release-scripts
69+
force-clean-build: 'false'
70+
description: Checkout Release Scripts Repository
71+
- script:
72+
interpreter: SHELL
73+
scripts:
74+
- |-
75+
#!/bin/bash -eu
76+
77+
set -x
78+
79+
docker pull ${bamboo.build.docker.image.id}
80+
81+
docker run \
82+
-v m2-repo:/root/.m2/repository \
83+
-v ~/.m2/settings.xml:/root/.m2/settings.xml:ro \
84+
-v ${PWD}:/module \
85+
-v ~/.ssh/github:/root/.ssh:ro \
86+
-e GIT_USER_NAME=$GIT_USER_NAME \
87+
-e GIT_USER_EMAIL=$GIT_USER_EMAIL \
88+
-e GIT_SSH_COMMAND='ssh -i /root/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' \
89+
--rm \
90+
-w='/module' \
91+
${bamboo.build.docker.image.id} \
92+
bash -c '
93+
yum -y install git &&
94+
yum clean all &&
95+
git config --global user.email "$GIT_USER_EMAIL" &&
96+
git config --global user.name "$GIT_USER_NAME" &&
97+
git config --global --add safe.directory /module &&
98+
./release-scripts/release-prepare-perform.sh \
99+
-r ${bamboo.maven.release.version} \
100+
-d ${bamboo.maven.development.version} \
101+
-e ${bamboo.planRepository.repositoryUrl}
102+
'
103+
environment: GIT_USER_NAME=${bamboo.git.user.name} GIT_USER_EMAIL=${bamboo.git.user.email}
104+
description: Release prepare perform
105+
- any-task:
106+
plugin-key: com.atlassian.bamboo.plugins.variable.updater.variable-updater-generic:variable-extractor
107+
configuration:
108+
variable: maven.release.version
109+
removeSnapshot: 'true'
110+
variableScope: PLAN
111+
description: Save next release version
112+
- any-task:
113+
plugin-key: com.atlassian.bamboo.plugins.variable.updater.variable-updater-generic:variable-extractor
114+
configuration:
115+
variable: maven.development.version
116+
variableScope: JOB
117+
description: Retrieve next snaphot version
118+
artifact-subscriptions: []
119+
variables:
120+
build.docker.image.id: maven:3.9.9-amazoncorretto-11
121+
maven.development.version: 1.1.0-SNAPSHOT
122+
maven.release.version: 1.0.0
123+
repositories:
124+
- Git:
125+
type: git
126+
url: https://github.com/openmrs/openmrs-module-drools.git
127+
branch: main
128+
command-timeout-minutes: '180'
129+
lfs: false
130+
verbose-logs: false
131+
use-shallow-clones: true
132+
cache-on-agents: false
133+
submodules: false
134+
submodules-use-shallow-clones: false
135+
ssh-key-applies-to-submodules: false
136+
fetch-all: false
137+
- Release scripts:
138+
scope: global
139+
triggers:
140+
- polling:
141+
period: '180'
142+
repositories:
143+
- Git
144+
branches:
145+
create: manually
146+
delete: never
147+
link-to-jira: true
148+
notifications:
149+
- events:
150+
- job-failed
151+
recipients:
152+
- committers
153+
- emails:
154+
- samuelsmalek@gmail.com
155+
labels: []
156+
dependencies:
157+
require-all-stages-passing: false
158+
enabled-for-branches: true
159+
block-strategy: none
160+
plans: []
161+
other:
162+
concurrent-build-plugin:
163+
number-of-concurrent-builds: system-default
164+
execution-strategy: block-triggering
165+
---
166+
version: 2
167+
plan:
168+
key: DM-ODM
169+
plan-permissions:
170+
- roles:
171+
- anonymous
172+
permissions:
173+
- view
174+
...

omod/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@
4747
<artifactId>event-api</artifactId>
4848
<scope>provided</scope>
4949
</dependency>
50-
<dependency>
51-
<groupId>org.openmrs.module</groupId>
52-
<artifactId>initializer-api</artifactId>
53-
<scope>provided</scope>
54-
</dependency>
5550
</dependencies>
5651

5752
<build>
@@ -81,7 +76,6 @@
8176
<plugin>
8277
<groupId>org.openmrs.maven.plugins</groupId>
8378
<artifactId>maven-openmrs-plugin</artifactId>
84-
8579
<extensions>true</extensions>
8680
<executions>
8781
<execution>

pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,6 @@
6464
<version>${eventVersion}</version>
6565
<scope>provided</scope>
6666
</dependency>
67-
<dependency>
68-
<groupId>org.openmrs.module</groupId>
69-
<artifactId>initializer-api</artifactId>
70-
<version>${initializerVersion}</version>
71-
<scope>provided</scope>
72-
</dependency>
7367
<dependency>
7468
<groupId>org.openmrs.api</groupId>
7569
<artifactId>openmrs-api</artifactId>
@@ -237,7 +231,6 @@
237231
<patientFlagsVersion>3.0.8</patientFlagsVersion>
238232
<eventVersion>2.5</eventVersion>
239233
<webservicesRestVersion>2.50.0</webservicesRestVersion>
240-
<initializerVersion>2.9.0</initializerVersion>
241234
</properties>
242235

243236
<build>

0 commit comments

Comments
 (0)