Skip to content

Commit 6569207

Browse files
committed
SWS-1043 - Introduce Concourse
1 parent ba09926 commit 6569207

File tree

9 files changed

+418
-151
lines changed

9 files changed

+418
-151
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ _site
2020
/.project
2121
/.settings/
2222

23-
*.versionsBackup
23+
*.versionsBackup
24+
25+
credentials.yml

ci/README.adoc

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
== Spring Web Services CI
2+
3+
Spring Web Services uses Concourse as it's CI tool of choice. This provides support for:
4+
5+
* Pipelines against the `master` and `2.x` branch
6+
* Support for pull requests
7+
8+
=== Creating a pipeline
9+
10+
Using the `fly` command, you can execute a series of commands to create multiple pipelines to manage everything. But
11+
first, some critical credentials are needed.
12+
13+
Create a `credentials.yml` file like this:
14+
15+
[source,yml]
16+
----
17+
github-access-token: <your Personal Access Token from github>
18+
docker-email: <your docker hub email address>
19+
docker-username: <your docker hub username>
20+
docker-password: <your docker hub password>
21+
artifactory-username: <your artifactory username>
22+
artifactory-password: <your artifactory encoded password>
23+
----
24+
25+
WARNING: Do NOT check this file into source control! If you'll check, `credentials.yml` is listed in `.gitignore` to prevent tihs.
26+
27+
With this in place, run the following `fly` commands to create pipelines:
28+
29+
----
30+
% fly -t <team-name> sp -p spring-ws -c ci/pipeline-template.yml -l credentials.yml -v branch=master
31+
% fly -t <team-name> sp -p spring-ws-2.x -c ci/pipeline-template.yml -l credentials.yml -v branch=2.x
32+
----
33+
34+
This creates pipelines for:
35+
36+
* Spring WS `master` branch
37+
* Spring WS `2.x` branch
38+
39+
With these pipelines in place, you can now activate and expose them:
40+
41+
----
42+
% fly -t <team-name> unpause-pipeline -p spring-ws
43+
% fly -t <team-name> expose-pipeline -p spring-ws
44+
% fly -t <team-name> unpause-pipeline -p spring-ws-2.x
45+
% fly -t <team-name> expose-pipeline -p spring-ws-2.x
46+
----

ci/build.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash -x
2+
3+
set -euo pipefail
4+
5+
[[ -d $PWD/maven && ! -d $HOME/.m2 ]] && ln -s $PWD/maven $HOME/.m2
6+
7+
spring_ws_artifactory=$(pwd)/spring-ws-artifactory
8+
9+
rm -rf $HOME/.m2/repository/org/springframework/ws 2> /dev/null || :
10+
11+
cd spring-ws-github
12+
13+
./mvnw -Pdistribute,snapshot,docs -Dmaven.test.skip=true clean deploy \
14+
-DaltDeploymentRepository=distribution::default::file://${spring_ws_artifactory}

ci/build.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
platform: linux
3+
4+
image_resource:
5+
type: docker-image
6+
source:
7+
repository: openjdk
8+
tag: 8-jdk
9+
10+
inputs:
11+
- name: spring-ws-github
12+
13+
outputs:
14+
- name: spring-ws-artifactory
15+
16+
caches:
17+
- path: maven
18+
19+
run:
20+
path: spring-ws-github/ci/build.sh

ci/pipeline-template.yml

Lines changed: 279 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,279 @@
1+
---
2+
resource_types:
3+
- name: artifactory-resource
4+
type: docker-image
5+
source:
6+
repository: springio/artifactory-resource
7+
tag: 0.0.4
8+
9+
- name: github-status
10+
type: docker-image
11+
source:
12+
repository: dpb587/github-status-resource
13+
tag: master
14+
15+
- name: pull-request
16+
type: docker-image
17+
source:
18+
repository: jtarchie/pr
19+
tag: latest
20+
21+
- name: slack-notification
22+
type: docker-image
23+
source:
24+
repository: nebhale/slack-notification-resource
25+
26+
resources:
27+
- name: openjdk:8-jdk
28+
type: docker-image
29+
source:
30+
repository: openjdk
31+
tag: 8-jdk
32+
33+
- name: openjdk:11-jdk
34+
type: docker-image
35+
source:
36+
repository: openjdk
37+
tag: 11-jdk
38+
39+
- name: spring-ws-github
40+
type: git
41+
source:
42+
uri: https://github.com/spring-projects/spring-ws.git
43+
branch: ((branch))
44+
45+
- name: spring-ws-artifactory
46+
type: artifactory-resource
47+
source:
48+
uri: https://repo.spring.io
49+
username: ((artifactory-username))
50+
password: ((artifactory-password))
51+
build_name: Spring Web Services
52+
53+
- name: spring-ws-pull-requests
54+
type: pull-request
55+
source:
56+
access_token: ((github-access-token))
57+
repo: spring-projects/spring-ws
58+
base: ((branch))
59+
60+
- name: spring-ws-status
61+
type: github-status
62+
source:
63+
access_token: ((github-access-token))
64+
repository: spring-projects/spring-ws
65+
branch: concourse
66+
67+
groups:
68+
- name: spring-ws
69+
jobs:
70+
- Test - JDK 8
71+
- Test - JDK 8 + Spring.NEXT
72+
- Test - JDK 8 + Spring.NEXT (snapshots)
73+
- Test - JDK 8 + Spring (snapshots)
74+
- Test - JDK 11
75+
- Test - JDK 11 + Spring.NEXT
76+
- Test - JDK 11 + Spring.NEXT (snapshots)
77+
- Test - JDK 11 + Spring (snapshots)
78+
- Build
79+
- name: pull-requests
80+
jobs:
81+
- spring-ws-pull-requests
82+
83+
jobs:
84+
- name: Test - JDK 8
85+
serial: true
86+
public: true
87+
plan:
88+
- get: spring-ws-github
89+
trigger: true
90+
- get: openjdk:8-jdk
91+
trigger: true
92+
- task: test
93+
file: spring-ws-github/ci/test.yml
94+
params: { PROFILE: "distribute,convergence" }
95+
96+
- name: Test - JDK 8 + Spring.NEXT
97+
serial: true
98+
public: true
99+
plan:
100+
- get: spring-ws-github
101+
trigger: true
102+
- get: openjdk:8-jdk
103+
trigger: true
104+
- task: test
105+
file: spring-ws-github/ci/test.yml
106+
params: { PROFILE: "springnext,convergence" }
107+
108+
- name: Test - JDK 8 + Spring.NEXT (snapshots)
109+
serial: true
110+
public: true
111+
plan:
112+
- get: spring-ws-github
113+
trigger: true
114+
- get: openjdk:8-jdk
115+
trigger: true
116+
- task: test
117+
file: spring-ws-github/ci/test.yml
118+
params: { PROFILE: "springnext-buildsnapshot,convergence" }
119+
120+
- name: Test - JDK 8 + Spring (snapshots)
121+
serial: true
122+
public: true
123+
plan:
124+
- get: spring-ws-github
125+
trigger: true
126+
- get: openjdk:8-jdk
127+
trigger: true
128+
- task: test
129+
file: spring-ws-github/ci/test.yml
130+
params: { PROFILE: "spring-buildsnapshot,convergence" }
131+
132+
- name: Test - JDK 11
133+
serial: true
134+
public: true
135+
plan:
136+
- get: spring-ws-github
137+
trigger: true
138+
- get: openjdk:11-jdk
139+
trigger: true
140+
- task: test
141+
image: openjdk:11-jdk
142+
file: spring-ws-github/ci/test.yml
143+
params: { PROFILE: "distribute,java11,convergence" }
144+
145+
- name: Test - JDK 11 + Spring.NEXT
146+
serial: true
147+
public: true
148+
plan:
149+
- get: spring-ws-github
150+
trigger: true
151+
- get: openjdk:11-jdk
152+
trigger: true
153+
- task: test
154+
image: openjdk:11-jdk
155+
file: spring-ws-github/ci/test.yml
156+
params: { PROFILE: "springnext,java11,convergence" }
157+
158+
- name: Test - JDK 11 + Spring.NEXT (snapshots)
159+
serial: true
160+
public: true
161+
plan:
162+
- get: spring-ws-github
163+
trigger: true
164+
- get: openjdk:11-jdk
165+
trigger: true
166+
- task: test
167+
image: openjdk:11-jdk
168+
file: spring-ws-github/ci/test.yml
169+
params: { PROFILE: "springnext-buildsnapshot,java11,convergence" }
170+
171+
- name: Test - JDK 11 + Spring (snapshots)
172+
serial: true
173+
public: true
174+
plan:
175+
- get: spring-ws-github
176+
trigger: true
177+
- get: openjdk:11-jdk
178+
trigger: true
179+
- task: test
180+
image: openjdk:11-jdk
181+
file: spring-ws-github/ci/test.yml
182+
params: { PROFILE: "spring-buildsnapshot,java11,convergence" }
183+
184+
- name: Build
185+
serial: true
186+
public: true
187+
plan:
188+
- get: spring-ws-github
189+
trigger: true
190+
passed: [
191+
Test - JDK 8,
192+
Test - JDK 8 + Spring.NEXT,
193+
Test - JDK 8 + Spring.NEXT (snapshots),
194+
Test - JDK 8 + Spring (snapshots),
195+
Test - JDK 11,
196+
Test - JDK 11 + Spring.NEXT,
197+
Test - JDK 11 + Spring.NEXT (snapshots),
198+
Test - JDK 11 + Spring (snapshots)
199+
]
200+
- put: spring-ws-status
201+
params:
202+
commit: spring-ws-github
203+
state: pending
204+
- task: build
205+
file: spring-ws-github/ci/build.yml
206+
- put: spring-ws-artifactory
207+
params:
208+
build_number: ${BUILD_NAME}
209+
build_uri: ${ATC_EXTERNAL_URL}/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}
210+
repo: libs-snapshot-local
211+
folder: spring-ws-artifactory
212+
artifact_set:
213+
- include:
214+
- "/**"
215+
properties:
216+
archives: '*:*:*:*@zip zip.name:spring-ws, zip.displayname:Spring Web Services, zip.deployed:false'
217+
on_failure:
218+
put: spring-ws-status
219+
params:
220+
commit: spring-ws-github
221+
state: failure
222+
on_success:
223+
put: spring-ws-status
224+
params:
225+
commit: spring-ws-github
226+
state: success
227+
228+
- name: spring-ws-pull-requests
229+
public: true
230+
plan:
231+
- get: spring-ws-github
232+
resource: spring-ws-pull-requests
233+
trigger: true
234+
version: every
235+
- get: openjdk:11-jdk
236+
trigger: true
237+
- put: spring-ws-pull-requests
238+
params:
239+
path: spring-ws-github
240+
status: pending
241+
- aggregate:
242+
- task: test (JDK 8)
243+
file: spring-ws-github/ci/test.yml
244+
params: { PROFILE: "distribute,convergence" }
245+
- task: test (JDK 8 + Spring.NEXT)
246+
file: spring-ws-github/ci/test.yml
247+
params: { PROFILE: "springnext,convergence" }
248+
- task: test (JDK 8 + Spring.NEXT snapshots)
249+
file: spring-ws-github/ci/test.yml
250+
params: { PROFILE: "springnext-buildsnapshot,convergence" }
251+
- task: test (JDK 8 + Spring snapshots)
252+
file: spring-ws-github/ci/test.yml
253+
params: { PROFILE: "spring-buildsnapshot,convergence" }
254+
- task: test (JDK 11)
255+
image: openjdk:11-jdk
256+
file: spring-ws-github/ci/test.yml
257+
params: { PROFILE: "distribute,java11,convergence" }
258+
- task: test (JDK 11 + Spring.NEXT)
259+
image: openjdk:11-jdk
260+
file: spring-ws-github/ci/test.yml
261+
params: { PROFILE: "springnext,java11,convergence" }
262+
- task: test (JDK 11 + Spring.NEXT snapshots)
263+
image: openjdk:11-jdk
264+
file: spring-ws-github/ci/test.yml
265+
params: { PROFILE: "springnext-buildsnapshot,java11,convergence" }
266+
- task: test (JDK 11 + Spring snapshots)
267+
image: openjdk:11-jdk
268+
file: spring-ws-github/ci/test.yml
269+
params: { PROFILE: "spring-buildsnapshot,java11,convergence" }
270+
on_failure:
271+
put: spring-ws-pull-requests
272+
params:
273+
path: spring-ws-github
274+
status: failure
275+
on_success:
276+
put: spring-ws-pull-requests
277+
params:
278+
path: spring-ws-github
279+
status: success

ci/test.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash -x
2+
3+
set -euo pipefail
4+
5+
[[ -d $PWD/maven && ! -d $HOME/.m2 ]] && ln -s $PWD/maven $HOME/.m2
6+
7+
rm -rf $HOME/.m2/repository/org/springframework/ws 2> /dev/null || :
8+
9+
cd spring-ws-github
10+
11+
./mvnw -P${PROFILE} clean test

0 commit comments

Comments
 (0)