aboutsummaryrefslogtreecommitdiff
path: root/ci-deploy
diff options
context:
space:
mode:
authorClark Laughlin <clark.laughlin@linaro.org>2015-02-25 20:26:43 +0000
committerClark Laughlin <clark.laughlin@linaro.org>2015-02-25 20:26:43 +0000
commitcb6ef35ec20791f6eacd1c142841e97066aeae46 (patch)
treee1b4b5023d788bb1da9c561738f0ae09f95dd787 /ci-deploy
parentc3114789890a0a7364be7b1cafd899921fc91cce (diff)
reorg
Diffstat (limited to 'ci-deploy')
-rwxr-xr-xci-deploy/1-add-machines.sh9
-rwxr-xr-xci-deploy/2-setup-ext-testing-master.sh70
2 files changed, 79 insertions, 0 deletions
diff --git a/ci-deploy/1-add-machines.sh b/ci-deploy/1-add-machines.sh
new file mode 100755
index 0000000..8c61e9b
--- /dev/null
+++ b/ci-deploy/1-add-machines.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+echo "Creating machines for CI master / log server"
+
+echo "Adding higher-performance machine for CI master:"
+juju add-machine --constraints "tags=scott1,precise" --series precise
+echo "Adding lower-performance machine for log server:"
+#juju add-machine --constraints "tags=borman,precise" --series precise
+
diff --git a/ci-deploy/2-setup-ext-testing-master.sh b/ci-deploy/2-setup-ext-testing-master.sh
new file mode 100755
index 0000000..5fcd155
--- /dev/null
+++ b/ci-deploy/2-setup-ext-testing-master.sh
@@ -0,0 +1,70 @@
+#!/bin/bash
+set -x
+
+if [ "$#" -ne 1 ]
+then
+ echo "You must pass in the juju machine id (i.e. 16) of a pre-added machine"
+ echo "running precise that will be used to deploy the CI controller services."
+ echo ""
+ exit 1
+fi
+
+machine=${1}
+install_script_url=https://raw.github.com/rasselin/os-ext-testing/master/puppet/install_master.sh
+config_repo=https://clarktlaugh@bitbucket.org/clarktlaugh/linaro-openstack-ci-data.git
+scp_plugin_url=http://people.linaro.org/~clark.laughlin/openstack-jenkins-ci/scp-plugin-1.9.hpi
+keystone_ip=`juju status keystone/0 | grep public-address | awk '{ print $2 }'`
+echo "keystone is at [${keystone_ip}]"
+
+# install some necessary dependencies
+juju ssh ${machine} "sudo apt-get -y install wget openssl ca-certificates ssl-cert"
+
+# clone the data repo locally to handle all authentication here, then package up and copy to the
+# target machine
+git clone ${config_repo} __data
+# replace the keystone_ip placeholder
+sed --in-place=-orig -e 's/##KEYSTONEIP##/'${keystone_ip}'/' __data/etc/nodepool/nodepool.yaml.erb
+tar cfz __data.tgz __data
+juju scp __data.tgz ${machine}:~
+rm -rf __data
+rm __data.tgz
+
+# expand the data on the target machine, then retrieve the installation script and launch it
+juju ssh ${machine} "tar xf __data.tgz ; mv __data os-ext-testing-data ; wget ${install_script_url}"
+juju ssh ${machine} "bash ./install_master.sh | tee install.log"
+
+# install scp plugin and restart jenkins
+
+juju ssh ${machine} "sleep 60 ; wget http://localhost:8080/jnlpJars/jenkins-cli.jar"
+juju ssh ${machine} "java -jar jenkins-cli.jar -s http://localhost:8080/ install-plugin ${scp_plugin_url} ; sleep 10"
+juju ssh ${machine} "sudo service jenkins restart ; sleep 60"
+
+# load jenkins jobs
+juju ssh ${machine} "sudo jenkins-jobs --flush-cache --delete-old update /etc/jenkins_jobs/config ; sleep 30"
+
+# start zuul
+juju ssh ${machine} "sudo service zuul start ; sudo service zuul-merger start"
+
+#
+# update Jenkins configuration, then restart zuul
+#
+
+# copy over pre-created config files
+juju ssh ${machine} "mkdir ~/jenkins"
+for f in ./jenkins/*
+do
+ juju scp $f ${machine}:~/jenkins
+done
+juju ssh ${machine} "sudo cp ~/jenkins/* /var/lib/jenkins/."
+#force jenkins config reload
+juju ssh ${machine} "java -jar jenkins-cli.jar -s http://localhost:8080/ reload-configuration ; sleep 10"
+# restart zuul
+juju ssh ${machine} "sudo service zuul restart"
+
+#
+# re-run master install script
+#
+
+juju ssh ${machine} "bash ./install_master.sh"
+
+