diff --git a/ci/README.adoc b/ci/README.adoc deleted file mode 100644 index e0f3d35..0000000 --- a/ci/README.adoc +++ /dev/null @@ -1,20 +0,0 @@ -== Concourse pipeline - -The pipeline can be deployed using the following command: - -[source] ----- -$ fly -t gradle-enterprise-conventions set-pipeline -p gradle-enterprise-conventions -c ci/pipeline.yml -l ci/parameters.yml ----- - -NOTE: This assumes that you have CredHub integration configured with the appropriate secrets. - -=== Release - -To release a GA: - -[source] ----- -$ fly -t gradle-enterprise-conventions trigger-job -j gradle-enterprise-conventions/stage-release -$ fly -t gradle-enterprise-conventions trigger-job -j gradle-enterprise-conventions/promote-release ----- diff --git a/ci/config/release-scripts.yml b/ci/config/release-scripts.yml deleted file mode 100644 index d18538f..0000000 --- a/ci/config/release-scripts.yml +++ /dev/null @@ -1,6 +0,0 @@ -spring: - main: - banner-mode: off -sonatype: - exclude: - - 'build-info\.json' diff --git a/ci/image/Dockerfile b/ci/image/Dockerfile deleted file mode 100644 index 3b42500..0000000 --- a/ci/image/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM ubuntu:jammy-20231211.1 - -RUN apt-get update -RUN apt-get install --no-install-recommends -y ca-certificates net-tools git curl jq -RUN rm -rf /var/lib/apt/lists/* - -ENV JAVA_HOME /opt/openjdk -ENV PATH $JAVA_HOME/bin:$PATH -RUN mkdir -p /opt/openjdk && \ - cd /opt/openjdk && \ - curl -L https://github.com/bell-sw/Liberica/releases/download/8u392+9/bellsoft-jdk8u392+9-linux-amd64.tar.gz | tar xz --strip-components=1 - -ADD https://raw.githubusercontent.com/spring-io/concourse-java-scripts/v0.0.4/concourse-java.sh /opt/ \ No newline at end of file diff --git a/ci/image/README.adoc b/ci/image/README.adoc deleted file mode 100644 index b1e8d89..0000000 --- a/ci/image/README.adoc +++ /dev/null @@ -1,15 +0,0 @@ -== CI Image - -This image is used by CI to run the build. - -To build the image locally run the following from this directory: - ----- -$ docker build --no-cache . ----- - -To test run: - ----- -$ docker run -it --entrypoint /bin/bash ----- \ No newline at end of file diff --git a/ci/parameters.yml b/ci/parameters.yml deleted file mode 100644 index 84bcd15..0000000 --- a/ci/parameters.yml +++ /dev/null @@ -1,6 +0,0 @@ -github-repo: "https://github.com/spring-io/gradle-enterprise-conventions.git" -github-repo-name: "spring-io/gradle-enterprise-conventions" -docker-hub-organization: "springci" -artifactory-server: "https://repo.spring.io" -branch: "main" -build-name: "gradle-enterprise-conventions" \ No newline at end of file diff --git a/ci/pipeline.yml b/ci/pipeline.yml deleted file mode 100644 index 97496ce..0000000 --- a/ci/pipeline.yml +++ /dev/null @@ -1,145 +0,0 @@ -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.7.2 - username: ((docker-hub-username)) - password: ((docker-hub-password)) -resources: -- name: git-repo - type: git - source: - uri: ((github-repo)) - username: ((github-username)) - password: ((github-password)) - branch: ((branch)) - ignore_paths: ["ci/image/*"] -- name: github-release - type: github-release - source: - owner: spring-io - repository: gradle-enterprise-conventions - access_token: ((github-ci-release-token)) - pre_release: false -- name: ci-image-git-repo - type: git - source: - uri: ((github-repo)) - branch: ((branch)) - paths: ["ci/image/*"] -- name: ci-image - type: registry-image - source: - repository: ((docker-hub-organization))/gradle-enterprise-conventions-ci-image - username: ((docker-hub-username)) - password: ((docker-hub-password)) - tag: ((branch)) -- name: artifactory-repo - type: artifactory-resource - source: - uri: ((artifactory-server)) - username: ((artifactory-username)) - password: ((artifactory-password)) - build_name: ((build-name)) -jobs: -- name: build-ci-image - plan: - - get: git-repo - - get: ci-image-git-repo - trigger: true - - do: - - task: build-ci-image - privileged: true - file: git-repo/ci/tasks/build-ci-image.yml - output_mapping: - image: 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 - - do: - - task: build-project - privileged: true - timeout: 1h30m - image: ci-image - file: git-repo/ci/tasks/build-project.yml - - put: artifactory-repo - params: &artifactory-params - signing_key: ((signing-key)) - signing_passphrase: ((signing-passphrase)) - repo: libs-snapshot-local - build_number: "${BUILD_ID}" - 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 -- 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 - - 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: git-repo - trigger: false - - get: artifactory-repo - trigger: false - passed: [stage-release] - params: - download_artifacts: true - save_build_info: true - - task: promote - file: git-repo/ci/tasks/promote.yml - params: - RELEASE_TYPE: RELEASE - ARTIFACTORY_SERVER: ((artifactory-server)) - ARTIFACTORY_USERNAME: ((artifactory-username)) - ARTIFACTORY_PASSWORD: ((artifactory-password)) - SONATYPE_USERNAME: ((s01-user-token)) - SONATYPE_PASSWORD: ((s01-user-token-password)) - SONATYPE_URL: ((sonatype-url)) - SONATYPE_STAGING_PROFILE_ID: ((sonatype-staging-profile-id)) - - 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: "build" - jobs: ["build"] -- name: "release" - jobs: ["stage-release", "promote-release"] -- name: "ci-image" - jobs: ["build-ci-image"] diff --git a/ci/scripts/build-project.sh b/ci/scripts/build-project.sh deleted file mode 100755 index d56acbf..0000000 --- a/ci/scripts/build-project.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -set -e - -source $(dirname $0)/common.sh -repository=$(pwd)/distribution-repository - -pushd git-repo > /dev/null -./gradlew --no-daemon build publish -PdistributionRepository=${repository} -popd > /dev/null diff --git a/ci/scripts/common.sh b/ci/scripts/common.sh deleted file mode 100644 index c5dbd09..0000000 --- a/ci/scripts/common.sh +++ /dev/null @@ -1,3 +0,0 @@ -source /opt/concourse-java.sh -export TERM=dumb -setup_symlinks diff --git a/ci/scripts/generate-changelog.sh b/ci/scripts/generate-changelog.sh deleted file mode 100755 index 472d3b7..0000000 --- a/ci/scripts/generate-changelog.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -set -e - -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-io/gradle-enterprise-conventions \ - ${version} generated-changelog/changelog.md - -echo ${version} > generated-changelog/version -echo v${version} > generated-changelog/tag \ No newline at end of file diff --git a/ci/scripts/promote.sh b/ci/scripts/promote.sh deleted file mode 100755 index bd16001..0000000 --- a/ci/scripts/promote.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -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 /concourse-release-scripts.jar \ - --spring.config.location=${CONFIG_DIR}/release-scripts.yml \ - publishToCentral $RELEASE_TYPE $BUILD_INFO_LOCATION artifactory-repo || { exit 1; } - -java -jar /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 diff --git a/ci/scripts/stage.sh b/ci/scripts/stage.sh deleted file mode 100755 index c5a172c..0000000 --- a/ci/scripts/stage.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/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 = "RELEASE" ]]; then - stageVersion=$( strip_snapshot_suffix $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 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 build publish -PdistributionRepository=${repository} - -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 diff --git a/ci/tasks/build-ci-image.yml b/ci/tasks/build-ci-image.yml deleted file mode 100644 index ce16df0..0000000 --- a/ci/tasks/build-ci-image.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -platform: linux -image_resource: - type: registry-image - source: - repository: vito/oci-build-task -inputs: -- name: ci-image-git-repo -outputs: -- name: image -caches: -- path: ci-image-cache -params: - CONTEXT: ci-image-git-repo/ci/image - DOCKERFILE: ci-image-git-repo/ci/image/Dockerfile - DOCKER_HUB_AUTH: ((docker-hub-auth)) -run: - path: /bin/sh - args: - - "-c" - - | - mkdir -p /root/.docker - cat > /root/.docker/config.json <