Skip to content

Commit e9f9462

Browse files
committed
Add Concourse CI pipeline
Add CI pipeline for builds and releases. Fixes spring-projectsgh-9316
1 parent da0c4f5 commit e9f9462

18 files changed

+538
-0
lines changed

ci/README.adoc

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
== Concourse pipeline
2+
3+
To set the pipeline first create a file in this directory called `secrets.yml`:
4+
5+
[source,yaml]
6+
.secrets.yml
7+
----
8+
docker-hub-username: <user>
9+
docker-hub-password: <secret>
10+
github-username: <user>
11+
github-password: <secret>
12+
artifactory-username: <user>
13+
artifactory-password: <secret>
14+
----
15+
16+
NOTE: The file should be ignored by git, make sure that you don't commit it!
17+
18+
Once the file has been created, the pipeline can be deployed:
19+
20+
[source]
21+
----
22+
$ fly -t spring set-pipeline -p spring-boot -c ci/pipeline.yml -l ci/parameters.yml -l ci/secrets.yml
23+
----
24+
25+
=== Release
26+
27+
To release a milestone:
28+
29+
[source]
30+
----
31+
$ fly -t spring trigger-job -j spring-boot/stage-milestone
32+
$ fly -t spring trigger-job -j spring-boot/promote-milestone
33+
----
34+
35+
To release an RC:
36+
37+
[source]
38+
----
39+
$ fly -t spring trigger-job -j spring-boot/stage-rc
40+
$ fly -t spring trigger-job -j spring-boot/promote-rc
41+
----
42+
43+
To release a GA:
44+
45+
[source]
46+
----
47+
$ fly -t spring trigger-job -j spring-boot/stage-release
48+
$ fly -t spring trigger-job -j spring-boot/promote-release
49+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM openjdk:8u141-jdk
2+
3+
RUN apt-get update && \
4+
apt-get install -y git && \
5+
apt-get install -y libxml2-utils && \
6+
apt-get install -y jq
7+
8+
ADD https://raw.githubusercontent.com/spring-io/concourse-java-scripts/v0.0.1/concourse-java.sh /opt/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM openjdk:9-b179-jdk
2+
3+
RUN apt-get update && \
4+
apt-get install -y git && \
5+
apt-get install -y libxml2-utils && \
6+
apt-get install -y jq
7+
8+
ADD https://raw.githubusercontent.com/spring-io/concourse-java-scripts/v0.0.1/concourse-java.sh /opt/

ci/parameters.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
email-server: "smtp.svc.pivotal.io"
2+
email-from: "[email protected]"
3+
email-to: ["[email protected]"]
4+
github-repo: "https://github.com/spring-projects/spring-boot.git"
5+
docker-hub-organization: "springci"
6+
artifactory-server: "https://repo.spring.io/"
7+
branch: "master"
8+
build-name: "spring-boot"
9+
bintray-subject: "spring"
10+
bintray-repo: "jars"

ci/pipeline.yml

+259
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,259 @@
1+
resource_types:
2+
- name: artifactory-resource
3+
type: docker-image
4+
source:
5+
repository: springio/artifactory-resource
6+
tag: 0.0.1
7+
- name: email
8+
type: docker-image
9+
source:
10+
repository: pcfseceng/email-resource
11+
resources:
12+
- name: git-repo
13+
type: git
14+
source:
15+
uri: ((github-repo))
16+
username: ((github-username))
17+
password: ((github-password))
18+
branch: ((branch))
19+
ignore_paths: ["ci/images/*"]
20+
- name: ci-images-git-repo
21+
type: git
22+
source:
23+
uri: ((github-repo))
24+
branch: ((branch))
25+
paths: ["ci/images/*"]
26+
- name: spring-boot-ci-image
27+
type: docker-image
28+
source:
29+
repository: ((docker-hub-organization))/spring-boot-ci-image
30+
username: ((docker-hub-username))
31+
password: ((docker-hub-password))
32+
tag: ((branch))
33+
- name: spring-boot-jdk9-ci-image
34+
type: docker-image
35+
source:
36+
repository: ((docker-hub-organization))/spring-boot-jdk9-ci-image
37+
username: ((docker-hub-username))
38+
password: ((docker-hub-password))
39+
tag: ((branch))
40+
- name: artifactory-repo
41+
type: artifactory-resource
42+
source:
43+
uri: ((artifactory-server))
44+
username: ((artifactory-username))
45+
password: ((artifactory-password))
46+
build_name: ((build-name))
47+
- name: email-notification
48+
type: email
49+
source:
50+
smtp:
51+
host: ((email-server))
52+
port: "25"
53+
anonymous: true
54+
skip_ssl_validation: true
55+
from: ((email-from))
56+
to: ((email-to))
57+
jobs:
58+
- name: build-spring-boot-ci-images
59+
plan:
60+
- get: ci-images-git-repo
61+
trigger: true
62+
- put: spring-boot-ci-image
63+
params:
64+
build: ci-images-git-repo/ci/images/spring-boot-ci-image
65+
- put: spring-boot-jdk9-ci-image
66+
params:
67+
build: ci-images-git-repo/ci/images/spring-boot-jdk9-ci-image
68+
- name: build
69+
serial: true
70+
plan:
71+
- get: spring-boot-ci-image
72+
- get: git-repo
73+
trigger: true
74+
- do:
75+
- task: build-project
76+
timeout: 1h30m
77+
image: spring-boot-ci-image
78+
file: git-repo/ci/tasks/build-project.yml
79+
- aggregate:
80+
- task: build-samples
81+
timeout: 1h30m
82+
image: spring-boot-ci-image
83+
file: git-repo/ci/tasks/build-samples.yml
84+
- task: build-integration-tests
85+
timeout: 1h30m
86+
image: spring-boot-ci-image
87+
file: git-repo/ci/tasks/build-integration-tests.yml
88+
- task: build-deployment-tests
89+
timeout: 1h30m
90+
image: spring-boot-ci-image
91+
file: git-repo/ci/tasks/build-deployment-tests.yml
92+
on_failure:
93+
put: email-notification
94+
params:
95+
subject_text: "Build failure ${BUILD_PIPELINE_NAME} / ${BUILD_JOB_NAME} / ${BUILD_NAME}"
96+
body_text: "Build ${ATC_EXTERNAL_URL}/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME} has failed!"
97+
- put: artifactory-repo
98+
params: &artifactory-params
99+
repo: libs-snapshot-local
100+
build_number: "${BUILD_ID}"
101+
folder: distribution-repository
102+
build_uri: "https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}"
103+
build_number: "${BUILD_PIPELINE_NAME}-${BUILD_JOB_NAME}-${BUILD_NAME}"
104+
artifact_set:
105+
- include:
106+
- "/**/spring-boot-docs-*.zip"
107+
properties:
108+
zip-type: "docs"
109+
zip-deployed: "false"
110+
- name: jdk9-build
111+
serial: true
112+
plan:
113+
- get: spring-boot-jdk9-ci-image
114+
- get: git-repo
115+
- do:
116+
- task: build-project
117+
timeout: 1h30m
118+
image: spring-boot-jdk9-ci-image
119+
file: git-repo/ci/tasks/build-project.yml
120+
- aggregate:
121+
- task: build-samples
122+
timeout: 1h30m
123+
image: spring-boot-jdk9-ci-image
124+
file: git-repo/ci/tasks/build-samples.yml
125+
- task: build-integration-tests
126+
timeout: 1h30m
127+
image: spring-boot-jdk9-ci-image
128+
file: git-repo/ci/tasks/build-integration-tests.yml
129+
- task: build-deployment-tests
130+
timeout: 1h30m
131+
image: spring-boot-jdk9-ci-image
132+
file: git-repo/ci/tasks/build-deployment-tests.yml
133+
on_failure:
134+
put: email-notification
135+
params:
136+
subject_text: "JDK 9 Build failure ${BUILD_PIPELINE_NAME} / ${BUILD_JOB_NAME} / ${BUILD_NAME}"
137+
body_text: "Build ${ATC_EXTERNAL_URL}/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME} has failed!"
138+
- name: stage-milestone
139+
serial: true
140+
plan:
141+
- get: spring-boot-ci-image
142+
- get: git-repo
143+
trigger: false
144+
- task: stage
145+
image: spring-boot-ci-image
146+
file: git-repo/ci/tasks/stage.yml
147+
params:
148+
RELEASE_TYPE: M
149+
- put: artifactory-repo
150+
params:
151+
<<: *artifactory-params
152+
repo: libs-staging-local
153+
- put: git-repo
154+
params:
155+
repository: stage-git-repo
156+
- name: stage-rc
157+
serial: true
158+
plan:
159+
- get: spring-boot-ci-image
160+
- get: git-repo
161+
trigger: false
162+
- task: stage
163+
image: spring-boot-ci-image
164+
file: git-repo/ci/tasks/stage.yml
165+
params:
166+
RELEASE_TYPE: RC
167+
- put: artifactory-repo
168+
params:
169+
<<: *artifactory-params
170+
repo: libs-staging-local
171+
- put: git-repo
172+
params:
173+
repository: stage-git-repo
174+
- name: stage-release
175+
serial: true
176+
plan:
177+
- get: spring-boot-ci-image
178+
- get: git-repo
179+
trigger: false
180+
- task: stage
181+
image: spring-boot-ci-image
182+
file: git-repo/ci/tasks/stage.yml
183+
params:
184+
RELEASE_TYPE: RELEASE
185+
- put: artifactory-repo
186+
params:
187+
<<: *artifactory-params
188+
repo: libs-staging-local
189+
- put: git-repo
190+
params:
191+
repository: stage-git-repo
192+
- name: promote-milestone
193+
serial: true
194+
plan:
195+
- get: spring-boot-ci-image
196+
- get: git-repo
197+
trigger: false
198+
- get: artifactory-repo
199+
trigger: false
200+
passed: [stage-milestone]
201+
params:
202+
save_build_info: true
203+
- task: promote
204+
image: spring-boot-ci-image
205+
file: git-repo/ci/tasks/promote.yml
206+
params:
207+
RELEASE_TYPE: M
208+
ARTIFACTORY_SERVER: ((artifactory-server))
209+
ARTIFACTORY_USERNAME: ((artifactory-username))
210+
ARTIFACTORY_PASSWORD: ((artifactory-password))
211+
- name: promote-rc
212+
serial: true
213+
plan:
214+
- get: git-repo
215+
trigger: false
216+
- get: artifactory-repo
217+
trigger: false
218+
passed: [stage-rc]
219+
params:
220+
save_build_info: true
221+
- task: promote
222+
image: spring-boot-ci-image
223+
file: git-repo/ci/tasks/promote.yml
224+
params:
225+
RELEASE_TYPE: RC
226+
ARTIFACTORY_SERVER: ((artifactory-server))
227+
ARTIFACTORY_USERNAME: ((artifactory-username))
228+
ARTIFACTORY_PASSWORD: ((artifactory-password))
229+
- name: promote-release
230+
serial: true
231+
plan:
232+
- get: git-repo
233+
trigger: false
234+
- get: artifactory-repo
235+
trigger: false
236+
passed: [stage-release]
237+
params:
238+
save_build_info: true
239+
- task: promote
240+
image: spring-boot-ci-image
241+
file: git-repo/ci/tasks/promote.yml
242+
params:
243+
RELEASE_TYPE: RELEASE
244+
ARTIFACTORY_SERVER: ((artifactory-server))
245+
ARTIFACTORY_USERNAME: ((artifactory-username))
246+
ARTIFACTORY_PASSWORD: ((artifactory-password))
247+
BINTRAY_USERNAME: ((bintray-username))
248+
BINTRAY_PASSWORD: ((bintray-password))
249+
SONATYPE_USERNAME: ((sonattype-username))
250+
SONATYPE_PASSWORD: ((sonattype-password))
251+
BINTRAY_SUBJECT: ((bintray-subject))
252+
BINTRAY_REPO: ((bintray-repo))
253+
groups:
254+
- name: "Build"
255+
jobs: ["build", "jdk9-build"]
256+
- name: "Release"
257+
jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone", "promote-rc", "promote-release"]
258+
- name: "CI Images"
259+
jobs: ["build-spring-boot-ci-images"]

ci/scripts/build-deployment-tests.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -e
3+
4+
source $(dirname $0)/common.sh
5+
repository=$(pwd)/distribution-repository
6+
7+
pushd git-repo > /dev/null
8+
run_maven -f spring-boot-tests/spring-boot-deployment-tests/pom.xml clean install -U -Dfull -Drepository=file://${repository}
9+
popd > /dev/null

ci/scripts/build-integration-tests.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -e
3+
4+
source $(dirname $0)/common.sh
5+
repository=$(pwd)/distribution-repository
6+
7+
pushd git-repo > /dev/null
8+
run_maven -f spring-boot-tests/spring-boot-integration-tests/pom.xml clean install -U -Dfull -Drepository=file://${repository}
9+
popd > /dev/null

ci/scripts/build-project.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -e
3+
4+
source $(dirname $0)/common.sh
5+
repository=$(pwd)/distribution-repository
6+
7+
pushd git-repo > /dev/null
8+
run_maven -f spring-boot-project/pom.xml clean deploy -U -Dfull -DaltDeploymentRepository=distribution::default::file://${repository}
9+
popd > /dev/null

ci/scripts/build-samples.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -e
3+
4+
source $(dirname $0)/common.sh
5+
repository=$(pwd)/distribution-repository
6+
7+
pushd git-repo > /dev/null
8+
run_maven -f spring-boot-samples/pom.xml clean install -U -Dfull -Drepository=file://${repository}
9+
popd > /dev/null

ci/scripts/common.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source /opt/concourse-java.sh
2+
3+
setup_symlinks
4+
cleanup_maven_repo "org.springframework.boot"

0 commit comments

Comments
 (0)