Set up Concourse-based CI builds

Closes gh-721
This commit is contained in:
Andy Wilkinson
2021-04-26 12:52:31 +01:00
parent 2ead1fb0d8
commit da310ec96c
24 changed files with 795 additions and 21 deletions

View File

@@ -46,8 +46,8 @@ There are several that you can contribute to Spring REST Docs:
Spring REST Docs is open source software released under the [Apache 2.0 license][14].
[1]: https://build.spring.io/plugins/servlet/wittified/build-status/SRD-PUB (Build status)
[2]: https://build.spring.io/browse/SRD-PUB
[1]: https://ci.spring.io/api/v1/teams/spring-restdocs/pipelines/spring-restdocs-2.0.x/jobs/build/badge (Build status)
[2]: https://ci.spring.io/teams/spring-restdocs/pipelines/spring-restdocs-2.0.x?groups=build
[3]: https://asciidoctor.org
[4]: https://docs.spring.io/spring-framework/docs/4.1.x/spring-framework-reference/htmlsingle/#spring-mvc-test-framework
[5]: https://developer.github.com/v3/

View File

@@ -1,6 +1,7 @@
plugins {
id 'io.spring.javaformat' version "$javaFormatVersion" apply false
id 'io.spring.nohttp' version '0.0.6.RELEASE' apply false
id 'maven-publish'
}
allprojects {
@@ -13,6 +14,7 @@ allprojects {
apply plugin: "samples"
apply plugin: "io.spring.nohttp"
apply from: "${rootProject.projectDir}/gradle/publish-maven.gradle"
nohttp {
source.exclude "samples/rest-notes-slate/slate/source/javascripts/lib/_jquery*.js"
@@ -165,14 +167,13 @@ task api (type: Javadoc) {
outputLevel = "quiet"
source = "1.8"
splitIndex = true
stylesheetFile = file("src/main/javadoc/spring-javadoc.css")
use = true
windowTitle = "Spring REST Docs ${project.version} API"
}
}
}
task docsZip(type: Zip, dependsOn: [":docs:asciidoctor", ":api", ":buildSamples"]) {
task docsZip(type: Zip, dependsOn: [":docs:asciidoctor", ":api", ":restNotesSpringHateoasGradle"]) {
group = "Distribution"
archiveBaseName = "spring-restdocs"
archiveClassifier = "docs"
@@ -190,16 +191,12 @@ task docsZip(type: Zip, dependsOn: [":docs:asciidoctor", ":api", ":buildSamples"
from(file("samples/rest-notes-spring-hateoas/build/asciidoc/html5")) {
into "samples/restful-notes"
}
}
from(file("samples/rest-notes-slate/build/docs")) {
into "samples/slate"
publishing {
publications {
maven(MavenPublication) {
artifact docsZip
}
}
}
configurations {
archives
}
artifacts {
archives docsZip
}

17
ci/README.adoc Normal file
View File

@@ -0,0 +1,17 @@
== Concourse pipeline
Ensure that you've setup the spring-restdocs target and can login
[source]
----
$ fly -t spring-restdocs login -n spring-restdocs -c https://ci.spring.io
----
The pipeline can be deployed using the following command:
[source]
----
$ fly -t spring-restdocs set-pipeline -p spring-restdocs-2.0.x -c ci/pipeline.yml -l ci/parameters.yml
----
NOTE: This assumes that you have Vault integration configured with the appropriate secrets.

21
ci/images/README.adoc Normal file
View File

@@ -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 ci-image/Dockerfile .
----
To test run:
----
$ docker run -it --entrypoint /bin/bash <SHA>
----

View File

@@ -0,0 +1,8 @@
FROM ubuntu:focal-20210401
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

11
ci/images/get-jdk-url.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -e
case "$1" in
java8)
echo "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u292-b10/OpenJDK8U-jdk_x64_linux_hotspot_8u292b10.tar.gz"
;;
*)
echo $"Unknown java version"
exit 1
esac

33
ci/images/setup.sh Executable file
View File

@@ -0,0 +1,33 @@
#!/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
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.3/concourse-java.sh > /opt/concourse-java.sh
###########################################################
# 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
###########################################################
mkdir ~/.gradle
echo 'systemProp.user.name=concourse' > ~/.gradle/gradle.properties

9
ci/parameters.yml Normal file
View File

@@ -0,0 +1,9 @@
github-repo: "https://github.com/spring-projects/spring-restdocs.git"
github-repo-name: "spring-projects/spring-restdocs"
docker-hub-organization: "springci"
artifactory-server: "https://repo.spring.io"
branch: "main"
milestone: "2.0.x"
build-name: "spring-restdocs"
concourse-url: "https://ci.spring.io"
task-timeout: 1h00m

441
ci/pipeline.yml Normal file
View File

@@ -0,0 +1,441 @@
anchors:
git-repo-resource-source: &git-repo-resource-source
uri: ((github-repo))
username: ((github-username))
password: ((github-password))
branch: ((branch))
registry-image-resource-source: &registry-image-resource-source
username: ((docker-hub-username))
password: ((docker-hub-password))
tag: ((milestone))
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))
docker-hub-task-params: &docker-hub-task-params
DOCKER_HUB_USERNAME: ((docker-hub-username))
DOCKER_HUB_PASSWORD: ((docker-hub-password))
github-task-params: &github-task-params
GITHUB_REPO: spring-restdocs
GITHUB_ORGANIZATION: spring-projects
GITHUB_PASSWORD: ((github-ci-release-token))
GITHUB_USERNAME: ((github-username))
MILESTONE: ((milestone))
sontatype-task-params: &sonatype-task-params
SONATYPE_USER_TOKEN: ((sonatype-username))
SONATYPE_PASSWORD_TOKEN: ((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))
file: git-repo/ci/tasks/build-project.yml
params:
BRANCH: ((branch))
<<: *gradle-enterprise-task-params
<<: *docker-hub-task-params
artifactory-repo-put-params: &artifactory-repo-put-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-restdocs-*.zip"
properties:
"zip.type": "docs"
"zip.deployed": "false"
slack-fail-params: &slack-fail-params
text: >
:concourse-failed: <!here> <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
slack-success-params: &slack-success-params
text: >
:concourse-succeeded: <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} was successful!>
[$TEXT_FILE_CONTENT]
text_file: git-repo/build/build-scan-uri.txt
silent: true
icon_emoji: ":concourse:"
username: concourse-ci
resource_types:
- name: artifactory-resource
type: registry-image
source:
repository: springio/artifactory-resource
tag: 0.0.14
- name: pull-request
type: registry-image
source:
repository: teliaoss/github-pr-resource
tag: v0.23.0
- 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: git-repo-windows
type: git
icon: github
source:
<<: *git-repo-resource-source
git_config:
- name: core.autocrlf
value: true
- name: git-pull-request
type: pull-request
icon: source-pull
source:
access_token: ((github-ci-pull-request-token))
repository: ((github-repo-name))
base_branch: ((branch))
ignore_paths: ["ci/*"]
- name: github-pre-release
type: github-release
icon: briefcase-download-outline
source:
owner: spring-projects
repository: spring-restdocs
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-restdocs
access_token: ((github-ci-release-token))
pre_release: false
- name: ci-images-git-repo
type: git
icon: github
source:
uri: ((github-repo))
branch: ((branch))
paths: ["ci/images/*"]
- name: ci-image
type: registry-image
icon: docker
source:
<<: *registry-image-resource-source
repository: ((docker-hub-organization))/spring-restdocs-ci
- 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: slack-alert
type: slack-notification
icon: slack
source:
url: ((slack-webhook-url))
- name: daily
type: time
icon: clock-outline
source: { interval: "24h" }
jobs:
- name: build-ci-images
plan:
- get: ci-images-git-repo
trigger: true
- get: git-repo
- task: build-ci-image
privileged: true
file: git-repo/ci/tasks/build-ci-image.yml
output_mapping:
image: ci-image
vars:
ci-image-name: ci-image
- put: ci-image
params:
image: ci-image/image.tar
- 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
<<: *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-repo-put-params
get_params:
threads: 8
on_failure:
do:
- put: slack-alert
params:
<<: *slack-fail-params
- put: slack-alert
params:
<<: *slack-success-params
- name: build-pull-requests
serial: true
public: true
plan:
- get: ci-image
- get: git-repo
resource: git-pull-request
trigger: true
version: every
- do:
- put: git-pull-request
params:
path: git-repo
status: pending
- task: build-project
image: ci-image
file: git-repo/ci/tasks/build-pr-project.yml
timeout: ((task-timeout))
on_success:
put: git-pull-request
params:
path: git-repo
status: success
on_failure:
put: git-pull-request
params:
path: git-repo
status: failure
- name: windows-build
serial: true
plan:
- get: git-repo
resource: git-repo-windows
- get: daily
trigger: true
- do:
- task: build-project
privileged: true
file: git-repo/ci/tasks/build-project-windows.yml
tags:
- WIN64
timeout: ((task-timeout))
params:
BRANCH: ((branch))
<<: *gradle-enterprise-task-params
on_failure:
do:
- put: slack-alert
params:
<<: *slack-fail-params
- put: slack-alert
params:
<<: *slack-success-params
- 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.yml
params:
RELEASE_TYPE: M
<<: *gradle-enterprise-task-params
<<: *docker-hub-task-params
- put: artifactory-repo
params:
<<: *artifactory-repo-put-params
repo: libs-staging-local
- put: git-repo
params:
repository: stage-git-repo
- 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.yml
params:
RELEASE_TYPE: RC
<<: *gradle-enterprise-task-params
<<: *docker-hub-task-params
- put: artifactory-repo
params:
<<: *artifactory-repo-put-params
repo: libs-staging-local
- put: git-repo
params:
repository: stage-git-repo
- 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.yml
params:
RELEASE_TYPE: RELEASE
<<: *gradle-enterprise-task-params
<<: *docker-hub-task-params
- put: artifactory-repo
params:
<<: *artifactory-repo-put-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.yml
params:
RELEASE_TYPE: M
<<: *artifactory-task-params
- task: generate-changelog
file: git-repo/ci/tasks/generate-changelog.yml
params:
RELEASE_TYPE: M
GITHUB_USERNAME: ((github-username))
GITHUB_TOKEN: ((github-ci-release-token))
- put: github-pre-release
params:
name: generated-changelog/tag
tag: generated-changelog/tag
body: generated-changelog/changelog.md
- 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.yml
params:
RELEASE_TYPE: RC
<<: *artifactory-task-params
- task: generate-changelog
file: git-repo/ci/tasks/generate-changelog.yml
params:
RELEASE_TYPE: RC
GITHUB_USERNAME: ((github-username))
GITHUB_TOKEN: ((github-ci-release-token))
- put: github-pre-release
params:
name: generated-changelog/tag
tag: generated-changelog/tag
body: generated-changelog/changelog.md
- 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.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_USERNAME: ((github-username))
GITHUB_TOKEN: ((github-ci-release-token))
- put: github-release
params:
name: generated-changelog/tag
tag: generated-changelog/tag
body: generated-changelog/changelog.md
groups:
- name: "builds"
jobs: ["build", "windows-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"]
- name: "pull-requests"
jobs: ["build-pull-requests"]

8
ci/scripts/build-pr-project.sh Executable file
View File

@@ -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 --continue build buildSamples
popd > /dev/null

View File

@@ -0,0 +1,4 @@
SET "JAVA_HOME=C:\opt\jdk-8"
SET PATH=%PATH%;C:\Program Files\Git\usr\bin
cd git-repo
.\gradlew -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false --no-daemon --max-workers=4 build buildSamples

9
ci/scripts/build-project.sh Executable file
View File

@@ -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 buildSamples publishAllPublicationsToDeploymentRepository
popd > /dev/null

4
ci/scripts/common.sh Normal file
View File

@@ -0,0 +1,4 @@
source /opt/concourse-java.sh
setup_symlinks
cleanup_maven_repo "org.springframework.restdocs"

View File

@@ -0,0 +1,12 @@
#!/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/' )
java -jar /github-changelog-generator.jar \
--changelog.repository=spring-projects/spring-restdocs \
${version} generated-changelog/changelog.md
echo ${version} > generated-changelog/version
echo v${version} > generated-changelog/tag

13
ci/scripts/promote.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
source $(dirname $0)/common.sh
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 /spring-boot-release-scripts.jar publishToCentral $RELEASE_TYPE $BUILD_INFO_LOCATION artifactory-repo || { exit 1; }
java -jar /spring-boot-release-scripts.jar promote $RELEASE_TYPE $BUILD_INFO_LOCATION || { exit 1; }
echo "Promotion complete"
echo $version > version/version

50
ci/scripts/stage.sh Executable file
View File

@@ -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)
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 Buildmaster" > /dev/null
git config user.email "buildmaster@springframework.org" > /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 buildSamples 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 "DONE"
popd > /dev/null

View File

@@ -0,0 +1,26 @@
---
platform: linux
image_resource:
type: registry-image
source:
repository: vito/oci-build-task
inputs:
- name: ci-images-git-repo
outputs:
- name: image
caches:
- path: ci-image-cache
params:
CONTEXT: ci-images-git-repo/ci/images
DOCKERFILE: ci-images-git-repo/ci/images/((ci-image-name))/Dockerfile
DOCKER_HUB_AUTH: ((docker-hub-auth))
run:
path: /bin/sh
args:
- "-c"
- |
mkdir -p /root/.docker
cat > /root/.docker/config.json <<EOF
{ "auths": { "https://index.docker.io/v1/": { "auth": "$DOCKER_HUB_AUTH" }}}
EOF
build

View File

@@ -0,0 +1,13 @@
---
platform: linux
inputs:
- name: git-repo
outputs:
- name: distribution-repository
caches:
- path: gradle
params:
CI: true
GRADLE_ENTERPRISE_URL: https://ge.spring.io
run:
path: git-repo/ci/scripts/build-pr-project.sh

View File

@@ -0,0 +1,15 @@
---
platform: windows
inputs:
- name: git-repo
outputs:
- name: git-repo
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: git-repo/ci/scripts/build-project-windows.bat

View File

@@ -0,0 +1,19 @@
---
platform: linux
inputs:
- name: git-repo
outputs:
- name: distribution-repository
- name: git-repo
caches:
- path: gradle
- path: embedmongo
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: git-repo/ci/scripts/build-project.sh

20
ci/tasks/generate-changelog.yml Executable file
View File

@@ -0,0 +1,20 @@
---
platform: linux
image_resource:
type: registry-image
source:
repository: springio/github-changelog-generator
tag: '0.0.6'
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

17
ci/tasks/promote.yml Normal file
View File

@@ -0,0 +1,17 @@
---
platform: linux
inputs:
- name: git-repo
- name: artifactory-repo
outputs:
- name: version
params:
RELEASE_TYPE:
ARTIFACTORY_SERVER:
ARTIFACTORY_USERNAME:
ARTIFACTORY_PASSWORD:
SONATYPE_USER_TOKEN:
SONATYPE_PASSWORD_TOKEN:
SONATYPE_STAGING_PROFILE_ID:
run:
path: git-repo/ci/scripts/promote.sh

17
ci/tasks/stage.yml Normal file
View File

@@ -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.sh

View File

@@ -1,14 +1,24 @@
plugins.withType(MavenPublishPlugin) {
publishing {
if (project.hasProperty("deploymentRepository")) {
repositories {
maven {
url = project.property("deploymentRepository")
name = "deployment"
}
}
}
publications {
maven(MavenPublication) { publication ->
from components.java
versionMapping {
usage("java-api") {
fromResolutionResult()
}
usage("java-runtime") {
fromResolutionResult()
project.plugins.withType(JavaPlugin) {
from components.java
versionMapping {
usage("java-api") {
fromResolutionResult()
}
usage("java-runtime") {
fromResolutionResult()
}
}
}
pom {