Skip to content
Snippets Groups Projects
Commit 7a64ed6a authored by Christian Boettcher's avatar Christian Boettcher
Browse files
parents 318deab9 77d95fb3
No related branches found
No related tags found
No related merge requests found
Pipeline #94995 passed
...@@ -113,8 +113,10 @@ full-deploy-testing: ...@@ -113,8 +113,10 @@ full-deploy-testing:
script: script:
- echo "Starting the full testing deployment." - echo "Starting the full testing deployment."
- pip install python-openstackclient - pip install python-openstackclient
- OLD_ID=`openstack server show $TESTING_NAME -f value -c id` - OLD_ID=`openstack server show $TESTING_NAME -f value -c id` && server_exists=true || echo "No testing server found. It might be a first time deployment"
- openstack server set --name $OLD_TEST_NAME $OLD_ID - if [ "$server_exists" = true ] ; then
openstack server set --name $OLD_TEST_NAME $OLD_ID;
fi
# TODO get and locally store zip of old certificate-docker-volume # TODO get and locally store zip of old certificate-docker-volume
- INSTANCE_ID=`openstack server create -f value -c id --prefix IMAGE_ --flavor s1 --image 149a65b5-aeb8-499f-aaa6-ec966bd28dd6 --user-data deploy_scripts/cloudinit.yml --security-group ssh --security-group www --security-group https $TESTING_NAME` - INSTANCE_ID=`openstack server create -f value -c id --prefix IMAGE_ --flavor s1 --image 149a65b5-aeb8-499f-aaa6-ec966bd28dd6 --user-data deploy_scripts/cloudinit.yml --security-group ssh --security-group www --security-group https $TESTING_NAME`
- while [ "`openstack server show $INSTANCE_ID -c addresses -f value`" = "{}" ]; do sleep 5; done # wait until an address is available to attach the floating ip - while [ "`openstack server show $INSTANCE_ID -c addresses -f value`" = "{}" ]; do sleep 5; done # wait until an address is available to attach the floating ip
...@@ -144,11 +146,13 @@ cleanup-failed-full-deployment: ...@@ -144,11 +146,13 @@ cleanup-failed-full-deployment:
- OLD_PROD_ID=`openstack server show $OLD_PROD_NAME -f value -c id` && rollback_prod=true || echo "No old production server found." - OLD_PROD_ID=`openstack server show $OLD_PROD_NAME -f value -c id` && rollback_prod=true || echo "No old production server found."
# if applicable: rollback test server # if applicable: rollback test server
- if [ "$rollback_test" = true ] ; then - if [ "$rollback_test" = true ] ; then
REMOVE_ID=`openstack server show $TESTING_NAME -f value -c id`; REMOVE_ID=`openstack server show $TESTING_NAME -f value -c id` && new_deployment_exists=true || echo "No new testing server has been created.";
openstack server set --name $TESTING_NAME $OLD_TEST_ID; openstack server set --name $TESTING_NAME $OLD_TEST_ID;
openstack server add floating ip $OLD_TEST_ID $TESTING_IP; openstack server add floating ip $OLD_TEST_ID $TESTING_IP;
if [ "$new_deployment_exists" = true ] ; then
openstack server delete $REMOVE_ID && echo "Deleted faulty testing server."; openstack server delete $REMOVE_ID && echo "Deleted faulty testing server.";
fi fi
fi
# if applicable, rollback prod server # if applicable, rollback prod server
- if [ "$rollback_prod" = true ] ; then - if [ "$rollback_prod" = true ] ; then
REMOVE_ID=`openstack server show $PRODUCTION_NAME -f value -c id` || echo "No new production server found."; REMOVE_ID=`openstack server show $PRODUCTION_NAME -f value -c id` || echo "No new production server found.";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment