forked from spritsail/alpine
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
6d1a483ead | |||
67d0500768 | |||
2a2b9c265d | |||
754ef911d5 |
83
.drone.star
Normal file
83
.drone.star
Normal file
@ -0,0 +1,83 @@
|
||||
def main(ctx):
|
||||
versions = [
|
||||
["3.9",[]],
|
||||
["3.10",[]],
|
||||
["3.11", ["latest"]],
|
||||
["edge", []],
|
||||
["chrislane", ["😍"]],
|
||||
]
|
||||
return [step(v[0], v[1]) for v in versions] + [notify(["build-%s" % v for v, _ in versions])]
|
||||
|
||||
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"],
|
||||
},
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
def notify(versions):
|
||||
return {
|
||||
"kind": "pipeline",
|
||||
"name": "notify",
|
||||
"depends_on": versions,
|
||||
"when": {
|
||||
"status": [ "success", "failure" ],
|
||||
},
|
||||
"steps": [
|
||||
{
|
||||
"name": "notify",
|
||||
"image": "spritsail/notify",
|
||||
"environment": {
|
||||
"WEBHOOK_URL": {
|
||||
"from_secret": "webhook_url",
|
||||
},
|
||||
"NOTIFY_TOKEN": {
|
||||
"from_secret": "notify_token",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
32
.drone.yml
32
.drone.yml
@ -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
|
@ -1,4 +1,4 @@
|
||||
ARG ALPINE_TAG=3.10
|
||||
ARG ALPINE_TAG=3.11
|
||||
|
||||
FROM alpine:$ALPINE_TAG
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user