-
Notifications
You must be signed in to change notification settings - Fork 1
/
.cirrus.yml
71 lines (56 loc) · 2.02 KB
/
.cirrus.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
build_packages_task:
only_if: ${CIRRUS_TAG} == ''
timeout_in: 120m
compute_engine_instance:
platform: linux
cpu: 4
memory: 8G
image_project: cirrus-images
matrix:
- name: 'Linux x86_64'
image: family/docker-builder
- name: 'Linux aarch64'
image: family/docker-builder-arm64
architecture: arm64
clone_script: |
git clone https://github.com/adonis0147/devel-env
cd devel-env
git fetch --all --tags
if [[ -z "${CIRRUS_PR}" ]]; then
git checkout "${CIRRUS_BRANCH}"
else
git fetch origin "pull/${CIRRUS_PR}/head:pr_${CIRRUS_PR}"
git checkout "pr_${CIRRUS_PR}"
fi
git status
prepare_script: |
uname -a
cd devel-env
while read -r tag; do
url="https://github.com/adonis0147/devel-env/releases/download/${tag}/install_toolchain_$(uname -m).sh"
if curl --silent --head --fail -L "${url}" -o /dev/null; then
break
fi
done < <(git tag --sort=creatordate | tac)
echo "Download the toolchain from ${url}"
curl -L "${url}" -o devel/scripts/install_toolchain.sh
chmod a+x devel/scripts/install_toolchain.sh
devel/downloads/download_packages.sh
# Don't install llvm
sed -i '/function install_packages/,/^}/ s/llvm//' devel/scripts/install.sh
script: |
if [[ "$(uname -m)" == 'x86_64' ]]; then
cmd="sed -i -e 's|mirrorlist=|#mirrorlist=|' -e 's|#baseurl=http://mirror.centos.org/centos/\$releasever|baseurl=https://vault.centos.org/7.9.2009|' /etc/yum.repos.d/CentOS-Base.repo"
else
cmd="sed -i -e 's|mirrorlist=|#mirrorlist=|' -e 's|#baseurl=http://mirror.centos.org/altarch|baseurl=https://vault.centos.org/altarch|' /etc/yum.repos.d/CentOS-Base.repo"
fi
cat >>Dockerfile <<EOF
FROM centos:7
RUN ${cmd}
RUN mkdir /devel-env
WORKDIR /devel-env
CMD ["/bin/bash"]
EOF
docker build -t packages .
docker run --rm --mount=type=bind,source="$(pwd)/devel-env",target=/devel-env packages \
bash -c 'cd devel/scripts; bash install.sh'