-
Notifications
You must be signed in to change notification settings - Fork 91
/
Copy pathpipeline.yml
76 lines (73 loc) · 2.44 KB
/
pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# fly --target spring-team login --team-name spring-team --concourse-url https://ci.spring.io
# fly --target spring-team set-pipeline --config pipeline.yml --pipeline spring-boot-thin-launcher --load-vars-from credentials.yml
---
resource_types:
- name: slack-notification
type: docker-image
source:
repository: harbor-repo.vmware.com/dockerhub-proxy-cache/nebhale/slack-notification-resource
resources:
- name: source
type: git
source:
uri: https://github.com/spring-projects-experimental/spring-boot-thin-launcher.git
- name: slack
type: slack-notification
source:
url: {{slack-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
jobs:
- name: build
public: true
plan:
- get: source
trigger: true
- task: maven
timeout: 2h30m
config:
platform: linux
image_resource:
source:
repository: harbor-repo.vmware.com/dockerhub-proxy-cache/springio/spring-ci-base
type: docker-image
inputs:
- name: source
caches:
- path: source/.m2
- path: source/.gradle
run:
dir: source
path: sh
args:
- -c
- |
rm -rf ~/.m2 ~/.gradle
ln -s $(pwd)/.m2 ~/.m2
ln -s $(pwd)/.gradle ~/.gradle
echo "((signing-key))" > private.asc
gpg --import --batch --no-tty private.asc
./mvnw deploy -s .mvn/settings.xml
GRADLE_PUBLISH_VERSION=$( sed '\!<parent!,\!</parent!d' pom.xml | grep '<version' | head -1 | sed -e 's/.*<version>//' -e 's!</version>.*$!!' )
echo $GRADLE_PUBLISH_VERSION | grep -q SNAPSHOT
if [ "$?" == "1" ]; then
cd gradle-plugin/publish
./gradlew publishExisting
fi
params:
TERM: -dumb
passphrase: ((signing-passphrase))
sonatype_username: ((sonatype-username))
sonatype_password: ((sonatype-password))
spring_username: ((artifactory-username))
spring_password: ((artifactory-password))
GRADLE_PUBLISH_KEY: ((gradle-publish-key))
GRADLE_PUBLISH_SECRET: ((gradle-publish-secret))
on_failure: *slack-failure