diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 41f08589a6d303ba3eb7e450ff3a3ebd244300be..4e584ae9f46b786f75bca2a69c3cb4e6c72f27b0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -52,7 +52,7 @@ bootstrap: - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null - ANSIBLE_HOST_KEY_CHECKING=False python3 -u ./ci-bootstrap.py --create_droplet # Wait for proper LE cert to get served - - timeout -t 1200 sh -c 'while ! curl --cacert ./letsencrypt_staging_bundle.pem -s https://auth.ci-${CI_JOB_ID}.ci.openappstack.net/auth/ > /dev/null; do date; echo "Waiting for LE cert..."; sleep 5; done' + - timeout -t 1200 sh -c 'while ! curl --cacert ./letsencrypt_staging_bundle.pem -s https://auth.ci-${CI_PIPELINE_IID}.ci.openappstack.net/auth/ > /dev/null; do date; echo "Waiting for LE cert..."; sleep 5; done' cache: key: "$CI_PIPELINE_ID" paths: @@ -105,4 +105,4 @@ terminate: script: # Remove droplet after successful tests - cd test/ - - python3 -c "import cosmos; cosmos.terminate_droplets_by_name(\"^ci-${CI_JOB_ID}\$\")" + - python3 -c "import cosmos; cosmos.terminate_droplets_by_name(\"^ci-${CI_PIPELINE_IID}\$\")" diff --git a/test/ci-bootstrap.py b/test/ci-bootstrap.py index f58099421449a0a2ee318f4542bc597312573ea5..bc05a2cea5938a9882b24fb2d39ae53a6eff0c9e 100755 --- a/test/ci-bootstrap.py +++ b/test/ci-bootstrap.py @@ -116,11 +116,11 @@ if __name__ == "__main__": # - 411: ci, ed25519 # - 407: varac - if "CI_JOB_ID" in os.environ: - instance_id = os.environ['CI_JOB_ID'] + if "CI_PIPELINE_IID" in os.environ: + instance_id = os.environ['CI_PIPELINE_IID'] else: # Use random generated ID in case we're not running in gitlab CI - # and there's no CI_JOB_ID env var + # and there's no CI_PIPELINE_IID env var instance_id = ''.join( random.choice(string.ascii_lowercase + string.digits) for _ in range(10))