mirror of
https://github.com/thegeeklab/retry.git
synced 2024-11-23 05:50:39 +00:00
add renovate config (#2)
This commit is contained in:
parent
0d7c9d6777
commit
ba90d434d4
126
.drone.star
126
.drone.star
@ -1,126 +0,0 @@
|
||||
def main(ctx):
|
||||
before = testing(ctx)
|
||||
|
||||
stages = []
|
||||
|
||||
after = release(ctx) + notification(ctx)
|
||||
|
||||
for b in before:
|
||||
for s in stages:
|
||||
s["depends_on"].append(b["name"])
|
||||
|
||||
for s in stages:
|
||||
for a in after:
|
||||
a["depends_on"].append(s["name"])
|
||||
|
||||
return before + stages + after
|
||||
|
||||
def testing(ctx):
|
||||
return [{
|
||||
"kind": "pipeline",
|
||||
"type": "docker",
|
||||
"name": "testing",
|
||||
"platform": {
|
||||
"os": "linux",
|
||||
"arch": "amd64",
|
||||
},
|
||||
"steps": [
|
||||
{
|
||||
"name": "lint",
|
||||
"image": "koalaman/shellcheck-alpine:stable",
|
||||
"commands": [
|
||||
"shellcheck ./retry",
|
||||
],
|
||||
},
|
||||
],
|
||||
"trigger": {
|
||||
"ref": [
|
||||
"refs/heads/master",
|
||||
"refs/tags/**",
|
||||
"refs/pull/**",
|
||||
],
|
||||
},
|
||||
}]
|
||||
|
||||
def release(ctx):
|
||||
return [{
|
||||
"kind": "pipeline",
|
||||
"type": "docker",
|
||||
"name": "release",
|
||||
"steps": [
|
||||
{
|
||||
"name": "changelog",
|
||||
"image": "thegeeklab/git-chglog",
|
||||
"commands": [
|
||||
"git fetch -tq",
|
||||
"git-chglog --no-color --no-emoji %s" % (ctx.build.ref.replace("refs/tags/", "") if ctx.build.event == "tag" else "--next-tag unreleased unreleased"),
|
||||
"git-chglog --no-color --no-emoji -o CHANGELOG.md %s" % (ctx.build.ref.replace("refs/tags/", "") if ctx.build.event == "tag" else "--next-tag unreleased unreleased"),
|
||||
]
|
||||
},
|
||||
{
|
||||
"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/", ""),
|
||||
"files": [
|
||||
"retry"
|
||||
],
|
||||
},
|
||||
"when": {
|
||||
"ref": [
|
||||
"refs/tags/**",
|
||||
],
|
||||
},
|
||||
}
|
||||
],
|
||||
"depends_on": [
|
||||
"testing",
|
||||
],
|
||||
"trigger": {
|
||||
"ref": [
|
||||
"refs/heads/master",
|
||||
"refs/tags/**",
|
||||
"refs/pull/**",
|
||||
],
|
||||
},
|
||||
}]
|
||||
|
||||
def notification(ctx):
|
||||
return [{
|
||||
"kind": "pipeline",
|
||||
"type": "docker",
|
||||
"name": "notify",
|
||||
"clone": {
|
||||
"disable": True,
|
||||
},
|
||||
"steps": [
|
||||
{
|
||||
"name": "notify",
|
||||
"image": "plugins/slack",
|
||||
"settings": {
|
||||
"webhook": {
|
||||
"from_secret": "private_rocketchat",
|
||||
},
|
||||
"channel": "builds",
|
||||
},
|
||||
}
|
||||
],
|
||||
"depends_on": [
|
||||
"release",
|
||||
],
|
||||
"trigger": {
|
||||
"ref": [
|
||||
"refs/heads/master",
|
||||
"refs/tags/**",
|
||||
],
|
||||
"status": [
|
||||
"success",
|
||||
"failure",
|
||||
],
|
||||
},
|
||||
}]
|
4
renovate.json
Normal file
4
renovate.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": ["github>thegeeklab/renovate-presets:docker"]
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
@test "retry echo should work" {
|
||||
run ./retry echo u work good
|
||||
run ./retry 'echo "u work good"'
|
||||
|
||||
[ "$output" = "u work good" ]
|
||||
}
|
||||
@ -10,5 +10,5 @@
|
||||
run ./retry -t 1 'echo "y u no work"; false'
|
||||
|
||||
[ "$status" -ne 0 ]
|
||||
[ "$output" = "y u no work" ]
|
||||
[[ "$output" =~ "y u no work" ]]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user