feat(ci): add Drone config
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is passing

This commit is contained in:
Peter 2023-02-18 11:34:27 +01:00
parent c9f4584250
commit 47662e9786
Signed by: prskr
GPG key ID: C1DB5D2E8DB512F9
3 changed files with 57 additions and 5 deletions

51
.drone.yml Normal file
View file

@ -0,0 +1,51 @@
---
kind: pipeline
type: docker
name: default
steps:
- name: ko
image: gcr.io/kaniko-project/executor:debug
network_mode: host
commands:
- >
echo "{\"auths\": {\"https://code.icb4dc0.de\": {\"auth\" : \"$(printf '%s:%s' $$GITEA_USER $$GITEA_TOKEN | base64)\" }}}" > /kaniko/.docker/config.json
- /kaniko/executor --destination "$${IMAGE_REPO}:$${IMAGE_TAG}" --context "$${BUILD_CONTEXT}"
environment:
GITEA_USER: prskr
GITEA_TOKEN:
from_secret: gitea_token
IMAGE_REPO: code.icb4dc0.de/prskr/ci-images/ko
IMAGE_TAG: latest
BUILD_CONTEXT: ko/
- name: dind-go
image: gcr.io/kaniko-project/executor:debug
network_mode: host
commands:
- >
echo "{\"auths\": {\"https://code.icb4dc0.de\": {\"auth\" : \"$(printf '%s:%s' $$GITEA_USER $$GITEA_TOKEN | base64)\" }}}" > /kaniko/.docker/config.json
- /kaniko/executor --destination "$${IMAGE_REPO}:$${IMAGE_TAG}" --context "$${BUILD_CONTEXT}"
environment:
GITEA_USER: prskr
GITEA_TOKEN:
from_secret: gitea_token
IMAGE_REPO: code.icb4dc0.de/prskr/ci-images/dind-go
IMAGE_TAG: latest
BUILD_CONTEXT: dind-go/
- name: caddy
image: gcr.io/kaniko-project/executor:debug
network_mode: host
commands:
- >
echo "{\"auths\": {\"https://code.icb4dc0.de\": {\"auth\" : \"$(printf '%s:%s' $$GITEA_USER $$GITEA_TOKEN | base64)\" }}}" > /kaniko/.docker/config.json
- /kaniko/executor --destination "$${IMAGE_REPO}:$${IMAGE_TAG}" --context "$${BUILD_CONTEXT}"
environment:
GITEA_USER: prskr
GITEA_TOKEN:
from_secret: gitea_token
IMAGE_REPO: code.icb4dc0.de/prskr/ci-images/caddy
IMAGE_TAG: latest
BUILD_CONTEXT: caddy/

View file

@ -0,0 +1,4 @@
deb https://mirror.hetzner.com/debian/packages bullseye main contrib non-free
deb https://mirror.hetzner.com/debian/packages bullseye-updates main contrib non-free
deb https://mirror.hetzner.com/debian/security bullseye-security main contrib non-free
deb https://mirror.hetzner.com/debian/packages bullseye-backports main contrib non-free

View file

@ -1,9 +1,6 @@
FROM docker.io/golang:1.20-bullseye as downloader
FROM docker.io/alpine:latest as downloader
RUN apt-get update && \
apt-get install -y \
curl \
jq && \
RUN apk add -U --no-cache curl jq && \
export KO_VERSION=$(curl https://api.github.com/repos/ko-build/ko/releases | jq -r '. | first |.tag_name | capture("(?<version>[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+)") | .version') && \
curl -L "https://github.com/ko-build/ko/releases/download/v${KO_VERSION}/ko_${KO_VERSION}_Linux_x86_64.tar.gz" | tar xvz -C /tmp