diff options
author | David Blaisonneau <david.blaisonneau@orange.com> | 2015-12-11 16:55:40 +0100 |
---|---|---|
committer | Fatih Degirmenci <fatih.degirmenci@ericsson.com> | 2015-12-14 13:02:55 +0000 |
commit | 785ce4c9930e67b5ddcd19bb7ce3a30188f510fa (patch) | |
tree | 759dad0a3b7bfc863094afdd1e55195b29376deb | |
parent | 3322005f4964eb905201cdccaf9ae5ce5c78755d (diff) |
New worker for Orange Pod2
Change-Id: I09b3d06b2b2b615b3fbae5e422820356b465d895
Signed-off-by: David Blaisonneau <david.blaisonneau@orange.com>
-rw-r--r-- | jjb/joid/joid-deploy.sh | 103 | ||||
-rw-r--r-- | jjb/joid/joid.yml | 17 |
2 files changed, 119 insertions, 1 deletions
diff --git a/jjb/joid/joid-deploy.sh b/jjb/joid/joid-deploy.sh new file mode 100644 index 000000000..d9ce86eb4 --- /dev/null +++ b/jjb/joid/joid-deploy.sh @@ -0,0 +1,103 @@ +#!/bin/bash +set +e +set -o nounset + +####### Temporary - to be done with jenkins params ##### +JOID_MODE=ha +JOID_RELEASE=liberty +JOID_LOCAL_CONFIG_FOLDER=~/joid_config +JOID_SDN_CONTROLLER=odl +################# + +## +## Load local config or defaults +## + +if [ -e "$JOID_LOCAL_CONFIG_FOLDER/config.sh" ]; then + echo "------ Load local config ------" + source $JOID_LOCAL_CONFIG_FOLDER/config.sh +else + echo "------ No local config, load default ------" + case $NODE_NAME in + orange-fr-pod2) + POD=orange-pod2 ;; + *) + POD=$NODE_NAME ;; + esac + export POD_DC=$(echo $POD |cut -d\- -f1) + export POD_NUM=$(echo $POD |cut -d\- -f2) + export POD_NAME=$POD_DC$POD_NUM + export MAAS_REINSTALL=true + export MAAS_USER=ubuntu + export MAAS_PASSWORD=ubuntu + export OS_ADMIN_PASSWORD=openstack + export CEPH_DISKS=/srv + export CEPH_REFORMAT=no + export JOID_ADMIN_OPENRC=$WORKSPACE/admin_openrc.sh +fi + +## +## Redeploy MAAS or recover the previous config +## + +cd $WORKSPACE/ci +if [ -e "$JOID_LOCAL_CONFIG_FOLDER/environments.yaml" ] && [ "$MAAS_REINSTALL" == "false" ]; then + echo "------ Recover Juju environment to use MAAS ------" + cp $JOID_LOCAL_CONFIG_FOLDER/environments.yaml . +else + MAASCONFIG=$WORKSPACE/ci/maas/$POD_DC/$POD_NUM/deployment.yaml + echo "------ Set MAAS password ------" + sed -i -- 's/user: ubuntu/user: $MAAS_USER/' $MAASCONFIG + sed -i -- 's/password: ubuntu/password: $MAAS_PASSWORD/' $MAASCONFIG + echo "------ Redeploy MAAS ------" + ./02-maasdeploy.sh $POD_NAME +fi + +## +## Configure Joid deployment +## + +# Get juju deployer file +if [ "$JOID_MODE" == 'nonha' ]; then + SRCBUNDLE=$WORKSPACE/ci/$JOID_SDN_CONTROLLER/juju-deployer/ovs-$JOID_SDN_CONTROLLER.yaml +else + SRCBUNDLE=$WORKSPACE/ci/$JOID_SDN_CONTROLLER/juju-deployer/ovs-$JOID_SDN_CONTROLLER-$JOID_MODE.yaml +fi + +# Modify files + +echo "------ Set openstack password ------" +sed -i -- "s/\"admin-password\": openstack/\"admin-password\": $OS_ADMIN_PASSWORD/" $SRCBUNDLE + +echo "------ Set ceph disks ------" +sed -i -- "s@osd-devices: /srv@osd-devices: $CEPH_DISKS@" $SRCBUNDLE +sed -i -r -- "s/^(\s+osd-reformat: )'no'/\1'$CEPH_REFORMAT'/" $SRCBUNDLE + +## +## Configure Joid deployment +## + +echo "------ Deploy with juju ------" +echo "Execute: ./deploy.sh -t $JOID_MODE -o $JOID_RELEASE -s $JOID_SDN_CONTROLLER -l $POD_NAME" + +./deploy.sh -t $JOID_MODE -o $JOID_RELEASE -s $JOID_SDN_CONTROLLER -l $POD_NAME + +## +## Set Admin RC +## + +echo "------ Create OpenRC file ------" +KEYSTONE=$(cat bundle.yaml |shyaml get-value openstack-phase2.services.keystone.options.vip) + +cat << EOF > $JOID_ADMIN_OPENRC +export OS_USERNAME=admin +export OS_PASSWORD=$OS_ADMIN_PASSWORD +export OS_TENANT_NAME=admin +export OS_AUTH_URL=http://$KEYSTONE:5000/v2.0 +export OS_REGION_NAME=Canonical +EOF + +if [ -d "$JOID_LOCAL_CONFIG_FOLDER" ]; then + echo "------ Backup Juju environment ------" + cp environments.yaml $JOID_LOCAL_CONFIG_FOLDER/ +fi diff --git a/jjb/joid/joid.yml b/jjb/joid/joid.yml index 70842dad5..fdeddc680 100644 --- a/jjb/joid/joid.yml +++ b/jjb/joid/joid.yml @@ -9,7 +9,9 @@ controller: 'odl' - pod: 'intel-pod5' + pod: + - 'intel-pod5' + - 'orange-pod2' stream: - master: @@ -100,3 +102,16 @@ cd $WORKSPACE/ci echo "Executing deploy.sh -o liberty -s $CONTROLLER -t ha -l intelpod5" ./deploy.sh -o liberty -s $CONTROLLER -t ha -l intelpod5 +- builder: + name: orange-pod2-builder + builders: + - shell: | + #!/bin/bash + echo "Running $INSTALLER_NAME with controller $CONTROLLER" + echo "Please note that this is WIP generic builder" + echo + echo "Executing clean.sh" + cd $WORKSPACE/ci + ./clean.sh + - shell: + !include-raw ./joid-deploy.sh |