From 22574f779a5048ba2a5c068d54c1827e7fe11f7f Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 17 Nov 2021 10:55:34 +0000 Subject: [PATCH] Bring CI configuration up to date --- ci/config/changelog-generator.yml | 23 +++++++++++++++++++++++ ci/config/release-scripts.yml | 10 ++++++++++ ci/images/setup.sh | 5 +++-- ci/parameters.yml | 3 +++ ci/scripts/generate-changelog.sh | 2 +- ci/scripts/promote.sh | 11 ++++++++--- ci/tasks/build-ci-image.yml | 7 ++++++- ci/tasks/generate-changelog.yml | 6 +++++- ci/tasks/promote.yml | 9 +++++---- 9 files changed, 64 insertions(+), 12 deletions(-) create mode 100644 ci/config/changelog-generator.yml create mode 100644 ci/config/release-scripts.yml diff --git a/ci/config/changelog-generator.yml b/ci/config/changelog-generator.yml new file mode 100644 index 00000000..9c7fa358 --- /dev/null +++ b/ci/config/changelog-generator.yml @@ -0,0 +1,23 @@ +changelog: + repository: spring-projects/spring-restdocs + 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" + issues: + ports: + - label: "status: forward-port" + bodyExpression: 'Forward port of issue #(\d+).*' + - label: "status: back-port" + bodyExpression: 'Back port of issue #(\d+).*' diff --git a/ci/config/release-scripts.yml b/ci/config/release-scripts.yml new file mode 100644 index 00000000..6de87395 --- /dev/null +++ b/ci/config/release-scripts.yml @@ -0,0 +1,10 @@ +logging: + level: + io.spring.concourse: DEBUG +spring: + main: + banner-mode: off +sonatype: + exclude: + - 'build-info\.json' + - '.*\.zip' \ No newline at end of file diff --git a/ci/images/setup.sh b/ci/images/setup.sh index d5078192..bcbe3e7c 100755 --- a/ci/images/setup.sh +++ b/ci/images/setup.sh @@ -7,13 +7,14 @@ set -ex 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 +apt-get install --no-install-recommends -y tzdata ca-certificates net-tools libxml2-utils git curl libudev1 libxml2-utils iptables iproute2 jq unzip 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 +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 diff --git a/ci/parameters.yml b/ci/parameters.yml index ce8eb973..7632ead3 100644 --- a/ci/parameters.yml +++ b/ci/parameters.yml @@ -7,3 +7,6 @@ milestone: "2.0.x" build-name: "spring-restdocs" concourse-url: "https://ci.spring.io" task-timeout: 1h00m +registry-mirror-host: docker.repo.spring.io +registry-mirror-username: ((artifactory-username)) +registry-mirror-password: ((artifactory-password)) \ No newline at end of file diff --git a/ci/scripts/generate-changelog.sh b/ci/scripts/generate-changelog.sh index 0cffe7fc..d3d2b97e 100755 --- a/ci/scripts/generate-changelog.sh +++ b/ci/scripts/generate-changelog.sh @@ -5,7 +5,7 @@ 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 \ + --spring.config.location=${CONFIG_DIR}/changelog-generator.yml \ ${version} generated-changelog/changelog.md echo ${version} > generated-changelog/version diff --git a/ci/scripts/promote.sh b/ci/scripts/promote.sh index 14ad9861..ae5a1435 100755 --- a/ci/scripts/promote.sh +++ b/ci/scripts/promote.sh @@ -1,13 +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 /spring-boot-release-scripts.jar 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 \ + 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; } +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 +echo $version > version/version \ No newline at end of file diff --git a/ci/tasks/build-ci-image.yml b/ci/tasks/build-ci-image.yml index 30b2df98..4d588c31 100644 --- a/ci/tasks/build-ci-image.yml +++ b/ci/tasks/build-ci-image.yml @@ -3,7 +3,12 @@ platform: linux image_resource: type: registry-image source: - repository: vito/oci-build-task + repository: concourse/oci-build-task + tag: 0.9.0 + registry_mirror: + host: ((registry-mirror-host)) + username: ((registry-mirror-username)) + password: ((registry-mirror-password)) inputs: - name: ci-images-git-repo outputs: diff --git a/ci/tasks/generate-changelog.yml b/ci/tasks/generate-changelog.yml index ea048af9..4927fbf8 100755 --- a/ci/tasks/generate-changelog.yml +++ b/ci/tasks/generate-changelog.yml @@ -4,7 +4,11 @@ image_resource: type: registry-image source: repository: springio/github-changelog-generator - tag: '0.0.6' + tag: '0.0.7' + registry_mirror: + host: ((registry-mirror-host)) + username: ((registry-mirror-username)) + password: ((registry-mirror-password)) inputs: - name: git-repo - name: artifactory-repo diff --git a/ci/tasks/promote.yml b/ci/tasks/promote.yml index 2e5f9d36..c27f0748 100644 --- a/ci/tasks/promote.yml +++ b/ci/tasks/promote.yml @@ -6,12 +6,13 @@ inputs: outputs: - name: version params: - RELEASE_TYPE: ARTIFACTORY_SERVER: ARTIFACTORY_USERNAME: ARTIFACTORY_PASSWORD: - SONATYPE_USER_TOKEN: - SONATYPE_PASSWORD_TOKEN: + RELEASE_TYPE: + SONATYPE_USERNAME: + SONATYPE_PASSWORD: + SONATYPE_URL: SONATYPE_STAGING_PROFILE_ID: run: - path: git-repo/ci/scripts/promote.sh + path: git-repo/ci/scripts/promote.sh \ No newline at end of file