forked from opencollab/llvm-jenkins.debian.net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate-refresh-image.sh
executable file
·55 lines (48 loc) · 2.16 KB
/
create-refresh-image.sh
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
#!/bin/bash
ARCHS="amd64 i386"
DEBIAN_DISTRO="stretch buster bullseye unstable"
UBUNTU_DISTRO="bionic focal groovy hirsute impish"
EXPORT_PATH="/home/jenkins/"
GIT_BASE_URL=https://github.com/llvm/llvm-project
GIT_TOOLCHAIN_CHECK=https://github.com/opencollab/llvm-toolchain-integration-test-suite.git
if test -d $EXPORT_PATH/llvm-project; then
echo "Updating repo in $EXPORT_PATH/llvm-project"
# Update it
git pull
else
# Download it
echo "Cloning the repo in $EXPORT_PATH/llvm-project"
git clone $GIT_BASE_URL $EXPORT_PATH/llvm-project
fi
if test -d $EXPORT_PATH/llvm-toolchain-integration-test-suite; then
echo "Updating repo in $EXPORT_PATH/llvm-toolchain-integration-test-suite"
# Update it
git pull
else
echo "Clone llvm-toolchain-integration-test-suite into $EXPORT_PATH/llvm-toolchain-integration-test-suite"
git clone $GIT_TOOLCHAIN_CHECK $EXPORT_PATH/llvm-toolchain-integration-test-suite
fi
cat > /tmp/configfile <<EOF
COMPONENTS="main universe"
EOF
for d in $DEBIAN_DISTRO; do
for a in $ARCHS; do
echo $a
echo $d
if test -d /var/cache/pbuilder/base-$d-$a.cow; then
sudo DIST=$d ARCH=$a cowbuilder --update --basepath /var/cache/pbuilder/base-$d-$a.cow
else
sudo DIST=$d ARCH=$a cowbuilder --create --basepath /var/cache/pbuilder/base-$d-$a.cow --distribution $d --debootstrap debootstrap --mirror http://cloudfront.debian.net//debian/ --architecture $a --debootstrapopts --arch --debootstrapopts $a --debootstrapopts --variant=buildd --hookdir /usr/share/jenkins-debian-glue/pbuilder-hookdir/
fi
done
done
for d in $UBUNTU_DISTRO; do
echo $d
a=amd64
if test -d /var/cache/pbuilder/base-$d-$a.cow; then
sudo DIST=$d ARCH=$a cowbuilder --update --basepath /var/cache/pbuilder/base-$d-$a.cow
else
sudo DIST=$d ARCH=$a cowbuilder --create --basepath /var/cache/pbuilder/base-$d-$a.cow --distribution $d --debootstrap debootstrap --architecture $a --debootstrapopts --arch --debootstrapopts $a --debootstrapopts --variant=buildd --configfile=/tmp/configfile --hookdir /usr/share/jenkins-debian-glue/pbuilder-hookdir/
fi
done
rm -f /tmp/configfile