Skip to content

Commit 12d411c

Browse files
committed
[ci] pipeline updates for release notes and shipping releases
1 parent 75738f4 commit 12d411c

17 files changed

+703
-97
lines changed

ci/pipeline/base.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ groups:
1616
- name: (( concat "build-" meta.pipeline "-releases" ))
1717
jobs:
1818
- build
19+
- ship-prerelease
1920
- test-vault-1.9
2021
- test-vault-1.10
2122
- test-vault-1.11
2223
- test-vault-1.12
2324
- test-vault-1.13
24-
- rc
25-
- shipit
25+
- prepare
26+
- ship-release
2627
- name: (( concat "test-" meta.pipeline "-pull-requests" ))
2728
jobs:
2829
- test-pr
@@ -65,6 +66,12 @@ meta:
6566
branch: develop
6667
private_key: (( param "Please generate an SSH Deployment Key for this repo and specify it here" ))
6768
access_token: (( param "Please generate a Personal Access Token and specify it here" ))
69+
release_notes:
70+
repo: "ci-release-notes"
71+
branch: "main"
72+
file: (( concat meta.name "-release-notes.md" ))
73+
uri: (( concat "[email protected]:" meta.github.owner "/" meta.github.release_notes.repo ))
74+
edit: (( concat "https://github.com/" meta.github.owner "/" meta.github.release_notes.repo "/edit/" meta.github.release_notes.branch "/" meta.github.release_notes.file ))
6875

6976
slack:
7077
webhook: (( param "Please specify your Slack Incoming Webhook Integration URL" ))

ci/pipeline/jobs/prepare.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
meta:
2+
vault-tests:
3+
- test-vault-1.9
4+
- test-vault-1.10
5+
- test-vault-1.11
6+
- test-vault-1.12
7+
- test-vault-1.13
8+
jobs:
9+
- name: prepare
10+
public: true
11+
serial: true
12+
plan:
13+
- do:
14+
- in_parallel:
15+
- { get: version, passed: ((grab meta.vault-tests)), params: {bump: final} }
16+
- { get: git, passed: ((grab meta.vault-tests)), trigger: true }
17+
- { get: git-ci }
18+
- { get: git-latest-tag }
19+
- { get: release-notes }
20+
- task: generate-release-notes
21+
file: git-ci/ci/tasks/generate-release-notes.yml
22+
params:
23+
RELEASE_NOTES_WEB_URL: (( grab meta.github.release_notes.edit ))
24+
RELEASE_NOTES_FILE: (( grab meta.github.release_notes.file ))
25+
GIT_NAME: (( grab meta.git.name ))
26+
GIT_EMAIL: (( grab meta.git.email ))
27+
PROJECT: (( grab meta.name ))
28+
- put: release-notes
29+
params:
30+
rebase: true
31+
repository: release-notes
32+
on_failure:
33+
put: notify
34+
params:
35+
username: (( grab meta.slack.username ))
36+
icon_url: (( grab meta.slack.icon ))
37+
text: '(( concat meta.slack.fail_url " " meta.pipeline ": prepare job failed" ))'
38+
39+
# Shout-based notification when its working again
40+
# on_failure:
41+
# put: notify
42+
# params:
43+
# topic: (( concat meta.shout.topic "-$BUILD_JOB_NAME" ))
44+
# message: release candidate job 'pre' failed (which is unusual).
45+
# ok: no
46+
# link: (( grab meta.shout.links.build ))

ci/pipeline/jobs/rc.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

ci/pipeline/jobs/ship-prerelease.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
jobs:
2+
- name: ship-prerelease
3+
public: true
4+
serial: false
5+
plan:
6+
- do:
7+
- in_parallel:
8+
- { get: build, passed: [build]}
9+
- { get: version, passed: [build]}
10+
- { get: git, passed: [build]}
11+
- { get: git-ci }
12+
13+
- task: ship-prerelease
14+
file: git-ci/ci/tasks/prerelease.yml
15+
params:
16+
PRERELEASE: 1
17+
PROJECT: (( grab meta.name ))
18+
DEVELOP_BRANCH: (( grab meta.github.branch ))
19+
RELEASE_BRANCH: (( grab meta.github.branch ))
20+
RELEASE_ROOT: gh
21+
RELEASE_NOTES: (( grab meta.github.release_notes.file ))
22+
NOTIFICATION_OUT: notifications
23+
GITHUB_OWNER: (( grab meta.github.owner ))
24+
GIT_EMAIL: (( grab meta.git.email ))
25+
GIT_NAME: (( grab meta.git.name ))
26+
27+
- put: github-prerelease
28+
params:
29+
name: gh/name
30+
tag: gh/tag
31+
body: gh/notes.md
32+
commitish: gh/commit
33+
globs: [gh/artifacts/*]
34+
35+
on_failure:
36+
put: notify
37+
params:
38+
channel: (( grab meta.slack.channel ))
39+
username: (( grab meta.slack.username ))
40+
icon_url: (( grab meta.slack.icon ))
41+
text: '(( concat meta.slack.fail_url " " meta.pipeline ": ship prerelease job failed" ))'
42+
43+
# Shout-based notification - currently not available
44+
# on_failure:
45+
# put: notify
46+
# params:
47+
# topic: (( concat meta.shout.topic "-$BUILD_JOB_NAME" ))
48+
# message: tests job '$BUILD_JOB_NAME' failed.
49+
# ok: no
50+
# link: (( grab meta.shout.links.build ))

ci/pipeline/jobs/ship-release.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
jobs:
2+
- name: ship-release
3+
public: true
4+
serial: true
5+
plan:
6+
- do:
7+
- in_parallel:
8+
- { get: version, resource: version, passed: [prepare], params: {bump: final} }
9+
- { get: git, passed: [prepare] }
10+
- { get: git-ci }
11+
- { get: git-main }
12+
- { get: git-latest-tag }
13+
- { get: release-notes}
14+
- task: build-kit
15+
file: git-ci/ci/tasks/build.yml
16+
params:
17+
PROJECT: (( grab meta.name ))
18+
- task: release
19+
file: git-ci/ci/tasks/release.yml
20+
params:
21+
PROJECT: (( grab meta.name ))
22+
DEVELOP_BRANCH: (( grab meta.github.branch ))
23+
RELEASE_BRANCH: (( grab meta.github.main-branch ))
24+
RELEASE_ROOT: gh
25+
RELEASE_NOTES: (( grab meta.github.release_notes.file ))
26+
NOTIFICATION_OUT: notifications
27+
GITHUB_OWNER: (( grab meta.github.owner ))
28+
GIT_EMAIL: (( grab meta.git.email ))
29+
GIT_NAME: (( grab meta.git.name ))
30+
- put: git-main
31+
params:
32+
merge: false
33+
tag: gh/tag
34+
repository: git-main
35+
- put: github
36+
params:
37+
name: gh/name
38+
tag: gh/tag
39+
body: gh/notes.md
40+
globs: [gh/artifacts/*]
41+
- put: version
42+
params:
43+
bump: patch
44+
- put: notify
45+
params:
46+
username: (( grab meta.slack.username ))
47+
icon_url: (( grab meta.slack.icon ))
48+
text_file: notifications/message
49+
on_failure:
50+
put: notify
51+
params:
52+
username: (( grab meta.slack.username ))
53+
icon_url: (( grab meta.slack.icon ))
54+
text: '(( concat meta.slack.fail_url " " meta.pipeline ": prepare job failed" ))'
55+
# Shout notification - not currently available
56+
# on_success:
57+
# put: notify
58+
# params:
59+
# topic: (( concat meta.shout.topic "-$BUILD_JOB_NAME" ))
60+
# message: release job '$BUILD_JOB_NAME' succeeded.
61+
# ok: yes
62+
# link: (( grab meta.shout.links.build ))
63+
# on_failure:
64+
# put: notify
65+
# params:
66+
# topic: (( concat meta.shout.topic "-$BUILD_JOB_NAME" ))
67+
# message: release job '$BUILD_JOB_NAME' failed.
68+
# ok: no
69+
# link: (( grab meta.shout.links.build ))

ci/pipeline/jobs/shipit.yml

Lines changed: 0 additions & 67 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
resources:
2+
- name: git-latest-tag
3+
type: git
4+
check_every: 60m
5+
webhook_token: ((webhook.token))
6+
source:
7+
uri: (( grab meta.github.uri ))
8+
branch: (( grab meta.github.branch ))
9+
private_key: (( grab meta.github.private_key ))
10+
tag_regex: '^v[0-9\.]*$'
11+
disable_ci_skip: true
12+

ci/pipeline/resources/git-main.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
resources:
2+
- name: git-main
3+
type: git
4+
check_every: 60m
5+
webhook_token: ((webhook.token))
6+
source:
7+
uri: (( grab meta.github.uri ))
8+
branch: (( grab meta.github.main-branch ))
9+
private_key: (( grab meta.github.private_key ))
10+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
resources:
2+
- name: github-prerelease
3+
type: github-release
4+
source:
5+
user: (( grab meta.github.owner ))
6+
repository: (( grab meta.github.repo ))
7+
access_token: (( grab meta.github.access_token ))
8+
pre_release: true
9+
release: false
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
resources:
2+
- name: release-notes
3+
type: git
4+
check_every: 1h
5+
source:
6+
uri: (( grab meta.github.release_notes.uri ))
7+
branch: (( grab meta.github.release_notes.branch ))
8+
private_key: (( grab meta.github.release_notes.private_key || meta.github.private_key ))
9+
paths: [ (( grab meta.github.release_notes.file )) ]
10+
disable_ci_skip: true

0 commit comments

Comments
 (0)