-
Notifications
You must be signed in to change notification settings - Fork 1
/
spread.yaml
132 lines (117 loc) · 3.53 KB
/
spread.yaml
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
project: snapd-amazon-linux
path: /home/spread
environment:
TESTSLIB: /home/spread/spread/tests/lib
PATH: $PATH:/home/spread/spread/tests/lib/bin
LANG: "C.UTF-8"
LANGUAGE: "en"
BASE_REPO_URL: https://bboozzoo.github.io/snapd-amazon-linux
backends:
google:
key: "$(HOST: echo $SPREAD_GOOGLE_KEY)"
location: snapd-spread/us-east1-b
halt-timeout: 2h
systems:
- amazon-linux-2-64:
workers: 1
storage: preserve-size
- amazon-linux-2023-64:
workers: 1
storage: preserve-size
qemu:
systems:
- amazon-linux-2-64:
username: ec2-user
password: amazon
- amazon-linux-2023-64:
username: ec2-user
password: amazon
path: /home/spread
exclude:
- .git
kill-timeout: 20m
prepare: |
yum install -y yum-utils rpm-build
echo "prepare"
if [ "$SPREAD_REBOOT" = "0" ]; then
case "$SPREAD_SYSTEM" in
amazon-linux-2023-*)
# TODO make this automatic
dnf upgrade --releasever=2023.5.20240903 -y
REBOOT
;;
esac
fi
prepare-each: |
echo "prepare each"
restore: |
echo "restore"
restore-each: |
echo "restore each"
suites:
spread/prebuilt/:
summary: Run tests with prebuilt repo tarball
details: |
Run spread tests with prebuilt repository tarball, typically obtained by
downloading build artifacts form a PR, or when built locally with `tool
createrepo`.
prepare: |
# set up a place to unpack the repo
mkdir -p "$SPREAD_PATH/repo-unpacked"
case "$SPREAD_SYSTEM" in
amazon-linux-2-*)
repo_file=amazon-linux-2-repo.tar.xz
target=amazonlinux:2
;;
amazon-linux-2023-*)
repo_file=amazon-linux-2023-repo.tar.xz
target=amazonlinux:2023
;;
*)
echo "unsupported $SPREAD_SYSTEM system"
exit 1
;;
esac
tar -C "$SPREAD_PATH/repo-unpacked" -xvf "$SPREAD_PATH/$repo_file"
# unpack it, the actual repository is under $TOPDIR/repo
TARGET="$target" "$SPREAD_PATH/tool" repoconf "file://$SPREAD_PATH/repo-unpacked/repo" > "$SPREAD_PATH/spread.repo"
cp -av "$SPREAD_PATH/spread.repo" /etc/yum.repos.d/
# install snapd
yum install -y snapd
systemctl start snapd.socket
# wait for snapd to become ready
snap wait system seed.loaded
restore: |
yum erase -y snapd snap-confine
rm -f /etc/yum.repos.d/spread.repo
rm -rfv "$SPREAD_PATH/repo-unpacked"
spread/prebuilt-repo/:
summary: Run tests with repository packages
details: |
Run tests with repository packages hosted at ${BASE_REPO_URL} (typically
github pages of the repository}.
prepare: |
# set up a place to unpack the repo
case "$SPREAD_SYSTEM" in
amazon-linux-2-*)
repo_suffix=amzn2
;;
amazon-linux-2023-*)
repo_suffix=al2023
;;
*)
echo "unsupported $SPREAD_SYSTEM system"
exit 1
;;
esac
wget -O /etc/yum.repos.d/snapd.repo ${BASE_REPO_URL}/${repo_suffix}/snapd.repo
# install snapd
yum install -y snapd
systemctl start snapd.socket
# wait for snapd to become ready
snap wait system seed.loaded
restore: |
yum erase -y snapd snap-confine
rm -f /etc/yum.repos.d/snapd.repo
spread/build/:
summary: package build