2
0
mirror of https://github.com/spritsail/alpine.git synced 2024-11-05 09:26:23 +00:00

Replace .drone.yml with Starlark

This commit is contained in:
Joe Groocock 2020-01-08 19:13:53 +00:00
parent 9657e8c188
commit 42dc788197
Signed by: frebib
GPG Key ID: E0B16BEACFBB6A86
2 changed files with 58 additions and 32 deletions

58
.drone.star Normal file
View File

@ -0,0 +1,58 @@
def main(ctx):
return [
step("3.8"),
step("3.9"),
step("3.10",["latest"]),
step("edge"),
]
def step(alpinever,tags=[]):
return {
"kind": "pipeline",
"name": "build-%s" % alpinever,
"steps": [
{
"name": "build",
"image": "spritsail/docker-build",
"pull": "always",
"settings": {
"repo": "alpine-dev-%s" % alpinever,
"build_args": [
"ALPINE_TAG=%s" % alpinever,
],
},
},
{
"name": "test",
"image": "spritsail/docker-test",
"pull": "always",
"settings": {
"repo": "spritsail/alpine",
"run": "su-exec nobody apk --version",
},
},
{
"name": "publish",
"image": "spritsail/docker-publish",
"pull": "always",
"settings": {
"from": "alpine-dev-%s" % alpinever,
"repo": "spritsail/alpine",
"tags": [alpinever] + tags,
},
"environment": {
"DOCKER_USERNAME": {
"from_secret": "docker_username",
},
"DOCKER_PASSWORD": {
"from_secret": "docker_password",
},
},
"when": {
"branch": ["master"],
"event": ["push"],
},
},
]
}

View File

@ -1,32 +0,0 @@
pipeline:
build:
image: spritsail/docker-build
repo: alpine-dev
build_args:
- ALPINE_TAG=${ALPINE_TAG%%,*}
test:
image: spritsail/docker-test
repo: alpine-dev
run: su-exec nobody apk --version
publish:
image: spritsail/docker-publish
when: { branch: [ master ], event: [ push, tag, deployment ] }
secrets: [ docker_username, docker_password ]
from: alpine-dev
repo: 'spritsail/alpine'
tags: ${ALPINE_TAG}
notify:
image: spritsail/notify
when: { status: [ success, failure ] }
secrets: [ webhook_url, notify_token ]
tag: ${ALPINE_TAG%%,*}
matrix:
ALPINE_TAG:
- 3.8
- 3.9
- 3.10,latest
- edge