Files
tobiasd a143ca5873
continuous-integration/drone/push Build is passing
bump docker version
sign drone.yml
2026-06-12 19:54:02 +02:00

151 lines
5.0 KiB
YAML

---
kind: pipeline
type: docker
name: default
clone:
depth: 150
steps:
- name: pre-commit
image: docker:29
environment:
# Environment variables necessary for rootless Docker
XDG_RUNTIME_DIR: "/run/user/1001"
DOCKER_HOST: "unix:///run/user/1001/docker.sock"
volumes:
# Mounting Docker socket of rootless docker user
- name: dockersock
path: /run/user/1001/docker.sock
commands:
- export FSFE_WEBSITE_HOST_SOURCE_CODE=$(docker container inspect "$HOSTNAME" --format '{{ range .Mounts }}{{ if eq .Destination "/drone/src" }}{{ .Source }}{{ end }}{{ end }}')
- echo "DRONE_COMMIT_BRANCH ${DRONE_COMMIT_BRANCH}"
- echo "DRONE_COMMIT_REF ${DRONE_COMMIT_REF}"
- export COMPOSE_PROJECT_NAME="$(echo "fsfe-website-pre-commit-${DRONE_COMMIT_REF}" | tr "/" "-")"
- docker compose down
- docker compose run --remove-orphans --build pre-commit "origin/${DRONE_COMMIT_BRANCH}"
- docker compose down
# Test building the deploy docker image
- name: test-build-docker-image
image: docker:29
environment:
# Environment variables necessary for rootless Docker
XDG_RUNTIME_DIR: "/run/user/1001"
DOCKER_HOST: "unix:///run/user/1001/docker.sock"
volumes:
# Mounting Docker socket of rootless docker user
- name: dockersock
path: /run/user/1001/docker.sock
commands:
- docker compose build build
when:
event:
- pull_request
- name: push-to-docs
image: git.fsfe.org/fsfe-system-hackers/docs-centralizer:latest
environment:
REPO_OWNER: FSFE
REPO_NAME: fsfe-website
SSH_PRIVATE_KEY:
from_secret: docs_bot_private_key
when:
branch:
- master
event:
- push
- tag
- deployment
- name: deploy-master
image: docker:29
environment:
# Environment variables necessary for rootless Docker
XDG_RUNTIME_DIR: "/run/user/1001"
DOCKER_HOST: "unix:///run/user/1001/docker.sock"
# Target use ipv4 proxies for noddack and gahn, as ipv6 broken.
TARGETS: "www@proxy.noris.fsfeurope.org:fsfe.org/global/?10322 www@proxy.plutex.fsfeurope.org:fsfe.org/global/?10322"
FSFE_WEBSITE_KEY_PRIVATE:
from_secret: KEY_PRIVATE
FSFE_WEBSITE_KEY_PASSWORD:
from_secret: KEY_PASSWORD
FSFE_WEBSITE_GIT_TOKEN:
from_secret: BUILD_TOKEN
COMPOSE_PROJECT_NAME: fsfe-website-master
volumes:
# Mounting Docker socket of rootless docker user
- name: dockersock
path: /run/user/1001/docker.sock
commands:
- export FSFE_WEBSITE_HOST_SOURCE_CODE=$(docker container inspect "$HOSTNAME" --format '{{ range .Mounts }}{{ if eq .Destination "/drone/src" }}{{ .Source }}{{ end }}{{ end }}')
- docker compose down
# If we are in a cron job, then do a full rebuild
# Ideally the cron would set the flag itself, but drone does not support that.
- if [ "$DRONE_BUILD_EVENT" = "cron" ]; then EXTRA_FLAGS="--full --clean-cache"; fi
- docker compose run --remove-orphans --build build --targets $TARGETS $EXTRA_FLAGS
- docker compose down
when:
branch:
- master
event:
exclude:
- pull_request
- name: deploy-test
image: docker:29
environment:
# Environment variables necessary for rootless Docker
XDG_RUNTIME_DIR: "/run/user/1001"
DOCKER_HOST: "unix:///run/user/1001/docker.sock"
# Target use ipv4 proxies for noddack and gahn, as ipv6 broken.
TARGETS: "www@proxy.noris.fsfeurope.org:test.fsfe.org/global/?10322 www@proxy.plutex.fsfeurope.org:test.fsfe.org/global/?10322"
FSFE_WEBSITE_KEY_PRIVATE:
from_secret: KEY_PRIVATE
FSFE_WEBSITE_KEY_PASSWORD:
from_secret: KEY_PASSWORD
FSFE_WEBSITE_GIT_TOKEN:
from_secret: BUILD_TOKEN
COMPOSE_PROJECT_NAME: fsfe-website-test
volumes:
# Mounting Docker socket of rootless docker user
- name: dockersock
path: /run/user/1001/docker.sock
commands:
- export FSFE_WEBSITE_HOST_SOURCE_CODE=$(docker container inspect "$HOSTNAME" --format '{{ range .Mounts }}{{ if eq .Destination "/drone/src" }}{{ .Source }}{{ end }}{{ end }}')
- docker compose down
# If we are in a cron job, then do a full rebuild
# Ideally the cron would set the flag itself, but drone does not support that.
- if [ "$DRONE_BUILD_EVENT" = "cron" ]; then EXTRA_FLAGS="--full --clean-cache"; fi
- docker compose run --remove-orphans --build build --targets $TARGETS $EXTRA_FLAGS
- docker compose down
when:
branch:
- test
event:
exclude:
- pull_request
trigger:
branch:
- master
- test
event:
- cron
- custom
- pull_request
- push
node:
cont2: noris
volumes:
# Define Docker socket of rootless docker user
- name: dockersock
host:
path: /run/user/1001/docker.sock
---
kind: signature
hmac: 401498225cd0b7d0b3b112f077e2cab1c5f58872f1eec9da14500021c2994628
...