clean up
All checks were successful
continuous-integration/drone/pr Build is passing

Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
Christian Richter
2022-05-12 11:31:48 +02:00
parent ca8d7012ba
commit 860fdade61
9 changed files with 27 additions and 181 deletions

View File

@@ -1,36 +1,35 @@
def main(ctx):
return [
stepPR("amd64"),
stepPR("arm64"),
stepMergeMaster("amd64"),
stepMergeMaster("arm64"),
stepPR("amd64", "motsognir"),
stepPR("arm64", "motsognir"),
stepMergeMaster("amd64", "motsognir"),
stepMergeMaster("arm64", "motsognir"),
stepPR("amd64", "webtest"),
stepPR("arm64", "webtest"),
stepMergeMaster("amd64", "webtest"),
stepMergeMaster("arm64", "webtest"),
]
def stepPR(arch):
def stepPR(arch, path):
return {
"kind": "pipeline",
"type": "docker",
"name": "docker-build-%s" % (arch),
"name": "docker-build-%s-%s" % (path, arch),
"platform": {
"os": "linux",
"arch": arch,
},
"steps": [
{
"name": "build-image-%s" % (arch),
"name": "build-image-%s-%s" % (path, arch),
"image": "plugins/docker",
"settings": {
"dockerfile": "motsognir/Dockerfile",
"repo": "dragonchaser/motsognir",
"dockerfile": "%s/Dockerfile" % (path),
"repo": "dragonchaser/%s" % (path),
"dry_run": "true",
"tag": "latest-%s" % (arch),
"username": {
"from_secret": "dockerhub-user"
},
"password": {
"from_secret": "dockerhub-password"
}
}
},
],
@@ -41,22 +40,22 @@ def stepPR(arch):
},
}
def stepMergeMaster(arch):
def stepMergeMaster(arch, path):
return {
"kind": "pipeline",
"type": "docker",
"name": "docker-publish-%s" % (arch),
"name": "docker-publish-%s-%s" % (path, arch),
"platform": {
"os": "linux",
"arch": arch,
},
"steps": [
{
"name": "build-build-and-publish-image-%s" % (arch),
"name": "build-and-publish-image-%s-%s" % (path, arch),
"image": "plugins/docker",
"settings": {
"dockerfile": "motsognir/Dockerfile",
"repo": "dragonchaser/motsognir",
"dockerfile": "%s/Dockerfile" % (path),
"repo": "dragonchaser/%s" % (path),
"dry_run": "false",
"tag": "latest-%s" % (arch),
"username": {

View File

@@ -1,43 +0,0 @@
name: Docker Image CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
env:
DOCKER_REGISTRY: ghcr.io
DOCKER_IMAGE: dragonchaser/motsognir
DOCKER_TARGET_PLATFORM: "linux/arm/v7,linux/arm64,linux/amd64"
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Prepare
if: success()
id: prepare
run: |
echo ::set-output name=docker_platform::${DOCKER_TARGET_PLATFORM}
echo ::set-output name=docker_image::${DOCKER_REGISTRY}/${DOCKER_IMAGE}
#echo ::set-output name=version::${GITHUB_RUN_NUMBER}
echo ::set-output name=version::latest
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Run Buildx
if: success()
run: |
cd motsognir
docker buildx build --platform ${{ steps.prepare.outputs.docker_platform }} --tag ${{ steps.prepare.outputs.docker_image }}:${{steps.prepare.outputs.version }} --file ./Dockerfile.arm32v7 --output type=image,push=true .

View File

@@ -1,42 +0,0 @@
name: Docker Image CI for GHRUNNER
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
env:
DOCKER_REGISTRY: ghcr.io
DOCKER_IMAGE: dragonchaser/ghrunner
DOCKER_TARGET_PLATFORM: "linux/arm64,linux/amd64"
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Prepare
if: success()
id: prepare
run: |
echo ::set-output name=docker_platform::${DOCKER_TARGET_PLATFORM}
echo ::set-output name=docker_image::${DOCKER_REGISTRY}/${DOCKER_IMAGE}
echo ::set-output name=version::latest
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Run Buildx
if: success()
run: |
cd ghrunner
docker buildx build --platform ${{ steps.prepare.outputs.docker_platform }} --tag ${{ steps.prepare.outputs.docker_image }}:${{steps.prepare.outputs.version }} --file ./Dockerfile --output type=image,push=true .

View File

@@ -3,8 +3,7 @@
This repo contains Dockerfiles used for autobuilding on Dockerhub.
No guarantee for completeness or functionality.
|URL|Folder|Description|x86_64|arm32v7|aarch64|
|:--|:-----|:----------|:----:|:-----:|:-----:|
|[dragonchaser/webtest](https://hub.docker.com/r/dragonchaser/webtest)|webtest|A small container running ruby WebRick and serves static content from /web|x|x||
|[dragonchaser/motsognir](https://hub.docker.com/r/dragonchaser/motsognir) |motsognir|A container for the motsognir gopher server|x|x||
|[ghcr.io/dragonchaser/ghrunner](https://github.com/dragonchaser/dockerhub-autobuild/pkgs/container/ghrunner)|ghrunner |A container for running github runners |x| |x|
|URL|Folder|Description|x86_64|aarch64|
|:--|:-----|:----------|:----:|:-----:|
|[dragonchaser/webtest](https://hub.docker.com/r/dragonchaser/webtest)|webtest|A small container running ruby WebRick and serves static content from /web|x||x|
|[dragonchaser/motsognir](https://hub.docker.com/r/dragonchaser/motsognir) |motsognir|A container for the motsognir gopher server|x||x|

View File

@@ -1,16 +0,0 @@
FROM ubuntu:latest
COPY entrypoint.sh /
ENV TZ=Europe/Berlin
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get -y install \
curl \
libdigest-sha-perl \
tzdata \
sudo
RUN useradd -ms /bin/bash runner
RUN usermod -aG sudo runner
WORKDIR /runner
RUN chown runner:runner /runner -Rfv
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -1,21 +0,0 @@
# GHRUNNER
This is a small Dockerfile providing a github runner.
The images can be found `ghcr.io/dragonchaser/ghrunner:latest`.
Supported arches are:
- aarch64
- amd64
## Environment variables
```terminal
| Variable | Values | default |
|------------+----------------------------------------+----------------|
| `TOKEN` | token for runner from github | <unset> |
| `ARCH` | arm64, x64 | x64 |
| `OS` | linux,osx | linux |
| `ORG` | name of the github org | <unset> |
| `REPO` | name of the github repo | <unset> |
| `VERSION` | version of the github runner to user | 2.280.3 |
| `CHECKSUM` | checksum for the github runner version | valid checksum |
```

View File

@@ -1,30 +0,0 @@
#!/bin/bash
ARCH=${ARCH:-x64}
VERSION=${VERSION:-2.280.3}
CHECKSUM=${CHECKSUM:-69dc323312e3c5547ba1e1cc46c127e2ca8ee7d7037e17ee6965ef6dac3c142b}
ORG=${ORG:-dragonchaser}
REPO=${REPO:-dockerhub-autobuild}
OS=${OS:-linux}
if [ -z "${ORG}" ]; then
echo "missing ORG, bailing out!"
fi
if [ -z "${REPO}" ]; then
echo "missing REPO, bailing out!"
fi
if [ -z "${TOKEN}" ]; then
echo "missing TOKEN, bailing out!"
exit 1
fi
FILE="actions-runner-${OS}-${ARCH}-${VERSION}.tar.gz"
curl -o ${FILE} -L https://github.com/actions/runner/releases/download/v${VERSION}/${FILE}
echo "${CHECKSUM} ${FILE}" | shasum -a 256 -c
tar xzf ./${FILE}
./bin/installdependencies.sh
su runner -c "./config.sh --unattended --url https://github.com/${ORG}/${REPO} --token ${TOKEN} --name docker-runner-$(hostname) --labels=${ARCH},${OS},self-hosted"
while true; do
su runner -c "./run.sh"
done

View File

@@ -1,5 +1,5 @@
FROM debian:latest
LABEL maintainer="dragonchaser <motsognir@datenschmutz.space>"
LABEL maintainer="dragonchaser <autobuilds@datenschmutz.space>"
ENV VERSION=1.0.13
ENV TARBALL="motsognir-${VERSION}.tar.xz"
EXPOSE 70

View File

@@ -1,12 +1,12 @@
FROM debian:latest
LABEL maintainer="dragonchaser <crichter@suse.de>"
LABEL maintainer="dragonchaser <autobuilds@datenschmutz.space>"
RUN apt-get update \
&& apt-get install -y ruby \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir /web \
&& chmod 0777 /web
COPY ./entrypoint.sh /bin
COPY ./index.html /web
COPY ./webtest/entrypoint.sh /bin
COPY ./webtest/index.html /web
WORKDIR /web
EXPOSE 80
ENTRYPOINT entrypoint.sh