Port the build to Gradle

Closes gh-19609
Closes gh-19608
This commit is contained in:
Andy Wilkinson
2020-01-10 13:48:43 +00:00
parent abe95fa8a7
commit ce99db1902
974 changed files with 17108 additions and 26596 deletions

View File

@@ -3,7 +3,7 @@ resource_types:
type: docker-image
source:
repository: springio/artifactory-resource
tag: 0.0.10
tag: 0.0.11-SNAPSHOT
- name: pull-request
type: docker-image
source:
@@ -209,19 +209,9 @@ jobs:
timeout: ((task-timeout))
image: spring-boot-ci-image
file: git-repo/ci/tasks/build-project.yml
- in_parallel:
- task: build-smoke-tests
timeout: ((task-timeout))
image: spring-boot-ci-image
file: git-repo/ci/tasks/build-smoke-tests.yml
- task: build-integration-tests
timeout: ((task-timeout))
image: spring-boot-ci-image
file: git-repo/ci/tasks/build-integration-tests.yml
- task: build-deployment-tests
timeout: ((task-timeout))
image: spring-boot-ci-image
file: git-repo/ci/tasks/build-deployment-tests.yml
params:
GRADLE_ENTERPRISE_CACHE_USERNAME: ((gradle-enterprise-cache-username))
GRADLE_ENTERPRISE_CACHE_PASSWORD: ((gradle-enterprise-cache-password))
on_failure:
do:
- put: repo-status-build
@@ -241,16 +231,15 @@ jobs:
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
exclude:
- "**/*.effective-pom"
- "**/spring-boot-configuration-docs/**"
- "**/spring-boot-test-support/**"
threads: 8
artifact_set:
- include:
- "/**/spring-boot-docs-*.zip"
properties:
"zip.type": "docs"
"zip.deployed": "false"
get_params:
threads: 8
on_failure:
do:
- put: slack-alert
@@ -283,19 +272,6 @@ jobs:
timeout: ((task-timeout))
image: spring-boot-ci-image
file: git-repo/ci/tasks/build-pr-project.yml
- in_parallel:
- task: build-smoke-tests
timeout: ((task-timeout))
image: spring-boot-ci-image
file: git-repo/ci/tasks/build-smoke-tests.yml
- task: build-integration-tests
timeout: ((task-timeout))
image: spring-boot-ci-image
file: git-repo/ci/tasks/build-integration-tests.yml
- task: build-deployment-tests
timeout: ((task-timeout))
image: spring-boot-ci-image
file: git-repo/ci/tasks/build-deployment-tests.yml
on_success:
put: git-pull-request
params:
@@ -321,19 +297,9 @@ jobs:
timeout: ((task-timeout))
image: spring-boot-jdk11-ci-image
file: git-repo/ci/tasks/build-project.yml
- in_parallel:
- task: build-smoke-tests
timeout: ((task-timeout))
image: spring-boot-jdk11-ci-image
file: git-repo/ci/tasks/build-smoke-tests.yml
- task: build-integration-tests
timeout: ((task-timeout))
image: spring-boot-jdk11-ci-image
file: git-repo/ci/tasks/build-integration-tests.yml
- task: build-deployment-tests
timeout: ((task-timeout))
image: spring-boot-jdk11-ci-image
file: git-repo/ci/tasks/build-deployment-tests.yml
params:
GRADLE_ENTERPRISE_CACHE_USERNAME: ((gradle-enterprise-cache-username))
GRADLE_ENTERPRISE_CACHE_PASSWORD: ((gradle-enterprise-cache-password))
on_failure:
do:
- put: repo-status-jdk11-build
@@ -362,24 +328,14 @@ jobs:
- put: repo-status-jdk13-build
params: { state: "pending", commit: "git-repo" }
- do:
- task: build-project
privileged: true
timeout: ((task-timeout))
image: spring-boot-jdk13-ci-image
file: git-repo/ci/tasks/build-project.yml
- in_parallel:
- task: build-smoke-tests
timeout: ((task-timeout))
image: spring-boot-jdk13-ci-image
file: git-repo/ci/tasks/build-smoke-tests.yml
- task: build-integration-tests
timeout: ((task-timeout))
image: spring-boot-jdk13-ci-image
file: git-repo/ci/tasks/build-integration-tests.yml
- task: build-deployment-tests
timeout: ((task-timeout))
image: spring-boot-jdk13-ci-image
file: git-repo/ci/tasks/build-deployment-tests.yml
- task: build-project
privileged: true
timeout: ((task-timeout))
image: spring-boot-jdk13-ci-image
file: git-repo/ci/tasks/build-project.yml
params:
GRADLE_ENTERPRISE_CACHE_USERNAME: ((gradle-enterprise-cache-username))
GRADLE_ENTERPRISE_CACHE_PASSWORD: ((gradle-enterprise-cache-password))
on_failure:
do:
- put: repo-status-jdk13-build
@@ -412,6 +368,9 @@ jobs:
tags:
- WIN64
timeout: ((task-timeout))
params:
GRADLE_ENTERPRISE_CACHE_USERNAME: ((gradle-enterprise-cache-username))
GRADLE_ENTERPRISE_CACHE_PASSWORD: ((gradle-enterprise-cache-password))
on_failure:
do:
- put: slack-alert
@@ -437,6 +396,8 @@ jobs:
file: git-repo/ci/tasks/stage.yml
params:
RELEASE_TYPE: M
GRADLE_ENTERPRISE_CACHE_USERNAME: ((gradle-enterprise-cache-username))
GRADLE_ENTERPRISE_CACHE_PASSWORD: ((gradle-enterprise-cache-password))
- put: artifactory-repo
params:
<<: *artifactory-params
@@ -455,6 +416,8 @@ jobs:
file: git-repo/ci/tasks/stage.yml
params:
RELEASE_TYPE: RC
GRADLE_ENTERPRISE_CACHE_USERNAME: ((gradle-enterprise-cache-username))
GRADLE_ENTERPRISE_CACHE_PASSWORD: ((gradle-enterprise-cache-password))
- put: artifactory-repo
params:
<<: *artifactory-params
@@ -473,6 +436,8 @@ jobs:
file: git-repo/ci/tasks/stage.yml
params:
RELEASE_TYPE: RELEASE
GRADLE_ENTERPRISE_CACHE_USERNAME: ((gradle-enterprise-cache-username))
GRADLE_ENTERPRISE_CACHE_PASSWORD: ((gradle-enterprise-cache-password))
- put: artifactory-repo
params:
<<: *artifactory-params

View File

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

View File

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

View File

@@ -1,6 +1,4 @@
SET "JAVA_HOME=C:\opt\jdk-8"
SET PATH=%PATH%;C:\Program Files\Git\usr\bin
cd git-repo
echo ".\mvnw clean install" > build.log
.\mvnw clean install -U >> build.log 2>&1 || (sleep 1 && tail -n 3000 build.log && exit 1)
.\gradlew --no-daemon --max-workers=4 build

View File

@@ -5,6 +5,5 @@ source $(dirname $0)/common.sh
repository=$(pwd)/distribution-repository
pushd git-repo > /dev/null
run_maven -N clean verify
run_maven -f spring-boot-project/pom.xml clean deploy -U -Dfull -DaltDeploymentRepository=distribution::default::file://${repository}
./gradlew --no-daemon --max-workers=4 -PdeploymentRepository=${repository} build publishAllPublicationsToDeploymentRepository
popd > /dev/null

View File

@@ -1,9 +0,0 @@
#!/bin/bash
set -e
source $(dirname $0)/common.sh
repository=$(pwd)/distribution-repository
pushd git-repo > /dev/null
run_maven -f spring-boot-tests/spring-boot-smoke-tests/pom.xml clean install -U -Dfull -Drepository=file://${repository}
popd > /dev/null

View File

@@ -12,7 +12,7 @@ git clone git-repo stage-git-repo > /dev/null
pushd stage-git-repo > /dev/null
snapshotVersion=$( get_revision_from_pom )
snapshotVersion=$( awk -F '=' '$1 == "version" { print $2 }' gradle.properties )
if [[ $RELEASE_TYPE = "M" ]]; then
stageVersion=$( get_next_milestone_release $snapshotVersion)
nextVersion=$snapshotVersion
@@ -27,23 +27,20 @@ else
fi
echo "Staging $stageVersion (next version will be $nextVersion)"
sed -i "s/version=$snapshotVersion/version=$stageVersion/" gradle.properties
set_revision_to_pom "$stageVersion"
git config user.name "Spring Buildmaster" > /dev/null
git config user.email "buildmaster@springframework.org" > /dev/null
git add pom.xml > /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
run_maven -f spring-boot-project/pom.xml clean deploy -U -Dfull -DaltDeploymentRepository=distribution::default::file://${repository}
run_maven -f spring-boot-tests/spring-boot-smoke-tests/pom.xml clean install -U -Dfull -Drepository=file://${repository}
run_maven -f spring-boot-tests/spring-boot-integration-tests/pom.xml clean install -U -Dfull -Drepository=file://${repository}
run_maven -f spring-boot-tests/spring-boot-deployment-tests/pom.xml clean install -U -Dfull -Drepository=file://${repository}
./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)"
set_revision_to_pom "$nextVersion"
sed -i "s/version=$snapshotVersion/version=$nextVersion/" gradle.properties
git add pom.xml > /dev/null
git commit -m"Next development version (v$nextVersion)" > /dev/null
fi;

View File

@@ -1,10 +0,0 @@
---
platform: linux
inputs:
- name: git-repo
- name: distribution-repository
caches:
- path: maven
- path: gradle
run:
path: git-repo/ci/scripts/build-deployment-tests.sh

View File

@@ -1,10 +0,0 @@
---
platform: linux
inputs:
- name: git-repo
- name: distribution-repository
caches:
- path: maven
- path: gradle
run:
path: git-repo/ci/scripts/build-integration-tests.sh

View File

@@ -7,5 +7,8 @@ outputs:
caches:
- path: maven
- path: gradle
params:
CI: true
GRADLE_ENTERPRISE_URL: https://ge.spring.io
run:
path: git-repo/ci/scripts/build-project.sh

View File

@@ -8,6 +8,11 @@ caches:
- path: maven
- path: gradle
- path: embedmongo
params:
CI: true
GRADLE_ENTERPRISE_CACHE_USERNAME:
GRADLE_ENTERPRISE_CACHE_PASSWORD:
GRADLE_ENTERPRISE_URL: https://ge.spring.io
run:
path: bash
args:
@@ -16,4 +21,3 @@ run:
source /docker-lib.sh
start_docker
${PWD}/git-repo/ci/scripts/build-project.sh

View File

@@ -1,10 +0,0 @@
---
platform: linux
inputs:
- name: git-repo
- name: distribution-repository
caches:
- path: maven
- path: gradle
run:
path: git-repo/ci/scripts/build-smoke-tests.sh

View File

@@ -7,6 +7,10 @@ outputs:
- 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: maven
- path: gradle