22 changed files with 785 additions and 0 deletions
@ -0,0 +1,57 @@ |
|||||||
|
== Spring Framework Concourse pipeline |
||||||
|
|
||||||
|
The Spring Framework uses https://concourse-ci.org/[Concourse] for its CI build and other automated tasks. |
||||||
|
The Spring team has a dedicated Concourse instance available at https://ci.spring.io with a build pipeline |
||||||
|
for https://ci.spring.io/teams/spring-framework/pipelines/spring-framework-5.1.x[Spring Framework 5.1.x]. |
||||||
|
|
||||||
|
=== Setting up your development environment |
||||||
|
|
||||||
|
If you're part of the Spring Framework project on GitHub, you can get access to CI management features. |
||||||
|
First, you need to go to https://ci.spring.io and install the client CLI for your platform (see bottom right of the screen). |
||||||
|
|
||||||
|
You can then login with the instance using: |
||||||
|
|
||||||
|
[source] |
||||||
|
---- |
||||||
|
$ fly -t spring login -n spring-framework -c https://ci.spring.io |
||||||
|
---- |
||||||
|
|
||||||
|
Once logged in, you should get something like: |
||||||
|
|
||||||
|
[source] |
||||||
|
---- |
||||||
|
$ fly ts |
||||||
|
name url team expiry |
||||||
|
spring https://ci.spring.io spring-framework Wed, 25 Mar 2020 17:45:26 UTC |
||||||
|
---- |
||||||
|
|
||||||
|
=== Pipeline configuration and structure |
||||||
|
|
||||||
|
The build pipelines are described in `pipeline.yml` file. |
||||||
|
|
||||||
|
This file is listing Concourse resources, i.e. build inputs and outputs such as container images, artifact repositories, source repositories, notification services, etc. |
||||||
|
|
||||||
|
It also describes jobs (a job is a sequence of inputs, tasks and outputs); jobs are organized by groups. |
||||||
|
|
||||||
|
The `pipeline.yml` definition contains `((parameters))` which are loaded from the `parameters.yml` file or from our https://docs.cloudfoundry.org/credhub/[credhub instance]. |
||||||
|
|
||||||
|
You'll find in this folder the following resources: |
||||||
|
|
||||||
|
* `pipeline.yml` the build pipeline |
||||||
|
* `parameters.yml` the build parameters used for the pipeline |
||||||
|
* `images/` holds the container images definitions used in this pipeline |
||||||
|
* `scripts/` holds the build scripts that ship within the CI container images |
||||||
|
* `tasks` contains the task definitions used in the main `pipeline.yml` |
||||||
|
|
||||||
|
=== Updating the build pipeline |
||||||
|
|
||||||
|
Updating files on the repository is not enough to update the build pipeline, as changes need to be applied. |
||||||
|
|
||||||
|
The pipeline can be deployed using the following command: |
||||||
|
|
||||||
|
[source] |
||||||
|
---- |
||||||
|
$ fly -t spring set-pipeline -p spring-framework-5.1.x -c ci/pipeline.yml -l ci/parameters.yml |
||||||
|
---- |
||||||
|
|
||||||
|
NOTE: This assumes that you have credhub integration configured with the appropriate secrets. |
||||||
@ -0,0 +1,17 @@ |
|||||||
|
changelog: |
||||||
|
repository: spring-projects/spring-framework |
||||||
|
sections: |
||||||
|
- title: ":star: New Features" |
||||||
|
labels: |
||||||
|
- "type: enhancement" |
||||||
|
- title: ":lady_beetle: Bug Fixes" |
||||||
|
labels: |
||||||
|
- "type: bug" |
||||||
|
- "type: regression" |
||||||
|
- title: ":notebook_with_decorative_cover: Documentation" |
||||||
|
labels: |
||||||
|
- "type: documentation" |
||||||
|
- title: ":hammer: Dependency Upgrades" |
||||||
|
sort: "title" |
||||||
|
labels: |
||||||
|
- "type: dependency-upgrade" |
||||||
@ -0,0 +1,10 @@ |
|||||||
|
logging: |
||||||
|
level: |
||||||
|
io.spring.concourse: DEBUG |
||||||
|
spring: |
||||||
|
main: |
||||||
|
banner-mode: off |
||||||
|
sonatype: |
||||||
|
exclude: |
||||||
|
- 'build-info\.json' |
||||||
|
- '.*\.zip' |
||||||
@ -0,0 +1,21 @@ |
|||||||
|
== CI Images |
||||||
|
|
||||||
|
These images are used by CI to run the actual builds. |
||||||
|
|
||||||
|
To build the image locally run the following from this directory: |
||||||
|
|
||||||
|
---- |
||||||
|
$ docker build --no-cache -f <image-folder>/Dockerfile . |
||||||
|
---- |
||||||
|
|
||||||
|
For example |
||||||
|
|
||||||
|
---- |
||||||
|
$ docker build --no-cache -f spring-framework-ci-image/Dockerfile . |
||||||
|
---- |
||||||
|
|
||||||
|
To test run: |
||||||
|
|
||||||
|
---- |
||||||
|
$ docker run -it --entrypoint /bin/bash <SHA> |
||||||
|
---- |
||||||
@ -0,0 +1,8 @@ |
|||||||
|
FROM ubuntu:focal-20220302 |
||||||
|
|
||||||
|
ADD setup.sh /setup.sh |
||||||
|
ADD get-jdk-url.sh /get-jdk-url.sh |
||||||
|
RUN ./setup.sh java11 |
||||||
|
|
||||||
|
ENV JAVA_HOME /opt/openjdk |
||||||
|
ENV PATH $JAVA_HOME/bin:$PATH |
||||||
@ -0,0 +1,8 @@ |
|||||||
|
FROM ubuntu:focal-20220302 |
||||||
|
|
||||||
|
ADD setup.sh /setup.sh |
||||||
|
ADD get-jdk-url.sh /get-jdk-url.sh |
||||||
|
RUN ./setup.sh java8 |
||||||
|
|
||||||
|
ENV JAVA_HOME /opt/openjdk |
||||||
|
ENV PATH $JAVA_HOME/bin:$PATH |
||||||
@ -0,0 +1,14 @@ |
|||||||
|
#!/bin/bash |
||||||
|
set -e |
||||||
|
|
||||||
|
case "$1" in |
||||||
|
java8) |
||||||
|
echo "https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u322-b06/OpenJDK8U-jdk_x64_linux_hotspot_8u322b06.tar.gz" |
||||||
|
;; |
||||||
|
java11) |
||||||
|
echo "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.14.1%2B1/OpenJDK11U-jdk_x64_linux_hotspot_11.0.14.1_1.tar.gz" |
||||||
|
;; |
||||||
|
*) |
||||||
|
echo $"Unknown java version" |
||||||
|
exit 1 |
||||||
|
esac |
||||||
@ -0,0 +1,35 @@ |
|||||||
|
#!/bin/bash |
||||||
|
set -ex |
||||||
|
|
||||||
|
########################################################### |
||||||
|
# UTILS |
||||||
|
########################################################### |
||||||
|
|
||||||
|
export DEBIAN_FRONTEND=noninteractive |
||||||
|
apt-get update |
||||||
|
apt-get install --no-install-recommends -y tzdata ca-certificates net-tools libxml2-utils git curl libudev1 libxml2-utils iptables iproute2 jq fontconfig |
||||||
|
ln -fs /usr/share/zoneinfo/UTC /etc/localtime |
||||||
|
dpkg-reconfigure --frontend noninteractive tzdata |
||||||
|
rm -rf /var/lib/apt/lists/* |
||||||
|
|
||||||
|
curl https://raw.githubusercontent.com/spring-io/concourse-java-scripts/v0.0.4/concourse-java.sh > /opt/concourse-java.sh |
||||||
|
|
||||||
|
curl --output /opt/concourse-release-scripts.jar https://repo.spring.io/release/io/spring/concourse/releasescripts/concourse-release-scripts/0.3.2/concourse-release-scripts-0.3.2.jar |
||||||
|
|
||||||
|
########################################################### |
||||||
|
# JAVA |
||||||
|
########################################################### |
||||||
|
JDK_URL=$( ./get-jdk-url.sh $1 ) |
||||||
|
|
||||||
|
mkdir -p /opt/openjdk |
||||||
|
cd /opt/openjdk |
||||||
|
curl -L ${JDK_URL} | tar zx --strip-components=1 |
||||||
|
test -f /opt/openjdk/bin/java |
||||||
|
test -f /opt/openjdk/bin/javac |
||||||
|
|
||||||
|
########################################################### |
||||||
|
# GRADLE ENTERPRISE |
||||||
|
########################################################### |
||||||
|
cd / |
||||||
|
mkdir ~/.gradle |
||||||
|
echo 'systemProp.user.name=concourse' > ~/.gradle/gradle.properties |
||||||
@ -0,0 +1,13 @@ |
|||||||
|
email-server: "smtp.svc.pivotal.io" |
||||||
|
email-from: "ci@spring.io" |
||||||
|
email-to: ["spring-framework-dev@pivotal.io"] |
||||||
|
github-repo: "https://github.com/spring-projects/spring-framework.git" |
||||||
|
github-repo-name: "spring-projects/spring-framework" |
||||||
|
docker-hub-organization: "springci" |
||||||
|
artifactory-server: "https://repo.spring.io" |
||||||
|
branch: "5.1.x" |
||||||
|
milestone: "5.1.x" |
||||||
|
build-name: "spring-framework" |
||||||
|
pipeline-name: "spring-framework" |
||||||
|
concourse-url: "https://ci.spring.io" |
||||||
|
task-timeout: 1h00m |
||||||
@ -0,0 +1,391 @@ |
|||||||
|
anchors: |
||||||
|
git-repo-resource-source: &git-repo-resource-source |
||||||
|
uri: ((github-repo)) |
||||||
|
username: ((github-username)) |
||||||
|
password: ((github-ci-release-token)) |
||||||
|
branch: ((branch)) |
||||||
|
gradle-enterprise-task-params: &gradle-enterprise-task-params |
||||||
|
GRADLE_ENTERPRISE_ACCESS_KEY: ((gradle_enterprise_secret_access_key)) |
||||||
|
GRADLE_ENTERPRISE_CACHE_USERNAME: ((gradle_enterprise_cache_user.username)) |
||||||
|
GRADLE_ENTERPRISE_CACHE_PASSWORD: ((gradle_enterprise_cache_user.password)) |
||||||
|
sonatype-task-params: &sonatype-task-params |
||||||
|
SONATYPE_USERNAME: ((sonatype-username)) |
||||||
|
SONATYPE_PASSWORD: ((sonatype-password)) |
||||||
|
SONATYPE_URL: ((sonatype-url)) |
||||||
|
SONATYPE_STAGING_PROFILE_ID: ((sonatype-staging-profile-id)) |
||||||
|
artifactory-task-params: &artifactory-task-params |
||||||
|
ARTIFACTORY_SERVER: ((artifactory-server)) |
||||||
|
ARTIFACTORY_USERNAME: ((artifactory-username)) |
||||||
|
ARTIFACTORY_PASSWORD: ((artifactory-password)) |
||||||
|
build-project-task-params: &build-project-task-params |
||||||
|
privileged: true |
||||||
|
timeout: ((task-timeout)) |
||||||
|
params: |
||||||
|
BRANCH: ((branch)) |
||||||
|
<<: *gradle-enterprise-task-params |
||||||
|
docker-resource-source: &docker-resource-source |
||||||
|
username: ((docker-hub-username)) |
||||||
|
password: ((docker-hub-password)) |
||||||
|
tag: ((milestone)) |
||||||
|
slack-fail-params: &slack-fail-params |
||||||
|
text: > |
||||||
|
:concourse-failed: <https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} failed!> |
||||||
|
[$TEXT_FILE_CONTENT] |
||||||
|
text_file: git-repo/build/build-scan-uri.txt |
||||||
|
silent: true |
||||||
|
icon_emoji: ":concourse:" |
||||||
|
username: concourse-ci |
||||||
|
changelog-task-params: &changelog-task-params |
||||||
|
name: generated-changelog/tag |
||||||
|
tag: generated-changelog/tag |
||||||
|
body: generated-changelog/changelog.md |
||||||
|
github-task-params: &github-task-params |
||||||
|
GITHUB_USERNAME: ((github-username)) |
||||||
|
GITHUB_TOKEN: ((github-ci-release-token)) |
||||||
|
|
||||||
|
resource_types: |
||||||
|
- name: artifactory-resource |
||||||
|
type: registry-image |
||||||
|
source: |
||||||
|
repository: springio/artifactory-resource |
||||||
|
tag: 0.0.17 |
||||||
|
- name: github-release |
||||||
|
type: registry-image |
||||||
|
source: |
||||||
|
repository: concourse/github-release-resource |
||||||
|
tag: 1.5.5 |
||||||
|
- name: github-status-resource |
||||||
|
type: registry-image |
||||||
|
source: |
||||||
|
repository: dpb587/github-status-resource |
||||||
|
tag: master |
||||||
|
- name: slack-notification |
||||||
|
type: registry-image |
||||||
|
source: |
||||||
|
repository: cfcommunity/slack-notification-resource |
||||||
|
tag: latest |
||||||
|
resources: |
||||||
|
- name: git-repo |
||||||
|
type: git |
||||||
|
icon: github |
||||||
|
source: |
||||||
|
<<: *git-repo-resource-source |
||||||
|
- name: every-morning |
||||||
|
type: time |
||||||
|
icon: alarm |
||||||
|
source: |
||||||
|
start: 8:00 AM |
||||||
|
stop: 9:00 AM |
||||||
|
location: Europe/Vienna |
||||||
|
- name: ci-images-git-repo |
||||||
|
type: git |
||||||
|
icon: github |
||||||
|
source: |
||||||
|
uri: ((github-repo)) |
||||||
|
branch: ((branch)) |
||||||
|
paths: ["ci/images/*"] |
||||||
|
- name: ci-image |
||||||
|
type: docker-image |
||||||
|
icon: docker |
||||||
|
source: |
||||||
|
<<: *docker-resource-source |
||||||
|
repository: ((docker-hub-organization))/spring-framework-ci |
||||||
|
- name: ci-image-jdk11 |
||||||
|
type: docker-image |
||||||
|
icon: docker |
||||||
|
source: |
||||||
|
<<: *docker-resource-source |
||||||
|
repository: ((docker-hub-organization))/spring-framework-ci-jdk11 |
||||||
|
- name: artifactory-repo |
||||||
|
type: artifactory-resource |
||||||
|
icon: package-variant |
||||||
|
source: |
||||||
|
uri: ((artifactory-server)) |
||||||
|
username: ((artifactory-username)) |
||||||
|
password: ((artifactory-password)) |
||||||
|
build_name: ((build-name)) |
||||||
|
- name: repo-status-build |
||||||
|
type: github-status-resource |
||||||
|
icon: eye-check-outline |
||||||
|
source: |
||||||
|
repository: ((github-repo-name)) |
||||||
|
access_token: ((github-ci-status-token)) |
||||||
|
branch: ((branch)) |
||||||
|
context: build |
||||||
|
- name: repo-status-jdk11-build |
||||||
|
type: github-status-resource |
||||||
|
icon: eye-check-outline |
||||||
|
source: |
||||||
|
repository: ((github-repo-name)) |
||||||
|
access_token: ((github-ci-status-token)) |
||||||
|
branch: ((branch)) |
||||||
|
context: jdk11-build |
||||||
|
- name: slack-alert |
||||||
|
type: slack-notification |
||||||
|
icon: slack |
||||||
|
source: |
||||||
|
url: ((slack-webhook-url)) |
||||||
|
- name: github-pre-release |
||||||
|
type: github-release |
||||||
|
icon: briefcase-download-outline |
||||||
|
source: |
||||||
|
owner: spring-projects |
||||||
|
repository: spring-framework |
||||||
|
access_token: ((github-ci-release-token)) |
||||||
|
pre_release: true |
||||||
|
release: false |
||||||
|
- name: github-release |
||||||
|
type: github-release |
||||||
|
icon: briefcase-download |
||||||
|
source: |
||||||
|
owner: spring-projects |
||||||
|
repository: spring-framework |
||||||
|
access_token: ((github-ci-release-token)) |
||||||
|
pre_release: false |
||||||
|
jobs: |
||||||
|
- name: build-ci-images |
||||||
|
plan: |
||||||
|
- get: ci-images-git-repo |
||||||
|
trigger: true |
||||||
|
- in_parallel: |
||||||
|
- put: ci-image |
||||||
|
params: |
||||||
|
build: ci-images-git-repo/ci/images |
||||||
|
dockerfile: ci-images-git-repo/ci/images/ci-image/Dockerfile |
||||||
|
- put: ci-image-jdk11 |
||||||
|
params: |
||||||
|
build: ci-images-git-repo/ci/images |
||||||
|
dockerfile: ci-images-git-repo/ci/images/ci-image-jdk11/Dockerfile |
||||||
|
- name: build |
||||||
|
serial: true |
||||||
|
public: true |
||||||
|
plan: |
||||||
|
- get: ci-image |
||||||
|
- get: git-repo |
||||||
|
trigger: true |
||||||
|
- put: repo-status-build |
||||||
|
params: { state: "pending", commit: "git-repo" } |
||||||
|
- do: |
||||||
|
- task: build-project |
||||||
|
image: ci-image |
||||||
|
file: git-repo/ci/tasks/build-project.yml |
||||||
|
<<: *build-project-task-params |
||||||
|
on_failure: |
||||||
|
do: |
||||||
|
- put: repo-status-build |
||||||
|
params: { state: "failure", commit: "git-repo" } |
||||||
|
- put: slack-alert |
||||||
|
params: |
||||||
|
<<: *slack-fail-params |
||||||
|
- put: repo-status-build |
||||||
|
params: { state: "success", commit: "git-repo" } |
||||||
|
- put: artifactory-repo |
||||||
|
params: &artifactory-params |
||||||
|
signing_key: ((signing-key)) |
||||||
|
signing_passphrase: ((signing-passphrase)) |
||||||
|
repo: libs-snapshot-local |
||||||
|
folder: distribution-repository |
||||||
|
build_uri: "https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}" |
||||||
|
build_number: "${BUILD_PIPELINE_NAME}-${BUILD_JOB_NAME}-${BUILD_NAME}" |
||||||
|
disable_checksum_uploads: true |
||||||
|
threads: 8 |
||||||
|
artifact_set: |
||||||
|
- include: |
||||||
|
- "/**/spring-*.zip" |
||||||
|
properties: |
||||||
|
"zip.name": "spring-framework" |
||||||
|
"zip.displayname": "Spring Framework" |
||||||
|
"zip.deployed": "false" |
||||||
|
- include: |
||||||
|
- "/**/spring-*-docs.zip" |
||||||
|
properties: |
||||||
|
"zip.type": "docs" |
||||||
|
- include: |
||||||
|
- "/**/spring-*-dist.zip" |
||||||
|
properties: |
||||||
|
"zip.type": "dist" |
||||||
|
- include: |
||||||
|
- "/**/spring-*-schema.zip" |
||||||
|
properties: |
||||||
|
"zip.type": "schema" |
||||||
|
get_params: |
||||||
|
threads: 8 |
||||||
|
- name: jdk11-build |
||||||
|
serial: true |
||||||
|
public: true |
||||||
|
plan: |
||||||
|
- get: ci-image-jdk11 |
||||||
|
- get: git-repo |
||||||
|
- get: every-morning |
||||||
|
trigger: true |
||||||
|
- put: repo-status-jdk11-build |
||||||
|
params: { state: "pending", commit: "git-repo" } |
||||||
|
- do: |
||||||
|
- task: check-project |
||||||
|
image: ci-image-jdk11 |
||||||
|
file: git-repo/ci/tasks/check-project.yml |
||||||
|
<<: *build-project-task-params |
||||||
|
on_failure: |
||||||
|
do: |
||||||
|
- put: repo-status-jdk11-build |
||||||
|
params: { state: "failure", commit: "git-repo" } |
||||||
|
- put: slack-alert |
||||||
|
params: |
||||||
|
<<: *slack-fail-params |
||||||
|
- put: repo-status-jdk11-build |
||||||
|
params: { state: "success", commit: "git-repo" } |
||||||
|
- name: stage-milestone |
||||||
|
serial: true |
||||||
|
plan: |
||||||
|
- get: ci-image |
||||||
|
- get: git-repo |
||||||
|
trigger: false |
||||||
|
- task: stage |
||||||
|
image: ci-image |
||||||
|
file: git-repo/ci/tasks/stage-version.yml |
||||||
|
params: |
||||||
|
RELEASE_TYPE: M |
||||||
|
<<: *gradle-enterprise-task-params |
||||||
|
- put: artifactory-repo |
||||||
|
params: |
||||||
|
<<: *artifactory-params |
||||||
|
repo: libs-staging-local |
||||||
|
- put: git-repo |
||||||
|
params: |
||||||
|
repository: stage-git-repo |
||||||
|
- name: promote-milestone |
||||||
|
serial: true |
||||||
|
plan: |
||||||
|
- get: ci-image |
||||||
|
- get: git-repo |
||||||
|
trigger: false |
||||||
|
- get: artifactory-repo |
||||||
|
trigger: false |
||||||
|
passed: [stage-milestone] |
||||||
|
params: |
||||||
|
download_artifacts: false |
||||||
|
save_build_info: true |
||||||
|
- task: promote |
||||||
|
image: ci-image |
||||||
|
file: git-repo/ci/tasks/promote-version.yml |
||||||
|
params: |
||||||
|
RELEASE_TYPE: M |
||||||
|
<<: *artifactory-task-params |
||||||
|
- task: generate-changelog |
||||||
|
file: git-repo/ci/tasks/generate-changelog.yml |
||||||
|
params: |
||||||
|
RELEASE_TYPE: M |
||||||
|
<<: *github-task-params |
||||||
|
- put: github-pre-release |
||||||
|
params: |
||||||
|
<<: *changelog-task-params |
||||||
|
- name: stage-rc |
||||||
|
serial: true |
||||||
|
plan: |
||||||
|
- get: ci-image |
||||||
|
- get: git-repo |
||||||
|
trigger: false |
||||||
|
- task: stage |
||||||
|
image: ci-image |
||||||
|
file: git-repo/ci/tasks/stage-version.yml |
||||||
|
params: |
||||||
|
RELEASE_TYPE: RC |
||||||
|
<<: *gradle-enterprise-task-params |
||||||
|
- put: artifactory-repo |
||||||
|
params: |
||||||
|
<<: *artifactory-params |
||||||
|
repo: libs-staging-local |
||||||
|
- put: git-repo |
||||||
|
params: |
||||||
|
repository: stage-git-repo |
||||||
|
- name: promote-rc |
||||||
|
serial: true |
||||||
|
plan: |
||||||
|
- get: ci-image |
||||||
|
- get: git-repo |
||||||
|
trigger: false |
||||||
|
- get: artifactory-repo |
||||||
|
trigger: false |
||||||
|
passed: [stage-rc] |
||||||
|
params: |
||||||
|
download_artifacts: false |
||||||
|
save_build_info: true |
||||||
|
- task: promote |
||||||
|
image: ci-image |
||||||
|
file: git-repo/ci/tasks/promote-version.yml |
||||||
|
params: |
||||||
|
RELEASE_TYPE: RC |
||||||
|
<<: *artifactory-task-params |
||||||
|
- task: generate-changelog |
||||||
|
file: git-repo/ci/tasks/generate-changelog.yml |
||||||
|
params: |
||||||
|
RELEASE_TYPE: RC |
||||||
|
<<: *github-task-params |
||||||
|
- put: github-pre-release |
||||||
|
params: |
||||||
|
<<: *changelog-task-params |
||||||
|
- name: stage-release |
||||||
|
serial: true |
||||||
|
plan: |
||||||
|
- get: ci-image |
||||||
|
- get: git-repo |
||||||
|
trigger: false |
||||||
|
- task: stage |
||||||
|
image: ci-image |
||||||
|
file: git-repo/ci/tasks/stage-version.yml |
||||||
|
params: |
||||||
|
RELEASE_TYPE: RELEASE |
||||||
|
<<: *gradle-enterprise-task-params |
||||||
|
- put: artifactory-repo |
||||||
|
params: |
||||||
|
<<: *artifactory-params |
||||||
|
repo: libs-staging-local |
||||||
|
- put: git-repo |
||||||
|
params: |
||||||
|
repository: stage-git-repo |
||||||
|
- name: promote-release |
||||||
|
serial: true |
||||||
|
plan: |
||||||
|
- get: ci-image |
||||||
|
- get: git-repo |
||||||
|
trigger: false |
||||||
|
- get: artifactory-repo |
||||||
|
trigger: false |
||||||
|
passed: [stage-release] |
||||||
|
params: |
||||||
|
download_artifacts: true |
||||||
|
save_build_info: true |
||||||
|
- task: promote |
||||||
|
image: ci-image |
||||||
|
file: git-repo/ci/tasks/promote-version.yml |
||||||
|
params: |
||||||
|
RELEASE_TYPE: RELEASE |
||||||
|
<<: *artifactory-task-params |
||||||
|
<<: *sonatype-task-params |
||||||
|
- name: create-github-release |
||||||
|
serial: true |
||||||
|
plan: |
||||||
|
- get: ci-image |
||||||
|
- get: git-repo |
||||||
|
- get: artifactory-repo |
||||||
|
trigger: true |
||||||
|
passed: [promote-release] |
||||||
|
params: |
||||||
|
download_artifacts: false |
||||||
|
save_build_info: true |
||||||
|
- task: generate-changelog |
||||||
|
file: git-repo/ci/tasks/generate-changelog.yml |
||||||
|
params: |
||||||
|
RELEASE_TYPE: RELEASE |
||||||
|
<<: *github-task-params |
||||||
|
- put: github-release |
||||||
|
params: |
||||||
|
<<: *changelog-task-params |
||||||
|
|
||||||
|
groups: |
||||||
|
- name: "builds" |
||||||
|
jobs: ["build", "jdk11-build"] |
||||||
|
- name: "releases" |
||||||
|
jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone", "promote-rc", "promote-release", "create-github-release"] |
||||||
|
- name: "ci-images" |
||||||
|
jobs: ["build-ci-images"] |
||||||
@ -0,0 +1,9 @@ |
|||||||
|
#!/bin/bash |
||||||
|
set -e |
||||||
|
|
||||||
|
source $(dirname $0)/common.sh |
||||||
|
repository=$(pwd)/distribution-repository |
||||||
|
|
||||||
|
pushd git-repo > /dev/null |
||||||
|
./gradlew -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false --no-daemon --max-workers=4 -PdeploymentRepository=${repository} build publishAllPublicationsToDeploymentRepository |
||||||
|
popd > /dev/null |
||||||
@ -0,0 +1,8 @@ |
|||||||
|
#!/bin/bash |
||||||
|
set -e |
||||||
|
|
||||||
|
source $(dirname $0)/common.sh |
||||||
|
|
||||||
|
pushd git-repo > /dev/null |
||||||
|
./gradlew -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false --no-daemon --max-workers=4 check |
||||||
|
popd > /dev/null |
||||||
@ -0,0 +1,2 @@ |
|||||||
|
source /opt/concourse-java.sh |
||||||
|
setup_symlinks |
||||||
@ -0,0 +1,17 @@ |
|||||||
|
#!/bin/bash |
||||||
|
set -e |
||||||
|
|
||||||
|
CONFIG_DIR=git-repo/ci/config |
||||||
|
version=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.modules[0].id' | sed 's/.*:.*:\(.*\)/\1/' ) |
||||||
|
|
||||||
|
milestone=${version} |
||||||
|
if [[ $RELEASE_TYPE = "RELEASE" ]]; then |
||||||
|
milestone=${version%.RELEASE} |
||||||
|
fi |
||||||
|
|
||||||
|
java -jar /github-changelog-generator.jar \ |
||||||
|
--spring.config.location=${CONFIG_DIR}/changelog-generator.yml \ |
||||||
|
${milestone} generated-changelog/changelog.md |
||||||
|
|
||||||
|
echo ${version} > generated-changelog/version |
||||||
|
echo v${version} > generated-changelog/tag |
||||||
@ -0,0 +1,18 @@ |
|||||||
|
#!/bin/bash |
||||||
|
|
||||||
|
source $(dirname $0)/common.sh |
||||||
|
CONFIG_DIR=git-repo/ci/config |
||||||
|
|
||||||
|
version=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.modules[0].id' | sed 's/.*:.*:\(.*\)/\1/' ) |
||||||
|
export BUILD_INFO_LOCATION=$(pwd)/artifactory-repo/build-info.json |
||||||
|
|
||||||
|
java -jar /opt/concourse-release-scripts.jar \ |
||||||
|
--spring.config.location=${CONFIG_DIR}/release-scripts.yml \ |
||||||
|
publishToCentral $RELEASE_TYPE $BUILD_INFO_LOCATION artifactory-repo || { exit 1; } |
||||||
|
|
||||||
|
java -jar /opt/concourse-release-scripts.jar \ |
||||||
|
--spring.config.location=${CONFIG_DIR}/release-scripts.yml \ |
||||||
|
promote $RELEASE_TYPE $BUILD_INFO_LOCATION || { exit 1; } |
||||||
|
|
||||||
|
echo "Promotion complete" |
||||||
|
echo $version > version/version |
||||||
@ -0,0 +1,50 @@ |
|||||||
|
#!/bin/bash |
||||||
|
set -e |
||||||
|
|
||||||
|
source $(dirname $0)/common.sh |
||||||
|
repository=$(pwd)/distribution-repository |
||||||
|
|
||||||
|
pushd git-repo > /dev/null |
||||||
|
git fetch --tags --all > /dev/null |
||||||
|
popd > /dev/null |
||||||
|
|
||||||
|
git clone git-repo stage-git-repo > /dev/null |
||||||
|
|
||||||
|
pushd stage-git-repo > /dev/null |
||||||
|
|
||||||
|
snapshotVersion=$( awk -F '=' '$1 == "version" { print $2 }' gradle.properties ) |
||||||
|
if [[ $RELEASE_TYPE = "M" ]]; then |
||||||
|
stageVersion=$( get_next_milestone_release $snapshotVersion) |
||||||
|
nextVersion=$snapshotVersion |
||||||
|
elif [[ $RELEASE_TYPE = "RC" ]]; then |
||||||
|
stageVersion=$( get_next_rc_release $snapshotVersion) |
||||||
|
nextVersion=$snapshotVersion |
||||||
|
elif [[ $RELEASE_TYPE = "RELEASE" ]]; then |
||||||
|
stageVersion=$( get_next_release $snapshotVersion "RELEASE") |
||||||
|
nextVersion=$( bump_version_number $snapshotVersion) |
||||||
|
else |
||||||
|
echo "Unknown release type $RELEASE_TYPE" >&2; exit 1; |
||||||
|
fi |
||||||
|
|
||||||
|
echo "Staging $stageVersion (next version will be $nextVersion)" |
||||||
|
sed -i "s/version=$snapshotVersion/version=$stageVersion/" gradle.properties |
||||||
|
|
||||||
|
git config user.name "Spring Builds" > /dev/null |
||||||
|
git config user.email "spring-builds@users.noreply.github.com" > /dev/null |
||||||
|
git add gradle.properties > /dev/null |
||||||
|
git commit -m"Release v$stageVersion" > /dev/null |
||||||
|
git tag -a "v$stageVersion" -m"Release v$stageVersion" > /dev/null |
||||||
|
|
||||||
|
./gradlew --no-daemon --max-workers=4 -PdeploymentRepository=${repository} build publishAllPublicationsToDeploymentRepository |
||||||
|
|
||||||
|
git reset --hard HEAD^ > /dev/null |
||||||
|
if [[ $nextVersion != $snapshotVersion ]]; then |
||||||
|
echo "Setting next development version (v$nextVersion)" |
||||||
|
sed -i "s/version=$snapshotVersion/version=$nextVersion/" gradle.properties |
||||||
|
git add gradle.properties > /dev/null |
||||||
|
git commit -m"Next development version (v$nextVersion)" > /dev/null |
||||||
|
fi; |
||||||
|
|
||||||
|
echo "Staging Complete" |
||||||
|
|
||||||
|
popd > /dev/null |
||||||
@ -0,0 +1,8 @@ |
|||||||
|
#!/bin/bash |
||||||
|
|
||||||
|
export BUILD_INFO_LOCATION=$(pwd)/artifactory-repo/build-info.json |
||||||
|
version=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.modules[0].id' | sed 's/.*:.*:\(.*\)/\1/' ) |
||||||
|
java -jar /opt/concourse-release-scripts.jar syncToCentral "RELEASE" $BUILD_INFO_LOCATION || { exit 1; } |
||||||
|
|
||||||
|
echo "Sync complete" |
||||||
|
echo $version > version/version |
||||||
@ -0,0 +1,22 @@ |
|||||||
|
--- |
||||||
|
platform: linux |
||||||
|
inputs: |
||||||
|
- name: git-repo |
||||||
|
outputs: |
||||||
|
- name: distribution-repository |
||||||
|
- name: git-repo |
||||||
|
caches: |
||||||
|
- path: gradle |
||||||
|
params: |
||||||
|
BRANCH: |
||||||
|
CI: true |
||||||
|
GRADLE_ENTERPRISE_ACCESS_KEY: |
||||||
|
GRADLE_ENTERPRISE_CACHE_USERNAME: |
||||||
|
GRADLE_ENTERPRISE_CACHE_PASSWORD: |
||||||
|
GRADLE_ENTERPRISE_URL: https://ge.spring.io |
||||||
|
run: |
||||||
|
path: bash |
||||||
|
args: |
||||||
|
- -ec |
||||||
|
- | |
||||||
|
${PWD}/git-repo/ci/scripts/build-project.sh |
||||||
@ -0,0 +1,22 @@ |
|||||||
|
--- |
||||||
|
platform: linux |
||||||
|
inputs: |
||||||
|
- name: git-repo |
||||||
|
outputs: |
||||||
|
- name: distribution-repository |
||||||
|
- name: git-repo |
||||||
|
caches: |
||||||
|
- path: gradle |
||||||
|
params: |
||||||
|
BRANCH: |
||||||
|
CI: true |
||||||
|
GRADLE_ENTERPRISE_ACCESS_KEY: |
||||||
|
GRADLE_ENTERPRISE_CACHE_USERNAME: |
||||||
|
GRADLE_ENTERPRISE_CACHE_PASSWORD: |
||||||
|
GRADLE_ENTERPRISE_URL: https://ge.spring.io |
||||||
|
run: |
||||||
|
path: bash |
||||||
|
args: |
||||||
|
- -ec |
||||||
|
- | |
||||||
|
${PWD}/git-repo/ci/scripts/check-project.sh |
||||||
@ -0,0 +1,20 @@ |
|||||||
|
--- |
||||||
|
platform: linux |
||||||
|
image_resource: |
||||||
|
type: registry-image |
||||||
|
source: |
||||||
|
repository: springio/github-changelog-generator |
||||||
|
tag: '0.0.7' |
||||||
|
inputs: |
||||||
|
- name: git-repo |
||||||
|
- name: artifactory-repo |
||||||
|
outputs: |
||||||
|
- name: generated-changelog |
||||||
|
params: |
||||||
|
GITHUB_ORGANIZATION: |
||||||
|
GITHUB_REPO: |
||||||
|
GITHUB_USERNAME: |
||||||
|
GITHUB_TOKEN: |
||||||
|
RELEASE_TYPE: |
||||||
|
run: |
||||||
|
path: git-repo/ci/scripts/generate-changelog.sh |
||||||
@ -0,0 +1,18 @@ |
|||||||
|
--- |
||||||
|
platform: linux |
||||||
|
inputs: |
||||||
|
- name: git-repo |
||||||
|
- name: artifactory-repo |
||||||
|
outputs: |
||||||
|
- name: version |
||||||
|
params: |
||||||
|
RELEASE_TYPE: |
||||||
|
ARTIFACTORY_SERVER: |
||||||
|
ARTIFACTORY_USERNAME: |
||||||
|
ARTIFACTORY_PASSWORD: |
||||||
|
SONATYPE_USER: |
||||||
|
SONATYPE_PASSWORD: |
||||||
|
SONATYPE_URL: |
||||||
|
SONATYPE_STAGING_PROFILE_ID: |
||||||
|
run: |
||||||
|
path: git-repo/ci/scripts/promote-version.sh |
||||||
@ -0,0 +1,17 @@ |
|||||||
|
--- |
||||||
|
platform: linux |
||||||
|
inputs: |
||||||
|
- name: git-repo |
||||||
|
outputs: |
||||||
|
- name: stage-git-repo |
||||||
|
- name: distribution-repository |
||||||
|
params: |
||||||
|
RELEASE_TYPE: |
||||||
|
CI: true |
||||||
|
GRADLE_ENTERPRISE_CACHE_USERNAME: |
||||||
|
GRADLE_ENTERPRISE_CACHE_PASSWORD: |
||||||
|
GRADLE_ENTERPRISE_URL: https://ge.spring.io |
||||||
|
caches: |
||||||
|
- path: gradle |
||||||
|
run: |
||||||
|
path: git-repo/ci/scripts/stage-version.sh |
||||||
Loading…
Reference in new issue