0
0
mirror of https://github.com/thegeeklab/wp-ansible.git synced 2024-11-21 13:40:39 +00:00

add release step

This commit is contained in:
Robert Kaussow 2021-01-26 13:29:26 +01:00
parent 0656f5ac4a
commit 5bfb3318cb
No known key found for this signature in database
GPG Key ID: 65362AE74AF98B61
2 changed files with 38 additions and 8 deletions

View File

@ -7,7 +7,7 @@ def main(ctx):
linux(ctx, "arm"),
]
after = manifest(ctx) + notification(ctx)
after = manifest(ctx) + release(ctx) + notification(ctx)
for b in before:
for s in stages:
@ -206,6 +206,35 @@ def manifest(ctx):
},
}]
def release(ctx):
return [{
"kind": "pipeline",
"type": "docker",
"name": "release",
"steps": [
{
"name": "release",
"image": "plugins/github-release",
"settings": {
"api_key": {
"from_secret": "github_token",
},
"note": "CHANGELOG.md",
"overwrite": True,
"title": ctx.build.ref.replace("refs/tags/", ""),
},
}
],
"depends_on": [
"manifest",
],
"trigger": {
"ref": [
"refs/tags/**",
],
},
}]
def notification(ctx):
return [{
"kind": "pipeline",
@ -216,18 +245,18 @@ def notification(ctx):
},
"steps": [
{
'name': 'notify',
'image': 'plugins/slack',
'settings': {
'webhook': {
'from_secret': 'private_rocketchat',
"name": "notify",
"image": "plugins/slack",
"settings": {
"webhook": {
"from_secret": "private_rocketchat",
},
'channel': 'builds',
"channel": "builds",
},
}
],
"depends_on": [
"manifest",
"release",
],
"trigger": {
"ref": [

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ release/
coverage.out
drone-ansible
.drone.yml