2021-05-10 12:47:48 +02:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
name: default
|
2021-06-18 09:16:10 +02:00
|
|
|
node:
|
2021-08-12 09:48:37 +02:00
|
|
|
runner: troy
|
2021-05-10 12:47:48 +02:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: tags
|
|
|
|
image: alpine/git
|
|
|
|
commands:
|
|
|
|
- git fetch --tags
|
|
|
|
|
|
|
|
- name: lint
|
2021-08-11 13:10:11 +02:00
|
|
|
image: golangci/golangci-lint:v1.41.1
|
2021-05-10 12:47:48 +02:00
|
|
|
commands:
|
2021-06-16 14:37:07 +02:00
|
|
|
- make install-tools
|
2021-05-10 12:47:48 +02:00
|
|
|
- make lint
|
|
|
|
depends_on:
|
|
|
|
- tags
|
|
|
|
|
|
|
|
- name: test
|
2021-06-01 14:25:37 +02:00
|
|
|
image: golang:1.16
|
2021-06-01 15:18:39 +02:00
|
|
|
commands:
|
|
|
|
- make test
|
|
|
|
depends_on:
|
|
|
|
- tags
|
|
|
|
|
|
|
|
- name: create-image
|
|
|
|
image: docker:latest
|
2021-06-01 14:25:37 +02:00
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run
|
2021-06-01 15:18:39 +02:00
|
|
|
- name: swap
|
|
|
|
path: /SWAP
|
2021-05-10 12:47:48 +02:00
|
|
|
commands:
|
2021-08-05 09:43:35 +02:00
|
|
|
- apk add --no-cache openssh-client curl
|
|
|
|
- mkdir ~/.ssh
|
|
|
|
- curl https://raw.githubusercontent.com/xsteadfastx/docker-qemu-alpine/main/ssh -o ~/.ssh/id_rsa
|
|
|
|
- chmod 600 ~/.ssh/id_rsa
|
2021-06-01 15:18:39 +02:00
|
|
|
- wget -O /usr/local/bin/don https://git.xsfx.dev/attachments/8f8f4dbb-8254-448a-a549-552f8b96cb26
|
|
|
|
- chmod +x /usr/local/bin/don
|
2021-08-05 09:43:35 +02:00
|
|
|
- don -t 15m -r 15s -c "ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 root@qemu-alpine"
|
2021-06-01 15:18:39 +02:00
|
|
|
- cat scripts/rpi-image-test/build.sh | ssh -i ssh -o StrictHostKeyChecking=no root@qemu-alpine
|
|
|
|
- ssh -i ssh -o StrictHostKeyChecking=no root@qemu-alpine poweroff
|
|
|
|
- ls -lah /SWAP
|
2021-05-10 12:47:48 +02:00
|
|
|
depends_on:
|
2021-06-01 15:18:39 +02:00
|
|
|
- test
|
|
|
|
|
2021-06-16 14:13:23 +02:00
|
|
|
- name: prepare-image
|
2021-06-01 15:18:39 +02:00
|
|
|
image: golang:1.16
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run
|
|
|
|
commands:
|
2021-06-16 14:37:07 +02:00
|
|
|
- (cd /tmp; go install -v github.com/goreleaser/goreleaser@v0.169.0)
|
2021-06-01 15:18:39 +02:00
|
|
|
- make test-integration
|
|
|
|
depends_on:
|
|
|
|
- test
|
|
|
|
- create-image
|
2021-05-10 12:47:48 +02:00
|
|
|
|
2021-06-16 14:37:07 +02:00
|
|
|
- name: create-torrent
|
|
|
|
image: golang:1.16-alpine
|
|
|
|
volumes:
|
|
|
|
- name: swap
|
|
|
|
path: /SWAP
|
|
|
|
commands:
|
2021-06-18 13:00:25 +02:00
|
|
|
- apk add zip
|
2021-06-16 14:37:07 +02:00
|
|
|
- (cd /tmp; go get -v github.com/cenkalti/rain@v1.6.4)
|
|
|
|
- cd /SWAP
|
|
|
|
- zip 2021-05-07-raspios-buster-armhf-lite.zip 2021-05-07-raspios-buster-armhf-lite.img
|
|
|
|
- rain torrent create -o schnutibox.torrent -f 2021-05-07-raspios-buster-armhf-lite.zip
|
2021-06-18 13:00:25 +02:00
|
|
|
- ls -lah
|
2021-06-16 14:37:07 +02:00
|
|
|
depends_on:
|
|
|
|
- prepare-image
|
|
|
|
|
2021-05-10 12:47:48 +02:00
|
|
|
- name: build
|
2021-06-01 15:18:39 +02:00
|
|
|
image: goreleaser/goreleaser:v0.169.0
|
2021-05-10 12:47:48 +02:00
|
|
|
commands:
|
|
|
|
- make build
|
|
|
|
depends_on:
|
|
|
|
- test
|
2021-06-16 14:13:23 +02:00
|
|
|
- prepare-image
|
2021-05-10 12:47:48 +02:00
|
|
|
when:
|
|
|
|
event:
|
|
|
|
exclude:
|
|
|
|
- tag
|
|
|
|
|
|
|
|
- name: release
|
2021-06-01 15:18:39 +02:00
|
|
|
image: goreleaser/goreleaser:v0.169.0
|
2021-05-10 13:14:15 +02:00
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run
|
2021-05-10 12:47:48 +02:00
|
|
|
environment:
|
|
|
|
GITHUB_TOKEN:
|
|
|
|
from_secret: github_token
|
2021-05-10 13:14:15 +02:00
|
|
|
DOCKER_USERNAME:
|
|
|
|
from_secret: docker_username
|
|
|
|
DOCKER_PASSWORD:
|
|
|
|
from_secret: github_token
|
|
|
|
DOCKER_REGISTRY: ghcr.io
|
2021-05-10 12:47:48 +02:00
|
|
|
commands:
|
2021-05-10 13:14:15 +02:00
|
|
|
- sleep 5
|
|
|
|
- >
|
|
|
|
echo $DOCKER_PASSWORD |
|
|
|
|
docker login $DOCKER_REGISTRY -u $DOCKER_USERNAME --password-stdin
|
2021-05-10 12:47:48 +02:00
|
|
|
- goreleaser release --rm-dist
|
|
|
|
depends_on:
|
|
|
|
- test
|
2021-06-01 15:18:39 +02:00
|
|
|
- lint
|
2021-05-10 12:47:48 +02:00
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- tag
|
2021-05-10 13:14:15 +02:00
|
|
|
|
|
|
|
services:
|
|
|
|
- name: docker
|
|
|
|
image: docker:dind
|
|
|
|
privileged: true
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run
|
2021-06-01 15:18:39 +02:00
|
|
|
- name: swap
|
|
|
|
path: /SWAP
|
|
|
|
|
|
|
|
- name: qemu-alpine
|
|
|
|
image: ghcr.io/xsteadfastx/qemu-alpine:latest
|
|
|
|
volumes:
|
|
|
|
- name: swap
|
|
|
|
path: /SWAP
|
2021-05-10 13:14:15 +02:00
|
|
|
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
temp: {}
|
2021-06-01 15:18:39 +02:00
|
|
|
|
|
|
|
- name: swap
|
|
|
|
temp: {}
|