Compare commits

...

3 commits

Author SHA1 Message Date
fc80df1ce7 fix: pass docker_username, docker_password to publish stage
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-09-22 08:18:22 +02:00
84d4b50404 feat: don't require build-args for the labels, just write the directly via --label 2023-09-22 08:17:49 +02:00
af0c32c7ba fix: Repaired woodpecker pipeline
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Reviewed-on: #1
2023-09-21 22:44:06 +02:00
3 changed files with 25 additions and 18 deletions

View file

@ -2,21 +2,36 @@
#
# SPDX-License-Identifier: AGPL-3.0-or-later
---
variables:
- &repo 'git.schmidl.dev/schtobia/buildimage'
steps:
docker-build:
image: woodpeckerci/plugin-docker-buildx
group: build
settings:
repo: git.schmidl.dev/${CI-REPO_OWNER}/buildimage
repo: *repo
registry: git.schmidl.dev
dry_run: true
output: type=oci,dest=${CI_REPO_OWNER}-buildimage.tar
when:
branch:
exclude: [ master ]
event: push
publish-next-agent:
image: woodpeckerci/plugin-docker-buildx
group: publish
secrets: [docker_username, docker_password]
settings:
repo: git.schmidl.dev/${CI-REPO_OWNER}/buildimage
repo: *repo
registry: git.schmidl.dev
dockerfile: dockerfile
platforms: linux/amd64,linux/arm64/v8
when:
branch: ${CI_REPO_DEFAULT_BRANCH}
event: push
username:
from_secret: docker_username
password:
from_secret: docker_password
#when:
# branch: master
# event: push
...

View file

@ -5,10 +5,11 @@
DOCKER := docker
BUILDER := ${DOCKER} buildx
TAG := git.schmidl.dev/schtobia/buildimage
URL:= https://${TAG}
VERSION = $(shell git describe --tags --always --dirty)
build: dockerfile
@${BUILDER} build --build-arg=GIT_COMMIT=$(shell git describe --always) --build-arg=VERSION=${VERSION} --build-arg=TIMESTAMP="$(shell date -u -Iseconds)" -t ${TAG} -t ${TAG}:${VERSION} .
@${BUILDER} build --label org.opencontainers.image.revision=$(shell git describe --always) --label org.opencontainers.image.version=${VERSION} --label org.opencontainers.image.created="$(shell date -u -Iseconds)" --label org.opencontainers.image.source=https://${TAG}.git --label org.opencontainers.image.url=https://${TAG} -t ${TAG} -t ${TAG}:${VERSION} .
.PHONY: publish
publish: build

View file

@ -5,19 +5,14 @@
FROM debian:bullseye-slim
ARG DEBIAN_FRONTEND=noninteractive
ARG GIT_COMMIT
ARG VERSION
ARG TIMESTAMP
LABEL org.opencontainers.image.licenses="AGPL-3.0-or-later" \
org.opencontainers.image.base.name="docker.io/debian:bullseye-slim" \
org.opencontainers.image.title=buildimage \
org.opencontainers.image.source="https://git.schmidl.dev/schtobia/buildimage" \
org.opencontainers.image.url="https://git.schmidl.dev/schtobia/buildimage"
org.opencontainers.image.title=buildimage
# editorconfig-checker-disable
RUN apt update \
&& apt install --assume-yes --no-install-recommends \
&& apt install --assume-yes --no-install-recommends --quiet \
build-essential \
dpkg-sig \
git \
@ -30,7 +25,3 @@ RUN useradd -rm builder
USER builder
WORKDIR /workdir
LABEL org.opencontainers.image.revision=${GIT_COMMIT}
LABEL org.opencontainers.image.version=${VERSION}
LABEL org.opencontainers.image.created=${TIMESTAMP}