Skip to content

Commit a5d0ca1

Browse files
authored
Refactored release pipeline (#1080)
* Refactored release pipeline Signed-off-by: dhoard <[email protected]>
1 parent 91622ad commit a5d0ca1

13 files changed

+127
-427
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ integration_test_suite/integration_tests/src/test/resources/common/**.jar
1515
**/.hugo_build.lock
1616
smoke-test.log
1717
regression-test.log
18+
RELEASE

.pipeliner/verifyica-pipeliner.jar

854 KB
Binary file not shown.

MAINTAINERS.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
* Fabian Stäber <[email protected]> @fstab
21
* Doug Hoard <[email protected]> @dhoard
3-
* Tom Wilkie <[email protected]> @tomwilkie
2+
* Fabian Stäber <[email protected]> @fstab

MAINTAINER_NOTES.md

Lines changed: 18 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,35 @@
11
# Maintainer Notes
22

3-
Shell scripts to build and release are located int the `tools` directory.
3+
## Release
44

5-
## Build a pre-release
6-
___
5+
Verifyica [Pipeliner](https://github.com/verifyica-team/pipeliner) is used to run the release pipeline.
76

8-
**Pre-release builds are not source controlled (no branch, no tag)**
7+
- builds & runs integration tests using smoke test containers
8+
- creates & copies release artifacts
9+
- generates signatures and checksums for release artifacts
10+
- creates the release branch
11+
- tags the release
12+
- updates the `main` branch for development
913

10-
Command
14+
**Notes**
1115

12-
```shell
13-
./tools/build-and-copy.sh <version> <destination directory>
14-
```
16+
- `gpg` is required
17+
- `sha256sum` is required
1518

16-
Example
19+
### Example:
1720

1821
```shell
19-
./tools/build-and-copy.sh 0.20.0-ALPHA-1 "/tmp/"
22+
./pipeliner -Prelease=<RELEASE VERSION> release.yaml
2023
```
2124

22-
The jars will be located in `/tmp`
23-
24-
## Build and stage
25-
___
26-
27-
Release builds are source controlled.
28-
29-
- Creates a `release-<version>` branch
30-
- Creates a `<version>` tag
31-
- Pushes the branch and tag to GitHub
32-
- Stages the release to Maven Central
33-
34-
### Step 1
35-
36-
Command
25+
### Concrete Example:
3726

3827
```shell
39-
./tools/build-and-stage.sh <version>
28+
./pipeliner -Prelease=1.1.0 release.yaml
4029
```
4130

42-
Example
43-
44-
```shell
45-
./tools/build-and-stage.sh 0.20.0
46-
```
47-
48-
### Step 2
49-
50-
Download the staged artifacts from Maven Central and run the integration test suite.
51-
52-
```
53-
https://oss.sonatype.org/#stagingRepositories
54-
```
55-
56-
Example
57-
58-
```shell
59-
/home/dhoard/Downloads/jmx_prometheus_javaagent-0.20.0.jar
60-
/home/dhoard/Downloads/jmx_prometheus_standalone-0.20.0.jar
61-
```
31+
## Release Artifacts
6232

63-
Command
33+
Release artifacts will be located in the `RELEASE` directory.
6434

65-
```shell
66-
./tools/patch-and-run-integration-test-suite.sh <javaagent.jar> <standalone.jar>
67-
```
68-
69-
Example
70-
71-
```shell
72-
./tools/patch-and-run-integration-test-suite.sh /home/dhoard/Downloads/jmx_prometheus_javaagent-0.20.0.jar /home/dhoard/Downloads/jmx_prometheus_standalone-0.20.0.jar
73-
```
74-
75-
### Step 3
76-
77-
If the integration test suite in Step 2 passes, on Maven Central...
78-
79-
- Click `Close` to trigger Sonatype's verification
80-
- Once closed, click `Release`
81-
82-
83-
### Step 4
84-
85-
Verify the files are available via Maven Central (Maven)
86-
87-
Create a GitHub release
88-
89-
### Step 5
90-
91-
Checkout the `main` branch and increment the version
92-
93-
```shell
94-
git checkout main
95-
./tools/change-version.sh 1.0.0
96-
git add -u
97-
git commit -m "prepare for next development iteration"
98-
```
35+
Attach all files to the GitHub release.

jmx_prometheus_standalone/pom.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@
149149
</execution>
150150
</executions>
151151
</plugin>
152+
<!-- .deb has been deprecated, keeping the configuration in the scenario we want to reintroduce it -->
153+
<!--
152154
<plugin>
153155
<artifactId>jdeb</artifactId>
154156
<groupId>org.vafer</groupId>
@@ -192,6 +194,7 @@
192194
</execution>
193195
</executions>
194196
</plugin>
197+
-->
195198
<plugin>
196199
<groupId>com.coderplus.maven.plugins</groupId>
197200
<artifactId>copy-rename-maven-plugin</artifactId>

pipeliner

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
3+
CURRENT_DIR="$(pwd)"
4+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5+
export PIPELINER_HOME="${SCRIPT_DIR}"
6+
7+
cd "$SCRIPT_DIR" || exit 1
8+
9+
if [ $# -eq 0 ]; then
10+
echo "Usage: $(basename "$0") <pipeline.yaml> [pipeline2.yaml...]"
11+
cd "$CURRENT_DIR"
12+
exit 1
13+
fi
14+
15+
JAR_PATH="target/verifyica-pipeliner.jar"
16+
17+
if [ ! -f "$JAR_PATH" ]; then
18+
JAR_PATH="verifyica-pipeliner.jar"
19+
fi
20+
21+
if [ ! -f "$JAR_PATH" ]; then
22+
JAR_PATH=".verifyica-pipeliner/verifyica-pipeliner.jar"
23+
fi
24+
25+
if [ ! -f "$JAR_PATH" ]; then
26+
JAR_PATH=".verifyica/verifyica-pipeliner.jar"
27+
fi
28+
29+
if [ ! -f "$JAR_PATH" ]; then
30+
JAR_PATH=".pipeliner/verifyica-pipeliner.jar"
31+
fi
32+
33+
if [ ! -f "$JAR_PATH" ]; then
34+
echo "verifyica-pipeliner.jar not found"
35+
cd "$CURRENT_DIR"
36+
exit 1
37+
fi
38+
39+
JAR_PATH=$(realpath "$JAR_PATH")
40+
cd "$CURRENT_DIR"
41+
export PIPELINER_WORKING_DIRECTORY="$CURRENT_DIR"
42+
43+
java -jar "${JAR_PATH}" "$@"

pom.xml

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -94,53 +94,6 @@
9494
</dependencies>
9595
</dependencyManagement>
9696

97-
<profiles>
98-
<profile>
99-
<id>release</id>
100-
<build>
101-
<plugins>
102-
<plugin>
103-
<groupId>org.apache.maven.plugins</groupId>
104-
<artifactId>maven-gpg-plugin</artifactId>
105-
<executions>
106-
<execution>
107-
<id>sign-artifacts</id>
108-
<phase>verify</phase>
109-
<goals>
110-
<goal>sign</goal>
111-
</goals>
112-
</execution>
113-
</executions>
114-
</plugin>
115-
<plugin>
116-
<groupId>org.apache.maven.plugins</groupId>
117-
<artifactId>maven-source-plugin</artifactId>
118-
<executions>
119-
<execution>
120-
<id>attach-sources</id>
121-
<goals>
122-
<goal>jar-no-fork</goal>
123-
</goals>
124-
</execution>
125-
</executions>
126-
</plugin>
127-
<plugin>
128-
<groupId>org.apache.maven.plugins</groupId>
129-
<artifactId>maven-javadoc-plugin</artifactId>
130-
<executions>
131-
<execution>
132-
<id>attach-javadocs</id>
133-
<goals>
134-
<goal>jar</goal>
135-
</goals>
136-
</execution>
137-
</executions>
138-
</plugin>
139-
</plugins>
140-
</build>
141-
</profile>
142-
</profiles>
143-
14497
<build>
14598
<pluginManagement>
14699
<plugins>
@@ -256,20 +209,6 @@
256209
</execution>
257210
</executions>
258211
</plugin>
259-
<plugin>
260-
<artifactId>maven-release-plugin</artifactId>
261-
<groupId>org.apache.maven.plugins</groupId>
262-
<configuration>
263-
<autoVersionSubmodules>true</autoVersionSubmodules>
264-
<useReleaseProfile>false</useReleaseProfile>
265-
<releaseProfiles>release</releaseProfiles>
266-
<goals>deploy</goals>
267-
</configuration>
268-
</plugin>
269-
<plugin>
270-
<artifactId>maven-deploy-plugin</artifactId>
271-
<groupId>org.apache.maven.plugins</groupId>
272-
</plugin>
273212
<plugin>
274213
<groupId>org.apache.felix</groupId>
275214
<artifactId>maven-bundle-plugin</artifactId>

release.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
pipeline:
2+
name: release
3+
jobs:
4+
- name: release
5+
enabled: true
6+
steps:
7+
- name: change version
8+
enabled: true
9+
run: |
10+
./mvnw -B versions:set -DnewVersion="${{ release }}" -DprocessAllModules >> /dev/null
11+
rm -Rf $(find . -name "*versionsBackup")
12+
- name: build & verify
13+
enabled: true
14+
run: ./mvnw clean verify
15+
- name: create / clean RELEASE directory
16+
enabled: true
17+
run: |
18+
mkdir -p RELEASE
19+
rm -Rf RELEASE/*
20+
- name: copy artifacts
21+
enabled: true
22+
run: |
23+
cp jmx_prometheus_javaagent/target/jmx_prometheus_javaagent-${{ release }}.jar RELEASE/.
24+
cp jmx_prometheus_standalone/target/jmx_prometheus_standalone-${{ release }}.jar RELEASE/.
25+
- name: create signature & checksums
26+
enabled: true
27+
working-directory: RELEASE
28+
run: |
29+
for FILE in *.jar; do gpg --armor --detach-sign "$FILE"; done
30+
for FILE in *.jar; do sha256sum "$FILE" > "$FILE".sha256; done
31+
- name: commit version
32+
enabled: true
33+
run: |
34+
git add -u
35+
git commit -s -m "release-${{ release }}"
36+
- name: tag version
37+
enabled: true
38+
run: |
39+
git tag "${{ release }}"
40+
git push --tags
41+
- name: checkout & push release branch
42+
enabled: true
43+
run: |
44+
git checkout -b "release-${{ release }}"
45+
git push --set-upstream origin "release-${{ release }}"
46+
- name: checkout main
47+
enabled: true
48+
run: git checkout main
49+
- name: change version
50+
enabled: true
51+
run: |
52+
./mvnw -B versions:set -DnewVersion="${{ release }}-post" -DprocessAllModules >> /dev/null
53+
rm -Rf $(find . -name "*versionsBackup")
54+
- name: commit version
55+
enabled: true
56+
run: |
57+
git add -u
58+
git commit -s -m "Prepare for development"
59+
- name: git push
60+
enabled: true
61+
run: git push

run_sample_standalone.sh

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)