Skip to content

Commit a2c5b1b

Browse files
casaras1casaras
andauthored
IKDT-1177 repo deployment changes (#49)
* IKDT-1177 repo deployment changes * add github actions * review changes --------- Co-authored-by: Aras <caras@deloitte.com>
1 parent cc79ab2 commit a2c5b1b

File tree

9 files changed

+352
-355
lines changed

9 files changed

+352
-355
lines changed

.github/workflows/build.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build Workflow
2+
3+
run-name: 'Build Workflow -- ${{ github.head_ref || github.ref_name }}'
4+
5+
# Pipeline/Workflow Triggers
6+
on:
7+
push:
8+
pull_request:
9+
workflow_dispatch:
10+
11+
12+
jobs:
13+
pr-verification:
14+
name: Pull Request Validation
15+
runs-on: ubuntu-24.04
16+
if: github.event_name == 'pull_request'
17+
steps:
18+
- name: Pull Request Version Validation
19+
uses: ikmdev/maven-pull-request-version-validation-action@v2.1.0
20+
21+
build-job:
22+
name: Build Job
23+
runs-on: ubuntu-24.04
24+
steps:
25+
- name: Maven Settings File
26+
uses: whelk-io/maven-settings-xml-action@v22
27+
with:
28+
servers: '[{"id": "tinkar-nexus-private", "username": "admin", "password": "${{secrets.EC2_NEXUS_PASSWORD}}"}]'
29+
mirrors: '[{"id": "tinkar-nexus-private", "mirrorOf": "*", "url": "https://nexus.tinkarbuild.com/repository/maven-private/"}]'
30+
repositories: '
31+
[
32+
{
33+
"id": "tinkar-nexus-private",
34+
"name": "tinkar-nexus-private",
35+
"url": "https://nexus.tinkarbuild.com/repository/maven-private/",
36+
"releases": {
37+
"enabled": "true",
38+
"updatePolicy": "always",
39+
"checksumPolicy": "fail"
40+
},
41+
"snapshots": {
42+
"enabled": "true",
43+
"updatePolicy": "always",
44+
"checksumPolicy": "fail"
45+
}
46+
}
47+
]'
48+
output_file: ../.m2/tinkar-settings.xml
49+
- name: Build IKMDEV Code
50+
uses: ikmdev/maven-clean-install-build-action@v3.5.0
51+
with:
52+
branch_name: ${{github.ref_name}}
53+
mvn_additional_args: " -s '/home/runner/work/${{github.event.repository.name}}/.m2/tinkar-settings.xml'"
54+

.github/workflows/post_build.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Post Build Action
2+
3+
run-name: 'Post Build Action -- ${{github.event.workflow_run.head_branch}}'
4+
5+
on:
6+
workflow_run:
7+
workflows:
8+
- Build Workflow
9+
types:
10+
- completed
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
post-build:
17+
name: Post Build Actions
18+
runs-on: ubuntu-24.04
19+
if: github.event.workflow_run.conclusion == 'success' && github.repository_owner == 'ikmdev'
20+
steps:
21+
- name: Checkout Repository
22+
uses: actions/checkout@v4
23+
with:
24+
repository: ${{github.event.workflow_run.head_repository.full_name}}
25+
ref: ${{github.event.workflow_run.head_branch}}
26+
fetch-depth: 0
27+
28+
- name: IKMDEV Post Build Action
29+
id: ikmdev_post_build
30+
uses: ikmdev/maven-post-build-action@v3.2.0
31+
with:
32+
nexus_repo_password: ${{secrets.EC2_NEXUS_PASSWORD}}
33+
branch_name: ${{github.event.workflow_run.head_branch}}
34+
github_token: ${{secrets.GITHUB_TOKEN}}
35+
# maven_central_username: ${{secrets.MC_SECRET_USERNAME}}
36+
# maven_central_password: ${{secrets.MC_SECRET_PASSWORD}}
37+
gpg_key: ${{secrets.GPG_KEY}}
38+
gpg_passphrase: ${{secrets.GPG_PASSPHRASE}}
39+
sonarcloud_token: ${{ secrets.SONAR_TOKEN }}
40+

loinc-export/pom.xml

Lines changed: 62 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
<version>1.0.0-SNAPSHOT</version>
88
</parent>
99

10-
<artifactId>loinc-export</artifactId>
10+
<groupId>dev.ikm.data.loinc</groupId>
11+
<artifactId>loinc</artifactId>
12+
<version>${revision}</version>
1113
<packaging>pom</packaging>
1214

1315
<name>loinc-export</name>
@@ -16,167 +18,98 @@
1618
<!-- Properties For Deploying Zip To Nexus -->
1719

1820
<properties>
19-
<data-artifact.groupId>dev.ikm.tinkar.data</data-artifact.groupId>
20-
<data-artifact.artifactId>loinc</data-artifact.artifactId>
21-
<data-artifact.filename>${data-artifact.path-prefix}</data-artifact.filename>
22-
<data-artifact.version>${source.version}-1.0.0</data-artifact.version>
23-
<data-artifact.prefix>${project.artifactId}-${project.version}</data-artifact.prefix>
24-
<data-artifact.path-prefix>${project.build.directory}/${data-artifact.prefix}</data-artifact.path-prefix>
25-
<deployNexusURL>https://nexus.tinkarbuild.com/repository/private-assets/</deployNexusURL>
26-
<deployToNexus>false</deployToNexus>
21+
<revision>${dataStore}-${source.version}+1.0.0-SNAPSHOT</revision>
2722
</properties>
2823

29-
<!-- Distribution info for private assets repo in Nexus -->
30-
<distributionManagement>
31-
<repository>
32-
<id>nexus</id>
33-
<name>private-assets-nexus</name>
34-
<url>${deployNexusURL}</url>
35-
</repository>
36-
</distributionManagement>
37-
38-
<build>
39-
<plugins>
40-
<plugin>
41-
<groupId>dev.ikm.maven.tinkar</groupId>
42-
<artifactId>tinkar-maven-plugin</artifactId>
43-
<executions>
44-
<!-- Export reasoned data as a protocol buffers zip file (package) -->
45-
<execution>
46-
<id>${project.artifactId}-reasoned-export</id>
47-
<goals>
48-
<goal>export-tinkar-data</goal>
49-
</goals>
50-
<configuration>
51-
<exportDirectory>${project.build.directory}</exportDirectory>
52-
<dataStore>${dataStoreLocation}/${dataStore}</dataStore>
53-
<fileName>${data-artifact.filename}-reasoned-pb.zip</fileName>
54-
<isolate>false</isolate>
55-
</configuration>
56-
</execution>
57-
</executions>
58-
</plugin>
59-
<plugin>
60-
<groupId>org.apache.maven.plugins</groupId>
61-
<artifactId>maven-assembly-plugin</artifactId>
62-
<executions>
63-
<execution>
64-
<id>assemble-origin-artifact</id>
65-
<phase>package</phase>
66-
<goals>
67-
<goal>single</goal>
68-
</goals>
69-
<configuration>
70-
<inlineDescriptors>
71-
<inlineDescriptor>
72-
<id>reasoned-sa</id>
73-
<formats>
74-
<format>zip</format>
75-
</formats>
76-
<fileSets>
77-
<fileSet>
78-
<outputDirectory>${dataStore}</outputDirectory>
79-
<directory>${dataStoreLocation}/${dataStore}</directory>
80-
<includes>
81-
<include>**</include>
82-
</includes>
83-
<excludes>
84-
<exclude>MANIFEST.MF</exclude>
85-
</excludes>
86-
</fileSet>
87-
</fileSets>
88-
<includeBaseDirectory>false</includeBaseDirectory>
89-
</inlineDescriptor>
90-
</inlineDescriptors>
91-
</configuration>
92-
</execution>
93-
</executions>
94-
</plugin>
95-
</plugins>
96-
</build>
97-
9824
<profiles>
99-
<!-- Profile to generate data/template pom -->
10025
<profile>
101-
<id>generateData</id>
26+
<id>generateDataLocal</id>
10227
<activation>
10328
<property>
104-
<name>deployToNexus</name>
105-
<value>true</value>
29+
<name>altDeploymentRepository</name>
10630
</property>
10731
</activation>
10832
<build>
10933
<plugins>
11034
<plugin>
111-
<groupId>org.codehaus.mojo</groupId>
112-
<artifactId>templating-maven-plugin</artifactId>
35+
<groupId>dev.ikm.maven.tinkar</groupId>
36+
<artifactId>tinkar-maven-plugin</artifactId>
11337
<executions>
38+
<!-- Export reasoned data as a protocol buffers zip file (package) -->
11439
<execution>
115-
<id>inject-maven-properties</id>
40+
<id>${project.artifactId}-reasoned-export</id>
11641
<goals>
117-
<goal>filter-sources</goal>
42+
<goal>export-tinkar-data</goal>
11843
</goals>
11944
<configuration>
120-
<sourceDirectory>loinc-export-pom-template</sourceDirectory>
121-
<outputDirectory>${project.build.directory}</outputDirectory>
122-
<skipPoms>false</skipPoms>
45+
<exportDirectory>${project.build.directory}</exportDirectory>
46+
<dataStore>${dataStoreLocation}/${dataStore}</dataStore>
47+
<fileName>${project.artifactId}-${project.version}-reasoned-pb.zip</fileName>
48+
<isolate>false</isolate>
12349
</configuration>
12450
</execution>
12551
</executions>
12652
</plugin>
127-
</plugins>
128-
</build>
129-
</profile>
130-
131-
<!-- Deploy Zip File To Nexus -->
132-
<profile>
133-
<id>deployZipArtifacts</id>
134-
<activation>
135-
<property>
136-
<name>deployToNexus</name>
137-
<value>true</value>
138-
</property>
139-
</activation>
140-
<build>
141-
<plugins>
14253
<plugin>
14354
<groupId>org.apache.maven.plugins</groupId>
144-
<artifactId>maven-deploy-plugin</artifactId>
55+
<artifactId>maven-assembly-plugin</artifactId>
14556
<executions>
14657
<execution>
147-
<id>deploy-reasoned-sa</id>
148-
<phase>deploy</phase>
58+
<id>assemble-origin-artifact</id>
59+
<phase>package</phase>
14960
<goals>
150-
<goal>deploy-file</goal>
61+
<goal>single</goal>
15162
</goals>
15263
<configuration>
153-
<repositoryId>nexus</repositoryId>
154-
<url>${deployNexusURL}</url>
155-
<groupId>${data-artifact.groupId}</groupId>
156-
<artifactId>${data-artifact.artifactId}</artifactId>
157-
<version>${data-artifact.version}</version>
158-
<pomFile>${project.build.directory}/loinc-export-pom.xml</pomFile>
159-
<file>${data-artifact.filename}-reasoned-sa.zip</file>
160-
<packaging>zip</packaging>
161-
<classifier>reasoned-sa</classifier>
64+
<inlineDescriptors>
65+
<inlineDescriptor>
66+
<id>reasoned-sa</id>
67+
<formats>
68+
<format>zip</format>
69+
</formats>
70+
<fileSets>
71+
<fileSet>
72+
<outputDirectory>${dataStore}</outputDirectory>
73+
<directory>${dataStoreLocation}/${dataStore}</directory>
74+
<includes>
75+
<include>**</include>
76+
</includes>
77+
<excludes>
78+
<exclude>MANIFEST.MF</exclude>
79+
</excludes>
80+
</fileSet>
81+
</fileSets>
82+
<includeBaseDirectory>false</includeBaseDirectory>
83+
</inlineDescriptor>
84+
</inlineDescriptors>
16285
</configuration>
16386
</execution>
87+
</executions>
88+
</plugin>
89+
<!-- Attach Tinkar export Artifact to project -->
90+
<plugin>
91+
<groupId>org.codehaus.mojo</groupId>
92+
<artifactId>build-helper-maven-plugin</artifactId>
93+
<executions>
16494
<execution>
165-
<id>deploy-reasoned-pb</id>
166-
<phase>deploy</phase>
95+
<id>attach-artifacts</id>
96+
<phase>install</phase>
16797
<goals>
168-
<goal>deploy-file</goal>
98+
<goal>attach-artifact</goal>
16999
</goals>
170100
<configuration>
171-
<repositoryId>nexus</repositoryId>
172-
<url>${deployNexusURL}</url>
173-
<groupId>${data-artifact.groupId}</groupId>
174-
<artifactId>${data-artifact.artifactId}</artifactId>
175-
<version>${data-artifact.version}</version>
176-
<pomFile>${project.build.directory}/loinc-export-pom.xml</pomFile>
177-
<file>${data-artifact.filename}-reasoned-pb.zip</file>
178-
<packaging>zip</packaging>
179-
<classifier>reasoned-pb</classifier>
101+
<artifacts>
102+
<artifact>
103+
<file>${project.build.directory}/${project.artifactId}-${project.version}-reasoned-sa.zip</file>
104+
<classifier>reasoned-sa</classifier>
105+
<type>zip</type>
106+
</artifact>
107+
<artifact>
108+
<file>${project.build.directory}/${project.artifactId}-${project.version}-reasoned-pb.zip</file>
109+
<classifier>reasoned-pb</classifier>
110+
<type>zip</type>
111+
</artifact>
112+
</artifacts>
180113
</configuration>
181114
</execution>
182115
</executions>

0 commit comments

Comments
 (0)