90 lines
2.7 KiB
YAML
90 lines
2.7 KiB
YAML
---
|
|
version: 2.1
|
|
|
|
jobs:
|
|
test-setup:
|
|
parameters:
|
|
image:
|
|
type: string
|
|
# alpine has no supported installer, so setup can only *verify*
|
|
# dependencies there; unresolved ones are expected, not a failure
|
|
strict:
|
|
type: string
|
|
default: '--strict'
|
|
docker:
|
|
- image: << parameters.image >>
|
|
steps:
|
|
- run:
|
|
name: install test prerequisites
|
|
command: |
|
|
if command -v pacman >/dev/null 2>&1
|
|
then pacman -Syu --noconfirm --needed git zsh sudo openssh tar gzip
|
|
elif command -v dnf >/dev/null 2>&1
|
|
then dnf install -y git zsh sudo openssh-clients tar gzip
|
|
elif command -v apt-get >/dev/null 2>&1
|
|
then apt-get update && apt-get install -y git zsh sudo openssh-client ca-certificates tar gzip
|
|
elif command -v apk >/dev/null 2>&1
|
|
then apk add --no-cache git zsh sudo openssh-client shadow tar
|
|
fi
|
|
- checkout
|
|
- run:
|
|
name: run setup as an unprivileged user
|
|
command: |
|
|
useradd -m tester 2>/dev/null || adduser -D tester
|
|
echo 'tester ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/tester
|
|
|
|
TESTER_HOME="$(getent passwd tester | cut -d: -f6)"
|
|
cp -a . "${TESTER_HOME}/.wryn"
|
|
chown -R tester "${TESTER_HOME}/.wryn"
|
|
|
|
# a LOGIN shell, so /etc/profile contributes to PATH exactly as
|
|
# it would in a real session (debian puts /usr/games there)
|
|
su - tester -c "cd ~/.wryn && ./setup/run \
|
|
--only packages \
|
|
--min \
|
|
--ci \
|
|
<< parameters.strict >> \
|
|
--no-logfile \
|
|
"
|
|
|
|
deploy:
|
|
docker:
|
|
- image: docker:git
|
|
steps:
|
|
- checkout
|
|
- setup_remote_docker
|
|
- run: docker build . -t blaziken734/debugger -f .docker/Dockerfile
|
|
- run: echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin
|
|
- run: docker push blaziken734/debugger
|
|
|
|
workflows:
|
|
version: 2
|
|
main:
|
|
jobs:
|
|
- test-setup:
|
|
name: test-arch
|
|
image: archlinux:base-devel
|
|
- test-setup:
|
|
name: test-fedora
|
|
image: fedora:latest
|
|
- test-setup:
|
|
name: test-debian
|
|
image: debian:stable
|
|
- test-setup:
|
|
name: test-alpine
|
|
image: alpine:latest
|
|
strict: ''
|
|
|
|
- deploy:
|
|
requires:
|
|
- test-arch
|
|
- test-fedora
|
|
- test-debian
|
|
- test-alpine
|
|
context:
|
|
- yage-docker
|
|
filters:
|
|
branches:
|
|
only:
|
|
- main
|