Add drone + build motsognir
Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
108
.drone.star
108
.drone.star
@@ -1,36 +1,76 @@
|
|||||||
def main(ctx):
|
def main(ctx):
|
||||||
return [
|
return [
|
||||||
step("amd64"),
|
stepPR("amd64"),
|
||||||
step("arm64"),
|
stepPR("arm64"),
|
||||||
]
|
stepMergeMaster("amd64"),
|
||||||
|
stepMergeMaster("arm64"),
|
||||||
def step(arch):
|
|
||||||
return {
|
|
||||||
"kind": "pipeline",
|
|
||||||
"name": "build-%s" % arch,
|
|
||||||
"steps": [
|
|
||||||
{
|
|
||||||
"name": "build",
|
|
||||||
"image": "plugins/docker",
|
|
||||||
"repo": "dragonchaser/motsognir",
|
|
||||||
"volumes": [
|
|
||||||
{
|
|
||||||
"name":"docker_sock",
|
|
||||||
"path":"/var/run/docker.sock"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"commands": [
|
|
||||||
"cd motsognir",
|
|
||||||
"docker build -t dragonchaser/motsognir:latest ."
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"volumes": [
|
|
||||||
{
|
|
||||||
"name":"docker_sock",
|
|
||||||
"host": {
|
|
||||||
"path": "/var/run/docker.sock"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
|
||||||
|
|
||||||
|
def stepPR(arch):
|
||||||
|
return {
|
||||||
|
"kind": "pipeline",
|
||||||
|
"type": "docker",
|
||||||
|
"name": "docker-build-%s" % (arch),
|
||||||
|
"platform": {
|
||||||
|
"os": "linux",
|
||||||
|
"arch": arch,
|
||||||
|
},
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"name": "build-image-%s" % (arch),
|
||||||
|
"image": "plugins/docker",
|
||||||
|
"settings": {
|
||||||
|
"dockerfile": "motsognir/Dockerfile",
|
||||||
|
"repo": "dragonchaser/motsognir",
|
||||||
|
"dry_run": "true",
|
||||||
|
"tag": "latest-%s" % (arch),
|
||||||
|
"username": {
|
||||||
|
"from_secret": "dockerhub-user"
|
||||||
|
},
|
||||||
|
"password": {
|
||||||
|
"from_secret": "dockerhub-password"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"trigger": {
|
||||||
|
"ref": [
|
||||||
|
"refs/pull/**",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
def stepMergeMaster(arch):
|
||||||
|
return {
|
||||||
|
"kind": "pipeline",
|
||||||
|
"type": "docker",
|
||||||
|
"name": "docker-publish-%s" % (arch),
|
||||||
|
"platform": {
|
||||||
|
"os": "linux",
|
||||||
|
"arch": arch,
|
||||||
|
},
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"name": "build-build-and-publish-image-%s" % (arch),
|
||||||
|
"image": "plugins/docker",
|
||||||
|
"settings": {
|
||||||
|
"dockerfile": "motsognir/Dockerfile",
|
||||||
|
"repo": "dragonchaser/motsognir",
|
||||||
|
"dry_run": "true",
|
||||||
|
"tag": "latest-%s" % (arch),
|
||||||
|
"username": {
|
||||||
|
"from_secret": "dockerhub-user"
|
||||||
|
},
|
||||||
|
"password": {
|
||||||
|
"from_secret": "dockerhub-password"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"trigger": {
|
||||||
|
"ref": [
|
||||||
|
"refs/heads/master",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|||||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.drone.yml
|
||||||
@@ -14,6 +14,6 @@ RUN rm -Rfv /etc/apt/sources.list.*
|
|||||||
RUN rm -Rfv /build
|
RUN rm -Rfv /build
|
||||||
RUN useradd -ms /bin/bash -d /gopher gopher
|
RUN useradd -ms /bin/bash -d /gopher gopher
|
||||||
WORKDIR /gopher
|
WORKDIR /gopher
|
||||||
COPY entrypoint.sh /
|
COPY motsognir/entrypoint.sh /
|
||||||
COPY rsyslog.conf /etc
|
COPY motsognir/rsyslog.conf /etc
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|||||||
Reference in New Issue
Block a user