blob: 31c925ddeea9700a45c1e00ac54db0ec9de621bd [file] [log] [blame]
Joe Topjian4b6ce842016-07-26 02:15:43 +00001#!/bin/bash
2
3set -e
4
5cd
6sudo apt-get update
7sudo apt-get install -y git make mercurial
8
9sudo wget -O /usr/local/bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
10sudo chmod +x /usr/local/bin/gimme
11gimme 1.6 >> .bashrc
12
13mkdir ~/go
14eval "$(/usr/local/bin/gimme 1.6)"
15echo 'export GOPATH=$HOME/go' >> .bashrc
16export GOPATH=$HOME/go
17source .bashrc
18
19git clone https://git.openstack.org/openstack-dev/devstack -b stable/mitaka
20cd devstack
21cat >local.conf <<EOF
22[[local|localrc]]
23# OpenStack version
24OPENSTACK_VERSION="mitaka"
25
26# devstack password
27DEVSTACK_PASSWORD="password"
28
29# Configure passwords and the Swift Hash
30MYSQL_PASSWORD=\$DEVSTACK_PASSWORD
31RABBIT_PASSWORD=\$DEVSTACK_PASSWORD
32SERVICE_TOKEN=\$DEVSTACK_PASSWORD
33ADMIN_PASSWORD=\$DEVSTACK_PASSWORD
34SERVICE_PASSWORD=\$DEVSTACK_PASSWORD
35SWIFT_HASH=\$DEVSTACK_PASSWORD
36
37# Configure the stable OpenStack branches used by DevStack
38# For stable branches see
39# http://git.openstack.org/cgit/openstack-dev/devstack/refs/
40CINDER_BRANCH=stable/\$OPENSTACK_VERSION
41CEILOMETER_BRANCH=stable/\$OPENSTACK_VERSION
42GLANCE_BRANCH=stable/\$OPENSTACK_VERSION
43HEAT_BRANCH=stable/\$OPENSTACK_VERSION
44HORIZON_BRANCH=stable/\$OPENSTACK_VERSION
45KEYSTONE_BRANCH=stable/\$OPENSTACK_VERSION
46NEUTRON_BRANCH=stable/\$OPENSTACK_VERSION
47NOVA_BRANCH=stable/\$OPENSTACK_VERSION
48SWIFT_BRANCH=stable/\$OPENSTACK_VERSION
49ZAQAR_BRANCH=stable/\$OPENSTACK_VERSION
50
51# Enable Swift
52enable_service s-proxy
53enable_service s-object
54enable_service s-container
55enable_service s-account
56
57# Disable Nova Network and enable Neutron
58disable_service n-net
59enable_service q-svc
60enable_service q-agt
61enable_service q-dhcp
62enable_service q-l3
63enable_service q-meta
64#enable_service q-flavors
65
66# Disable Neutron metering
67disable_service q-metering
68
69# Enable LBaaS V1
70enable_service q-lbaas
71
72# Enable FWaaS
73enable_service q-fwaas
74
75# Enable LBaaS v2
76#enable_plugin neutron-lbaas https://git.openstack.org/openstack/neutron-lbaas stable/\$OPENSTACK_VERSION
77#enable_plugin octavia https://git.openstack.org/openstack/octavia stable/\$OPENSTACK_VERSION
78#enable_service q-lbaasv2
79#enable_service octavia
80#enable_service o-cw
81#enable_service o-hk
82#enable_service o-hm
83#enable_service o-api
84
85# Enable Trove
86enable_plugin trove git://git.openstack.org/openstack/trove.git stable/\$OPENSTACK_VERSION
87enable_service trove,tr-api,tr-tmgr,tr-cond
88
89# Disable Temptest
90disable_service tempest
91
92# Disable Horizon
93disable_service horizon
94
95# Disable Keystone v2
96#ENABLE_IDENTITY_V2=False
97
98# Enable SSL/tls
99#enable_service tls-proxy
100#USE_SSL=True
101
102# Enable Ceilometer
103#enable_service ceilometer-acompute
104#enable_service ceilometer-acentral
105#enable_service ceilometer-anotification
106#enable_service ceilometer-collector
107#enable_service ceilometer-alarm-evaluator
108#enable_service ceilometer-alarm-notifier
109#enable_service ceilometer-api
110
111# Enable Zaqar
112#enable_plugin zaqar https://github.com/openstack/zaqar
113#enable_service zaqar-server
114
115# Automatically download and register a VM image that Heat can launch
116# For more information on Heat and DevStack see
117# http://docs.openstack.org/developer/heat/getting_started/on_devstack.html
118#IMAGE_URLS+=",http://cloud.fedoraproject.org/fedora-20.x86_64.qcow2"
119#IMAGE_URLS+=",https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img"
120
121# Logging
122LOGDAYS=1
123LOGFILE=/opt/stack/logs/stack.sh.log
124LOGDIR=/opt/stack/logs
125EOF
126./stack.sh
127
128# Patch openrc
129#cat >> openrc <<EOF
130#
131# Currently, in order to use openstackclient with Identity API v3,
132# we need to set the domain which the user and project belong to.
133#if [ "$OS_IDENTITY_API_VERSION" = "3" ]; then
134# export OS_USER_DOMAIN_ID=${OS_USER_DOMAIN_ID:-"default"}
135# export OS_PROJECT_DOMAIN_ID=${OS_PROJECT_DOMAIN_ID:-"default"}
136#fi
137#EOF
138
139# Prep the testing environment by creating the required testing resources and environment variables
140source openrc admin
141wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
142glance image-create --name CirrOS --disk-format qcow2 --container-format bare < cirros-0.3.4-x86_64-disk.img
143nova flavor-create m1.tform 99 512 5 1 --ephemeral 10
144_NETWORK_ID=$(nova net-list | grep private | awk -F\| '{print $2}' | tr -d ' ')
145_EXTGW_ID=$(nova net-list | grep public | awk -F\| '{print $2}' | tr -d ' ')
146_IMAGE_ID=$(nova image-list | grep CirrOS | awk -F\| '{print $2}' | tr -d ' ' | head -1)
147echo export OS_IMAGE_NAME="cirros-0.3.4-x86_64-uec" >> openrc
148echo export OS_IMAGE_ID="$_IMAGE_ID" >> openrc
149echo export OS_NETWORK_ID=$_NETWORK_ID >> openrc
150echo export OS_EXTGW_ID=$_EXTGW_ID >> openrc
151echo export OS_POOL_NAME="public" >> openrc
152echo export OS_FLAVOR_ID=99 >> openrc
153source openrc demo