forked from minishift/minishift-b2d-iso
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcentos_ci.sh
59 lines (47 loc) · 1.48 KB
/
centos_ci.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
56
57
58
59
#!/bin/bash
# Output command before executing
set -x
# Exit on error
set -e
# Source environment variables of the jenkins slave
# that might interest this worker.
if [ -e "jenkins-env" ]; then
cat jenkins-env \
| grep -E "(JENKINS_URL|GIT_BRANCH|GIT_COMMIT|BUILD_NUMBER|ghprbSourceBranch|ghprbActualCommit|BUILD_URL|ghprbPullId)=" \
| sed 's/^/export /g' \
> ~/.jenkins-env
source ~/.jenkins-env
fi
# We need to disable selinux for now, XXX
/usr/sbin/setenforce 0
# Get all the deps in
yum -y install \
make \
git \
epel-release \
curl
# Install Docker (https://docs.docker.com/engine/installation/linux/centos/#install-with-yum)
sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF
yum -y install docker-engine
systemctl enable docker.service
systemctl start docker
# Install Libvirt
yum -y install kvm qemu-kvm libvirt
systemctl start libvirtd
# Install Avocado
curl https://repos-avocadoproject.rhcloud.com/static/avocado-el.repo -o /etc/yum.repos.d/avocado.repo
yum install -y avocado
# Install KVM driver
curl -L https://github.com/dhiltgen/docker-machine-kvm/releases/download/v0.7.0/docker-machine-driver-kvm > /usr/local/bin/docker-machine-driver-kvm && \
chmod +x /usr/local/bin/docker-machine-driver-kvm
# Prepare ISO for testing
make iso
# Let's test with showing log enabled
SHOW_LOG=--show-job-log make test