mirror of
https://github.com/spritsail/alpine.git
synced 2025-06-14 15:11:12 +00:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
80cdda202e
|
|||
fa09f2867c
|
|||
438819be65
|
|||
f848ecae6f
|
|||
d7d15ca14d
|
|||
a216ae99b9
|
|||
7d52c725e4
|
|||
c936978f39
|
|||
42dc788197
|
106
.drone.star
Normal file
106
.drone.star
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
repo = "spritsail/alpine"
|
||||||
|
archs = ["amd64", "arm64"]
|
||||||
|
versions = ["edge", "3.14", "3.15", "3.16"]
|
||||||
|
branches = ["master"]
|
||||||
|
|
||||||
|
def main(ctx):
|
||||||
|
builds = []
|
||||||
|
|
||||||
|
for ver in versions:
|
||||||
|
depends_on = []
|
||||||
|
srctpl = "drone/%s/${DRONE_BUILD_NUMBER}:%s-ARCH" % (ctx.repo.slug, ver)
|
||||||
|
for arch in archs:
|
||||||
|
key = "build-%s-%s" % (ver, arch)
|
||||||
|
tmprepo = "drone/%s/${DRONE_BUILD_NUMBER}:%s-%s" % (ctx.repo.slug, ver, arch)
|
||||||
|
builds.append(step(ver, arch, key, tmprepo))
|
||||||
|
depends_on.append(key)
|
||||||
|
|
||||||
|
if ctx.build.branch in branches:
|
||||||
|
tags = []
|
||||||
|
if ver == versions[-1]:
|
||||||
|
tags.append("latest")
|
||||||
|
builds.append(publish(ver, srctpl, depends_on, tags))
|
||||||
|
|
||||||
|
return builds
|
||||||
|
|
||||||
|
def step(ver, arch, key, tmprepo):
|
||||||
|
vertest = "grep -q '%s' /etc/alpine-release && " % ver if ver != "edge" else ""
|
||||||
|
return {
|
||||||
|
"kind": "pipeline",
|
||||||
|
"name": key,
|
||||||
|
"platform": {
|
||||||
|
"os": "linux",
|
||||||
|
"arch": arch,
|
||||||
|
},
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"name": "build",
|
||||||
|
"image": "spritsail/docker-build",
|
||||||
|
"pull": "always",
|
||||||
|
"settings": {
|
||||||
|
"build_args": [
|
||||||
|
"ALPINE_TAG=%s" % ver,
|
||||||
|
],
|
||||||
|
"repo": tmprepo,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "test",
|
||||||
|
"image": "spritsail/docker-test",
|
||||||
|
"pull": "always",
|
||||||
|
"settings": {
|
||||||
|
"run": vertest + "su-exec nobody apk --version",
|
||||||
|
"repo": tmprepo,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "publish",
|
||||||
|
"image": "spritsail/docker-publish",
|
||||||
|
"pull": "always",
|
||||||
|
"settings": {
|
||||||
|
"from": tmprepo,
|
||||||
|
"repo": tmprepo,
|
||||||
|
"registry": {"from_secret": "registry_url"},
|
||||||
|
"username": {"from_secret": "registry_username"},
|
||||||
|
"password": {"from_secret": "registry_password"},
|
||||||
|
},
|
||||||
|
"when": {
|
||||||
|
"branch": branches,
|
||||||
|
"event": ["push"],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
def publish(ver, srctpl, depends, tags=[]):
|
||||||
|
return {
|
||||||
|
"kind": "pipeline",
|
||||||
|
"name": "publish-%s" % ver,
|
||||||
|
"depends_on": depends,
|
||||||
|
"platform": {
|
||||||
|
"os": "linux",
|
||||||
|
},
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"name": "publish",
|
||||||
|
"image": "spritsail/docker-multiarch-publish",
|
||||||
|
"pull": "always",
|
||||||
|
"settings": {
|
||||||
|
"src_template": srctpl,
|
||||||
|
"src_registry": {"from_secret": "registry_url"},
|
||||||
|
"src_username": {"from_secret": "registry_username"},
|
||||||
|
"src_password": {"from_secret": "registry_password"},
|
||||||
|
"dest_repo": repo,
|
||||||
|
"dest_username": {"from_secret": "docker_username"},
|
||||||
|
"dest_password": {"from_secret": "docker_password"},
|
||||||
|
"tags": [ver] + tags,
|
||||||
|
},
|
||||||
|
"when": {
|
||||||
|
"branch": branches,
|
||||||
|
"event": ["push"],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
# vim: ft=python sw=2
|
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.16
|
||||||
|
|
||||||
FROM alpine:$ALPINE_TAG
|
FROM alpine:$ALPINE_TAG
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ COPY skel/ /
|
|||||||
ADD https://alpine.spritsail.io/spritsail-alpine.rsa.pub /etc/apk/keys
|
ADD https://alpine.spritsail.io/spritsail-alpine.rsa.pub /etc/apk/keys
|
||||||
|
|
||||||
ENV ENV="/etc/profile"
|
ENV ENV="/etc/profile"
|
||||||
RUN sed -i '1ihttp://alpine.spritsail.io/spritsail' /etc/apk/repositories \
|
RUN sed -i '1ihttps://alpine.spritsail.io/spritsail' /etc/apk/repositories \
|
||||||
&& apk --no-cache add \
|
&& apk --no-cache add \
|
||||||
su-exec \
|
su-exec \
|
||||||
tini
|
tini
|
||||||
|
Reference in New Issue
Block a user