-
Notifications
You must be signed in to change notification settings - Fork 13
/
.build.yml
84 lines (73 loc) · 2.38 KB
/
.build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
image: archlinux
packages:
- go
- podman
- buildah
- passt
- aardvark-dns
sources:
- https://git.sr.ht/~mariusor/brutalinks
secrets:
- 32610757-76e9-4671-adf1-98163ca8b594
- 3f30fd61-e33d-4198-aafb-0ff341e9db1c
- 3dcea276-38d6-4a7e-85e5-20cbc903e1ea
tasks:
- build: |
test ${BUILD_SUBMITTER} != "git.sr.ht" && complete-build
set +x
cd brutalinks
make all
- tests: |
test ${BUILD_SUBMITTER} != "git.sr.ht" && complete-build
set -a
source ~/.env.test
cd brutalinks
make test
- coverage: |
test ${BUILD_SUBMITTER} != "git.sr.ht" && complete-build
set -a +x
cd brutalinks && make coverage
- push_to_github: |
test ${BUILD_SUBMITTER} != "git.sr.ht" && complete-build
set -a +x
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
cd brutalinks
git remote add hub [email protected]:mariusor/go-littr
git push hub --force --all
- image: |
test ${BUILD_SUBMITTER} != "git.sr.ht" && complete-build
set -a +x
source ~/.buildah.env
_user=$(id -un)
echo 'unqualified-search-registries = ["docker.io"]' | sudo tee /etc/containers/registries.conf.d/unq-search.conf
echo "${_user}:10000:65536" | sudo tee /etc/subuid
echo "${_user}:10000:65536" | sudo tee /etc/subgid
podman system migrate
podman login -u="${BUILDAH_USER}" -p="${BUILDAH_SECRET}" quay.io
cd brutalinks || exit
_sha=$(git rev-parse --short HEAD)
_branch=$(git branch --points-at=${_sha} | tail -n1 | tr -d '* ')
_version=$(printf "%s-%s" "${_branch}" "${_sha}")
make -C images cert builder
make -C images ENV=dev VERSION="${_version}" push
if [ "${_branch}" = "master" ]; then
make -C images ENV=qa VERSION="${_version}" push
fi
_tag=$(git describe --long --tags || true)
if [ -n "${_tag}" ]; then
make -C images ENV=prod VERSION="${_tag}" push
fi
- integration: |
test ${BUILD_SUBMITTER} != "git.sr.ht" && complete-build
set -a +x
source ~/.env.test
set +a -xe
cd brutalinks
make IMAGE=quay.io/go-ap/brutalinks:qa \
AUTH_IMAGE=quay.io/go-ap/auth:qa \
FEDBOX_IMAGE=quay.io/go-ap/fedbox:qa-fs \
integration
_status=$?
if [ $_status != 0 ]; then
podman logs -tn --tail=100 tests_brutalinks tests_fedbox tests_auth && exit $_status
fi