-
Notifications
You must be signed in to change notification settings - Fork 16
/
gate-ceph-matrix
53 lines (44 loc) · 1.27 KB
/
gate-ceph-matrix
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
#!/bin/bash
# Environment Variables available at build time, store them.
if [[ "$STAGE" == "BUILD" ]]; then
cat > $WORKSPACE/vars <<EOF
export INSTANCE_IMAGE="$INSTANCE_IMAGE"
export BUILD_NUMBER="$BUILD_NUMBER"
EOF
fi
# Recall environment variables sotred earlier
if [[ "$STAGE" == "POSTBUILD" ]]; then
source vars
fi
# tags defaults to all
tags=${TAGS:-all}
# Split INSTANCE_IMAGE into distro name and image uuid
IFS=_ read distro image<<<"$INSTANCE_IMAGE"
# Set build ID
buildid="${BUILD_NUMBER}-$distro"
#Defaults - work for ubuntu on performance flavors.
flavor="performance1-4"
disk="/dev/xvde1"
# Override for centos on standard flavors.
# (For some reason CentOS is not working on performance at the moment).
if [[ "$distro" =~ "centos" ]]; then
#flavor="5"
disk="/osds/0"
fi
# Activate python virtualenv that has ansible, pyrax and rackspace-novaclient
# installed.
pushd ~/ansible-openstack-ceph-gate
source venv/bin/activate
pushd ansible-openstack-ceph-bootstrap
export PYTHONUNBUFFERED=1
ansible-playbook bootstrap.yml\
-e network=jenkins\
-e network_prefix=192.168.150\
-e keypair=jenkins\
-e image="$image"\
-e flavor="$flavor"\
-e disk="$disk"\
-e buildid="$buildid"\
-i inventory-jenkins\
--private-key=id_rsa\
--tags="$tags"