-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathjenkins-dell-crowbar-admin-iso
More file actions
executable file
·92 lines (70 loc) · 2.92 KB
/
jenkins-dell-crowbar-admin-iso
File metadata and controls
executable file
·92 lines (70 loc) · 2.92 KB
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
#!/bin/bash
#
# $1 = test repo number
#
# force a local default so this can be run on command line
DISTRELEASE=${DISTRELEASE-ubuntu-natty}
MILESTONE=${MILESTONE-d5}
[ -e $(dirname $0)/jenkins-deb-common ] || exit 1
. $(dirname $0)/jenkins-deb-common
jenkins_init
jenkins_set_vars
echo ${NOVA_RELEASE}
function err_cleanup_chefsolo() {
# $1 - name
if [ "${NOCLEAN-0}" == "1" ]; then
exit 0
fi
sudo virsh destroy ${1}
sleep 5
sudo lvremove -f ${LVM_ROOT}/${1}
exit 1
}
kvm_instance_name=${BINARY_BUILD_RELEASE}-crowbar-admin-iso
# this sets IP as a side-effect
get_ip $kvm_instance_name
iso_name=rcb-${NOVA_RELEASE}-${MILESTONE}-${BINARY_BUILD_RELEASE}
if [ -e "crowbar-${iso_name}.iso" ]; then
echo "Cleaning ISO(s) from previous build"
rm -rf crowbar-${iso_name}.iso
fi
MEMORY=1024000
maybe_make_kvm_instance $kvm_instance_name
start_kvm_instance $kvm_instance_name ${IP} http://192.168.1.1/packages/${NOVA_RELEASE}-${MILESTONE} ${BINARY_BUILD_RELEASE} ${NOVA_RELEASE}-${MILESTONE}
trap "err_cleanup_chefsolo ${kvm_instance_name}" SIGINT SIGTERM EXIT ERR
ssh root@${IP} "DEBIAN_FRONTEND=noninteractive apt-get install build-essential ruby-dev git debootstrap mkisofs ruby curl binutils -y --force-yes"
ssh root@${IP} "modprobe loop"
ssh root@${IP} "cd /opt && git clone https://github.com/dellcloudedge/crowbar.git"
## prestage the ubuntu-10.10-server-amd64.iso
# ISO_PATH=${JENKINS_HOME}/userContent/build-crowbar/ubuntu-10.10-server-amd64.iso
# ssh root@${IP} "mkdir -p /root/.crowbar-build-cache/iso"
# if ! ( scp ${ISO_PATH} root@${IP}:/root/.crowbar-build-cache/iso ); then
# echo "Ubuntu-10.10 ISO Copy Failed"
# exit 1
#fi
# copy over the sledgehammer image
SLEDGEHAMMER_PATH=${JENKINS_HOME}/userContent/build-crowbar/sledgehammer-tftpboot.tar.gz
ssh root@${IP} "mkdir -p /opt/crowbar-sledgehammer/bin"
if ! ( scp ${SLEDGEHAMMER_PATH} root@${IP}:/opt/crowbar-sledgehammer/bin ); then
echo "Sledgehammer Copy Failed"
exit 1
fi
ssh root@${IP} "cd /opt/crowbar && git checkout openstack-os-build"
ssh root@${IP} "cd /opt/crowbar && git submodule init"
ssh root@${IP} "cd /opt/crowbar && git submodule update"
# Adding in non merged pull-reqs
ssh root@${IP} "cd /opt/crowbar/barclamps/mysql && git remote add upstream https://github.com/galstrom21/barclamp-mysql.git && git pull upstream master"
if ! ( ssh root@${IP} "cd /opt/crowbar && DEBIAN_FRONTEND=noninteractive VERSION='${iso_name}' ./build_crowbar.sh ubuntu-11.04" ); then
echo "Error in tests"
exit 1
fi
#if ! ( ssh root@${IP} "cd /opt/crowbar && DEBIAN_FRONTEND=noninteractive VERSION='${iso_name}' ./build_crowbar.sh ubuntu-10.10" ); then
# echo "Error in tests"
# exit 1
#fi
scp root@${IP}:/opt/crowbar/crowbar-${iso_name}.iso .
# scp crowbar-${iso_name}.iso openstack@${ISODEST}:~/incoming/crowbar.iso
trap - SIGINT SIGTERM EXIT ERR
sudo virsh destroy ${kvm_instance_name}
sleep 5
sudo lvremove -f ${LVM_ROOT}/${kvm_instance_name}