forked from jtarchie/github-pullrequest-resource
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.concourse.yml
162 lines (160 loc) · 4.04 KB
/
.concourse.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
resource_types:
- name: pull-request
type: docker-image
source:
repository: jtarchie/pr
- name: pull-request-test
type: docker-image
source:
repository: jtarchie/pr
tag: test
resources:
- name: git-pr
type: git
source:
uri: [email protected]:jtarchie/pullrequest-resource
branch: master
private_key: {{github-private-key}}
- name: docker-pr
type: docker-image
source:
username: {{docker-username}}
password: {{docker-password}}
repository: jtarchie/pr
- name: git-pull-requests
type: pull-request
source:
access_token: {{github-access-token}}
private_key: {{github-private-key}}
repo: jtarchie/pullrequest-resource
base: master
- name: merge-pull-requests
type: pull-request-test
source:
access_token: {{github-access-token}}
private_key: {{github-private-key}}
base: test-merge
repo: jtarchie/pullrequest-resource
jobs:
- name: test-pr-merge
plan:
- get: git-pr
passed: [ 'tests' ]
trigger: true
- get: merge-pull-requests
trigger: true
- put: merge-pull-requests
params:
path: merge-pull-requests
status: success
merge:
method: merge
commit_msg: merge-pull-requests/README.md
- name: pr tests
plan:
- get: git-pull-requests
trigger: true
version: every
- task: rspec
privileged: true
config:
image_resource:
type: docker-image
source:
repository: jtarchie/pr
tag: test
inputs:
- name: git-pull-requests
platform: linux
run:
path: sh
args: ['-c', 'cd git-pull-requests && bundle install && bundle exec rspec']
on_success:
put: git-pull-requests
params:
path: git-pull-requests
status: success
on_failure:
put: git-pull-requests
params:
path: git-pull-requests
status: failure
- name: docker
plan:
- get: git-pr
trigger: true
- task: tag
config:
image_resource:
type: docker-image
source:
repository: alpine
platform: linux
outputs:
- name: tag
run:
path: sh
args: ["-c", "echo test > tag/name"]
- put: docker-pr
params:
build: git-pr
dockerfile: git-pr/Dockerfile.test
tag: tag/name
get_params:
skip_download: true
- name: tests
plan:
- get: git-pr
passed: [ docker ]
trigger: true
- task: rspec
privileged: true
config:
image_resource:
type: docker-image
source:
repository: jtarchie/pr
tag: test
inputs:
- name: git-pr
platform: linux
run:
path: sh
args: ['-c', 'cd git-pr && bundle install && bundle exec rspec']
- name: release
plan:
- get: git-pr
passed: [ 'test-pr-merge' ]
- task: next-tag
config:
image: /var/vcap/packages/git_resource/rootfs
platform: linux
inputs:
- name: git-pr
outputs:
- name: tag
run:
path: bash
args:
- -c
- |
set -eux
echo v > tag/prefix
pushd git-pr
git tag -l | sed -e "s/v//" | sort -n | tail -n 1 | xargs -n 1 expr 1 + > ../tag/name
popd
- put: docker-pr
params:
build: git-pr
dockerfile: git-pr/Dockerfile
tag: tag/name
tag_prefix: v
tag_as_latest: true
get_params:
skip_download: true
- put: git-pr
params:
repository: git-pr
only_tag: true
tag: tag/name
tag_prefix: v