Files
spring-guice/pipeline.yml
2023-01-16 09:24:27 +00:00

130 lines
3.4 KiB
YAML

# fly --target team login --concourse-url https://ci.spring.io --team-name "Spring Team"
# fly --target team set-pipeline --config pipeline.yml --pipeline spring-guice --load-vars-from credentials.yml
---
resource_types:
- name: slack-notification
type: registry-image
source:
repository: harbor-repo.vmware.com/dockerhub-proxy-cache/nebhale/slack-notification-resource
tag: latest
resources:
- name: source
type: git
source:
uri: https://github.com/spring-projects/spring-guice.git
- name: slack
type: slack-notification
source:
url: ((slack-webhook-url))
slack-failure: &slack-failure
put: slack
params:
attachments:
- color: danger
fallback: "$BUILD_PIPELINE_NAME/$BUILD_JOB_NAME #$BUILD_NAME <FAILURE>"
text: "<!here> Build has failed"
title: "$BUILD_PIPELINE_NAME/$BUILD_JOB_NAME #$BUILD_NAME"
title_link: $ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME
slack-success: &slack-success
put: slack
params:
attachments:
- color: good
fallback: "$BUILD_PIPELINE_NAME/$BUILD_JOB_NAME #$BUILD_NAME <SUCCESS>"
text: "Build has succeeded"
title: "$BUILD_PIPELINE_NAME/$BUILD_JOB_NAME #$BUILD_NAME"
title_link: $ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME
jobs:
- name: build
plan:
- get: source
trigger: true
- task: build
config:
platform: linux
image_resource:
type: registry-image
source:
repository: harbor-repo.vmware.com/dockerhub-proxy-cache/springci/spring-framework-ci-jdk11
tag: 5.3.x
inputs:
- name: source
caches:
- path: source/.m2
run:
dir: source
path: sh
args:
- -c
- |
rm -rf ~/.m2
ln -s $(pwd)/.m2 ~/.m2
./mvnw install
- name: next
plan:
- get: source
trigger: true
- task: build
config:
platform: linux
image_resource:
type: registry-image
source:
repository: harbor-repo.vmware.com/dockerhub-proxy-cache/springci/spring-framework-ci-jdk17
tag: 5.3.x
inputs:
- name: source
caches:
- path: source/.m2
run:
dir: source
path: sh
args:
- -c
- |
rm -rf ~/.m2
ln -s $(pwd)/.m2 ~/.m2
./mvnw install -Dspring.version=5.3.16
- name: deploy
plan:
- get: source
trigger: true
passed: [build, next]
- task: deploy
config:
platform: linux
image_resource:
type: registry-image
source:
repository: harbor-repo.vmware.com/dockerhub-proxy-cache/springci/spring-framework-ci-jdk11
tag: 5.3.x
inputs:
- name: source
caches:
- path: source/.m2
run:
dir: source
path: sh
args:
- -c
- |
rm -rf ~/.m2
ln -s $(pwd)/.m2 ~/.m2
echo "((signing-key))" > private.asc
gpg --import --batch --no-tty private.asc
./mvnw deploy -DskipTests -s .mvn/settings.xml
params:
TERM: dumb
passphrase: ((signing-passphrase))
sonatype_username: ((sonatype-username))
sonatype_password: ((sonatype-password))
spring_username: ((artifactory-username))
spring_password: ((artifactory-password))
on_failure: *slack-failure
on_success: *slack-success