diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4943826317b81a95dee97c8fa6c9c798304691a7..5d78908e73b879e91b05fb862d73750ac3b1d694 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -46,7 +46,7 @@ create-vps: echo "Running python script" # Check if the cached machine still exists in the Greenhost cloud and # it's the same machine. - if python3 << EOF + if python3 << EOF; then import greenhost_cloud machine = greenhost_cloud.get_droplets_by_name("^${HOSTNAME}$")[0] print("Machine status is {}".format(machine['status'])) @@ -54,8 +54,7 @@ create-vps: if machine['status'] != 'running' or \ machine['networks']['v4'][0]['ip_address'] != '${IP_ADDRESS}': exit(1) - EOF; - then + EOF # Delete old machine if it still exists echo "Deleting old machine" python3 -c "import greenhost_cloud; greenhost_cloud.terminate_droplets_by_name(\"^${HOSTNAME}$\")"