forked from apptainer/singularity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathci-rpm-build-test
executable file
·35 lines (29 loc) · 929 Bytes
/
ci-rpm-build-test
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
#!/bin/bash -ex
# this script runs as root under docker
OS_TYPE="$1"
OS_VERSION="$2"
# build and install
yum install -y rpm-build make yum-utils gcc binutils util-linux-ng which
yum install -y libseccomp-devel e2fsprogs cryptsetup
yum install -y epel-release
yum install -y golang
# switch to an unprivileged user with sudo privileges
yum install -y sudo
# We need Git existing here prior to the run
yum install -y git
useradd -u 1000 --create-home -s /bin/bash testuser
echo "Defaults:testuser env_keep=DOCKER_HOST" >>/etc/sudoers
echo "testuser ALL=(ALL) NOPASSWD: ALL" >>/etc/sudoers
chown -R testuser .
su testuser -c '
set -x
set -e
./mconfig
sudo yum-builddep -y singularity.spec
make -C builddir rpm
sudo yum install -y $HOME/rpmbuild/RPMS/*/*.rpm
BLD=`echo $HOME/rpmbuild/BUILD/singularity-*`
export GOPATH=$BLD/gopath
PATH=$GOPATH/bin:$PATH
singularity exec library://alpine:3.11.5 /bin/true
'