From 7d0fe2667228c3d80f4ea2d6433983ccda59d0df Mon Sep 17 00:00:00 2001 From: Greg Turnquist Date: Tue, 6 Nov 2018 09:50:16 -0600 Subject: [PATCH] SWS-1043 - Introduce Concourse --- .gitignore | 4 +- ci/README.adoc | 46 +++++++ ci/build.sh | 14 ++ ci/build.yml | 20 +++ ci/pipeline-template.yml | 279 +++++++++++++++++++++++++++++++++++++++ ci/test.sh | 11 ++ ci/test.yml | 17 +++ circle.yml | 91 ------------- pom.xml | 65 ++++----- 9 files changed, 418 insertions(+), 129 deletions(-) create mode 100644 ci/README.adoc create mode 100755 ci/build.sh create mode 100644 ci/build.yml create mode 100644 ci/pipeline-template.yml create mode 100755 ci/test.sh create mode 100644 ci/test.yml delete mode 100644 circle.yml diff --git a/.gitignore b/.gitignore index 8bdcd4c5..daccec5c 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,6 @@ _site /.project /.settings/ -*.versionsBackup \ No newline at end of file +*.versionsBackup + +credentials.yml \ No newline at end of file diff --git a/ci/README.adoc b/ci/README.adoc new file mode 100644 index 00000000..56787047 --- /dev/null +++ b/ci/README.adoc @@ -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: +docker-email: +docker-username: +docker-password: +artifactory-username: +artifactory-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 sp -p spring-ws -c ci/pipeline-template.yml -l credentials.yml -v branch=master +% fly -t 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 unpause-pipeline -p spring-ws +% fly -t expose-pipeline -p spring-ws +% fly -t unpause-pipeline -p spring-ws-2.x +% fly -t expose-pipeline -p spring-ws-2.x +---- \ No newline at end of file diff --git a/ci/build.sh b/ci/build.sh new file mode 100755 index 00000000..146f60be --- /dev/null +++ b/ci/build.sh @@ -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} diff --git a/ci/build.yml b/ci/build.yml new file mode 100644 index 00000000..5de57f50 --- /dev/null +++ b/ci/build.yml @@ -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 diff --git a/ci/pipeline-template.yml b/ci/pipeline-template.yml new file mode 100644 index 00000000..26ab9e5d --- /dev/null +++ b/ci/pipeline-template.yml @@ -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 diff --git a/ci/test.sh b/ci/test.sh new file mode 100755 index 00000000..bdf7e836 --- /dev/null +++ b/ci/test.sh @@ -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 diff --git a/ci/test.yml b/ci/test.yml new file mode 100644 index 00000000..25535a51 --- /dev/null +++ b/ci/test.yml @@ -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 diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 90f5f61f..00000000 --- a/circle.yml +++ /dev/null @@ -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" diff --git a/pom.xml b/pom.xml index f00ef561..adffe9d5 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ - + spring-ws-core spring-ws-security @@ -172,6 +172,16 @@ maven-compiler-plugin 3.6.1 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.1 + + false + + + @@ -309,41 +319,6 @@ - - snapshot - - - - - org.jfrog.buildinfo - artifactory-maven-plugin - 2.6.1 - false - - - build-info - - publish - - - - *:*:*:*@zip zip.name:spring-ws, zip.displayname:Spring Web Services, zip.deployed:false - - - http://repo.spring.io - {{USERNAME}} - {{PASSWORD}} - libs-snapshot-local - libs-snapshot-local - - - - - - - - - milestone @@ -588,6 +563,22 @@ java11 + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.1 + + false + + --illegal-access=permit + + + + + + com.sun.xml.ws @@ -691,5 +682,5 @@ scm:git:git://github.com/spring-projects/spring-ws.git scm:git:ssh://git@github.com:spring-projects/spring-ws.git - +