SWS-1043 - Introduce Concourse

This commit is contained in:
Greg Turnquist
2018-11-06 09:50:16 -06:00
parent c4bbcd25c0
commit 7d0fe26672
9 changed files with 418 additions and 129 deletions

4
.gitignore vendored
View File

@@ -20,4 +20,6 @@ _site
/.project
/.settings/
*.versionsBackup
*.versionsBackup
credentials.yml

46
ci/README.adoc Normal file
View File

@@ -0,0 +1,46 @@
== Spring Web Services CI
Spring Web Services uses Concourse as it's CI tool of choice. This provides support for:
* Pipelines against the `master` and `2.x` branch
* Support for pull requests
=== Creating a pipeline
Using the `fly` command, you can execute a series of commands to create multiple pipelines to manage everything. But
first, some critical credentials are needed.
Create a `credentials.yml` file like this:
[source,yml]
----
github-access-token: <your Personal Access Token from github>
docker-email: <your docker hub email address>
docker-username: <your docker hub username>
docker-password: <your docker hub password>
artifactory-username: <your artifactory username>
artifactory-password: <your artifactory encoded password>
----
WARNING: Do NOT check this file into source control! If you'll check, `credentials.yml` is listed in `.gitignore` to prevent tihs.
With this in place, run the following `fly` commands to create pipelines:
----
% fly -t <team-name> sp -p spring-ws -c ci/pipeline-template.yml -l credentials.yml -v branch=master
% fly -t <team-name> sp -p spring-ws-2.x -c ci/pipeline-template.yml -l credentials.yml -v branch=2.x
----
This creates pipelines for:
* Spring WS `master` branch
* Spring WS `2.x` branch
With these pipelines in place, you can now activate and expose them:
----
% fly -t <team-name> unpause-pipeline -p spring-ws
% fly -t <team-name> expose-pipeline -p spring-ws
% fly -t <team-name> unpause-pipeline -p spring-ws-2.x
% fly -t <team-name> expose-pipeline -p spring-ws-2.x
----

14
ci/build.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash -x
set -euo pipefail
[[ -d $PWD/maven && ! -d $HOME/.m2 ]] && ln -s $PWD/maven $HOME/.m2
spring_ws_artifactory=$(pwd)/spring-ws-artifactory
rm -rf $HOME/.m2/repository/org/springframework/ws 2> /dev/null || :
cd spring-ws-github
./mvnw -Pdistribute,snapshot,docs -Dmaven.test.skip=true clean deploy \
-DaltDeploymentRepository=distribution::default::file://${spring_ws_artifactory}

20
ci/build.yml Normal file
View File

@@ -0,0 +1,20 @@
---
platform: linux
image_resource:
type: docker-image
source:
repository: openjdk
tag: 8-jdk
inputs:
- name: spring-ws-github
outputs:
- name: spring-ws-artifactory
caches:
- path: maven
run:
path: spring-ws-github/ci/build.sh

279
ci/pipeline-template.yml Normal file
View File

@@ -0,0 +1,279 @@
---
resource_types:
- name: artifactory-resource
type: docker-image
source:
repository: springio/artifactory-resource
tag: 0.0.4
- name: github-status
type: docker-image
source:
repository: dpb587/github-status-resource
tag: master
- name: pull-request
type: docker-image
source:
repository: jtarchie/pr
tag: latest
- name: slack-notification
type: docker-image
source:
repository: nebhale/slack-notification-resource
resources:
- name: openjdk:8-jdk
type: docker-image
source:
repository: openjdk
tag: 8-jdk
- name: openjdk:11-jdk
type: docker-image
source:
repository: openjdk
tag: 11-jdk
- name: spring-ws-github
type: git
source:
uri: https://github.com/spring-projects/spring-ws.git
branch: ((branch))
- name: spring-ws-artifactory
type: artifactory-resource
source:
uri: https://repo.spring.io
username: ((artifactory-username))
password: ((artifactory-password))
build_name: Spring Web Services
- name: spring-ws-pull-requests
type: pull-request
source:
access_token: ((github-access-token))
repo: spring-projects/spring-ws
base: ((branch))
- name: spring-ws-status
type: github-status
source:
access_token: ((github-access-token))
repository: spring-projects/spring-ws
branch: concourse
groups:
- name: spring-ws
jobs:
- Test - JDK 8
- Test - JDK 8 + Spring.NEXT
- Test - JDK 8 + Spring.NEXT (snapshots)
- Test - JDK 8 + Spring (snapshots)
- Test - JDK 11
- Test - JDK 11 + Spring.NEXT
- Test - JDK 11 + Spring.NEXT (snapshots)
- Test - JDK 11 + Spring (snapshots)
- Build
- name: pull-requests
jobs:
- spring-ws-pull-requests
jobs:
- name: Test - JDK 8
serial: true
public: true
plan:
- get: spring-ws-github
trigger: true
- get: openjdk:8-jdk
trigger: true
- task: test
file: spring-ws-github/ci/test.yml
params: { PROFILE: "distribute,convergence" }
- name: Test - JDK 8 + Spring.NEXT
serial: true
public: true
plan:
- get: spring-ws-github
trigger: true
- get: openjdk:8-jdk
trigger: true
- task: test
file: spring-ws-github/ci/test.yml
params: { PROFILE: "springnext,convergence" }
- name: Test - JDK 8 + Spring.NEXT (snapshots)
serial: true
public: true
plan:
- get: spring-ws-github
trigger: true
- get: openjdk:8-jdk
trigger: true
- task: test
file: spring-ws-github/ci/test.yml
params: { PROFILE: "springnext-buildsnapshot,convergence" }
- name: Test - JDK 8 + Spring (snapshots)
serial: true
public: true
plan:
- get: spring-ws-github
trigger: true
- get: openjdk:8-jdk
trigger: true
- task: test
file: spring-ws-github/ci/test.yml
params: { PROFILE: "spring-buildsnapshot,convergence" }
- name: Test - JDK 11
serial: true
public: true
plan:
- get: spring-ws-github
trigger: true
- get: openjdk:11-jdk
trigger: true
- task: test
image: openjdk:11-jdk
file: spring-ws-github/ci/test.yml
params: { PROFILE: "distribute,java11,convergence" }
- name: Test - JDK 11 + Spring.NEXT
serial: true
public: true
plan:
- get: spring-ws-github
trigger: true
- get: openjdk:11-jdk
trigger: true
- task: test
image: openjdk:11-jdk
file: spring-ws-github/ci/test.yml
params: { PROFILE: "springnext,java11,convergence" }
- name: Test - JDK 11 + Spring.NEXT (snapshots)
serial: true
public: true
plan:
- get: spring-ws-github
trigger: true
- get: openjdk:11-jdk
trigger: true
- task: test
image: openjdk:11-jdk
file: spring-ws-github/ci/test.yml
params: { PROFILE: "springnext-buildsnapshot,java11,convergence" }
- name: Test - JDK 11 + Spring (snapshots)
serial: true
public: true
plan:
- get: spring-ws-github
trigger: true
- get: openjdk:11-jdk
trigger: true
- task: test
image: openjdk:11-jdk
file: spring-ws-github/ci/test.yml
params: { PROFILE: "spring-buildsnapshot,java11,convergence" }
- name: Build
serial: true
public: true
plan:
- get: spring-ws-github
trigger: true
passed: [
Test - JDK 8,
Test - JDK 8 + Spring.NEXT,
Test - JDK 8 + Spring.NEXT (snapshots),
Test - JDK 8 + Spring (snapshots),
Test - JDK 11,
Test - JDK 11 + Spring.NEXT,
Test - JDK 11 + Spring.NEXT (snapshots),
Test - JDK 11 + Spring (snapshots)
]
- put: spring-ws-status
params:
commit: spring-ws-github
state: pending
- task: build
file: spring-ws-github/ci/build.yml
- put: spring-ws-artifactory
params:
build_number: ${BUILD_NAME}
build_uri: ${ATC_EXTERNAL_URL}/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}
repo: libs-snapshot-local
folder: spring-ws-artifactory
artifact_set:
- include:
- "/**"
properties:
archives: '*:*:*:*@zip zip.name:spring-ws, zip.displayname:Spring Web Services, zip.deployed:false'
on_failure:
put: spring-ws-status
params:
commit: spring-ws-github
state: failure
on_success:
put: spring-ws-status
params:
commit: spring-ws-github
state: success
- name: spring-ws-pull-requests
public: true
plan:
- get: spring-ws-github
resource: spring-ws-pull-requests
trigger: true
version: every
- get: openjdk:11-jdk
trigger: true
- put: spring-ws-pull-requests
params:
path: spring-ws-github
status: pending
- aggregate:
- task: test (JDK 8)
file: spring-ws-github/ci/test.yml
params: { PROFILE: "distribute,convergence" }
- task: test (JDK 8 + Spring.NEXT)
file: spring-ws-github/ci/test.yml
params: { PROFILE: "springnext,convergence" }
- task: test (JDK 8 + Spring.NEXT snapshots)
file: spring-ws-github/ci/test.yml
params: { PROFILE: "springnext-buildsnapshot,convergence" }
- task: test (JDK 8 + Spring snapshots)
file: spring-ws-github/ci/test.yml
params: { PROFILE: "spring-buildsnapshot,convergence" }
- task: test (JDK 11)
image: openjdk:11-jdk
file: spring-ws-github/ci/test.yml
params: { PROFILE: "distribute,java11,convergence" }
- task: test (JDK 11 + Spring.NEXT)
image: openjdk:11-jdk
file: spring-ws-github/ci/test.yml
params: { PROFILE: "springnext,java11,convergence" }
- task: test (JDK 11 + Spring.NEXT snapshots)
image: openjdk:11-jdk
file: spring-ws-github/ci/test.yml
params: { PROFILE: "springnext-buildsnapshot,java11,convergence" }
- task: test (JDK 11 + Spring snapshots)
image: openjdk:11-jdk
file: spring-ws-github/ci/test.yml
params: { PROFILE: "spring-buildsnapshot,java11,convergence" }
on_failure:
put: spring-ws-pull-requests
params:
path: spring-ws-github
status: failure
on_success:
put: spring-ws-pull-requests
params:
path: spring-ws-github
status: success

11
ci/test.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash -x
set -euo pipefail
[[ -d $PWD/maven && ! -d $HOME/.m2 ]] && ln -s $PWD/maven $HOME/.m2
rm -rf $HOME/.m2/repository/org/springframework/ws 2> /dev/null || :
cd spring-ws-github
./mvnw -P${PROFILE} clean test

17
ci/test.yml Normal file
View File

@@ -0,0 +1,17 @@
---
platform: linux
image_resource:
type: docker-image
source:
repository: openjdk
tag: 8-jdk
inputs:
- name: spring-ws-github
caches:
- path: maven
run:
path: spring-ws-github/ci/test.sh

View File

@@ -1,91 +0,0 @@
version: 2
jobs:
java_8_test_current:
docker:
- image: circleci/openjdk:8u141
steps:
- checkout
- run:
name: Java 8 - Test current version
command: ./mvnw -Pdistribute,snapshot clean test
java_8_test_spring_next:
docker:
- image: circleci/openjdk:8u141
steps:
- checkout
- run:
name: Java 8 - Test Spring.NEXT
command: ./mvnw -Pspringnext clean test
java_8_test_spring_buildsnapshot:
docker:
- image: circleci/openjdk:8u141
steps:
- checkout
- run:
name: Java 8 - Test Spring.NEXT snapshots
command: ./mvnw -Pspringnext-snapshot clean test
java_11_test_current:
docker:
- image: circleci/openjdk:11-ea-27-jdk-sid
steps:
- checkout
- run:
name: Java 11 - Test current version
command: ./mvnw -Pdistribute,snapshot,java11 clean test
java_11_test_spring_next:
docker:
- image: circleci/openjdk:11-ea-27-jdk-sid
steps:
- checkout
- run:
name: Java 11 - Test Spring.NEXT
command: ./mvnw -Pspringnext,java11 clean test
java_11_test_spring_buildsnapshot:
docker:
- image: circleci/openjdk:11-ea-27-jdk-sid
steps:
- checkout
- run:
name: Java 11 - Test Spring.NEXT snapshots
command: ./mvnw -Pspringnext-snapshot,java11 clean test
deploy:
docker:
- image: circleci/openjdk:8u141
steps:
- checkout
- run:
name: Deploy to Artifactory
command: ./deploy.bash
workflows:
version: 2
build-and-deploy:
jobs:
- java_8_test_current
- java_11_test_current
- java_8_test_spring_next
- java_11_test_spring_next
- java_8_test_spring_buildsnapshot
- java_11_test_spring_buildsnapshot
- deploy:
requires:
- java_8_test_current
- java_11_test_current
- java_8_test_spring_next
- java_11_test_spring_next
- java_8_test_spring_buildsnapshot
- java_11_test_spring_buildsnapshot
general:
branches:
ignore:
- gh-pages # list of branches to ignore
dependencies:
cache_directories:
- "~/.m2"

65
pom.xml
View File

@@ -69,7 +69,7 @@
</comments>
</license>
</licenses>
<modules>
<module>spring-ws-core</module>
<module>spring-ws-security</module>
@@ -172,6 +172,16 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
</plugins>
</build>
@@ -309,41 +319,6 @@
</build>
</profile>
<profile>
<id>snapshot</id>
<build>
<plugins>
<plugin>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>artifactory-maven-plugin</artifactId>
<version>2.6.1</version>
<inherited>false</inherited>
<executions>
<execution>
<id>build-info</id>
<goals>
<goal>publish</goal>
</goals>
<configuration>
<deployProperties>
<archives>*:*:*:*@zip zip.name:spring-ws, zip.displayname:Spring Web Services, zip.deployed:false</archives>
</deployProperties>
<publisher>
<contextUrl>http://repo.spring.io</contextUrl>
<username>{{USERNAME}}</username>
<password>{{PASSWORD}}</password>
<repoKey>libs-snapshot-local</repoKey>
<snapshotRepoKey>libs-snapshot-local</snapshotRepoKey>
</publisher>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>milestone</id>
@@ -588,6 +563,22 @@
<profile>
<id>java11</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
<argLine>
--illegal-access=permit
</argLine>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.sun.xml.ws</groupId>
@@ -691,5 +682,5 @@
<connection>scm:git:git://github.com/spring-projects/spring-ws.git</connection>
<developerConnection>scm:git:ssh://git@github.com:spring-projects/spring-ws.git</developerConnection>
</scm>
</project>