diff --git a/.gitignore b/.gitignore index 3e3d850ca7100199bb3f35f92b827f8958d67fda..669afbcd9fdb68a05a12fa1b4487829ae3f7f95f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .envrc.local coverage terraform*.log +/.gitlab-ci-local diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aa6e065a7b8c3c657595382e51a3fcaffcc79605..76698c0b90739f6b6d18a22aae2dc1c70c2fd0f5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -39,7 +39,7 @@ variables: # TODO should/could we roll back the service to the last working revision on test failure? cache_lint: - image: 'europe-north1-docker.pkg.dev/holi-shared/docker-hub-remote/denoland/deno:2.1.10' + image: 'europe-north1-docker.pkg.dev/holi-shared/docker-hub-remote/denoland/deno:2.2.2' stage: 'test' script: - deno cache --allow-import --lock=deno.lock app/deps.ts app/dev_deps.ts diff --git a/Dockerfile b/Dockerfile index ce4671ebb20b1ac4956798caf14a2425d68f4349..a31c7a53abc7751e98c4de1475247dac941e1cc7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM europe-north1-docker.pkg.dev/holi-shared/docker-hub-remote/denoland/deno:2.1.10 +FROM europe-north1-docker.pkg.dev/holi-shared/docker-hub-remote/denoland/deno:2.2.2 # The port that your application listens to. EXPOSE 8089 diff --git a/terraform/common/init.tf b/terraform/common/init.tf index 88295ad844d96904f70d90bf60b4fb3ad06dd1e3..779a675f041aeee8333da6c568e90783e764ab9f 100644 --- a/terraform/common/init.tf +++ b/terraform/common/init.tf @@ -1,4 +1,16 @@ terraform { + # allow the lowest common version across all projects, so that the current CI docker image version suits all projects + required_version = ">= 1.9" + required_providers { + google = { + source = "hashicorp/google" + version = "6.22.0" + } + google-beta = { + source = "hashicorp/google-beta" + version = "6.22.0" + } + } backend "gcs" { bucket = "holi-shared-terraform-state" prefix = "translation-api-common" diff --git a/terraform/environments/init.tf b/terraform/environments/init.tf index 112dd65271f8a790132526fdcae892b90e11081e..e53183383e7f259ff75cd1b05d396a9685ce671b 100644 --- a/terraform/environments/init.tf +++ b/terraform/environments/init.tf @@ -1,4 +1,16 @@ terraform { + # allow the lowest common version across all projects, so that the current CI docker image version suits all projects + required_version = ">= 1.9" + required_providers { + google = { + source = "hashicorp/google" + version = "6.22.0" + } + google-beta = { + source = "hashicorp/google-beta" + version = "6.22.0" + } + } backend "gcs" { bucket = "holi-shared-terraform-state" prefix = "translation-api-environments" diff --git a/terraform/environments/scripts/wait-for-ssl.sh b/terraform/environments/scripts/wait-for-ssl.sh index e130aadf5d8efde49192249d4b826ffd64a61ef6..2a53fa605f62bcdb379948e214c8718565f6cc51 100755 --- a/terraform/environments/scripts/wait-for-ssl.sh +++ b/terraform/environments/scripts/wait-for-ssl.sh @@ -7,7 +7,7 @@ url="$1" # google has a cdn answering on requests. This cdn takes a while to be fully updated. # Therefore, we don't return on first success, but on a number of consecutive successes. -number_of_consecutive_successful_tries_needed=10 +number_of_consecutive_successful_tries_needed=25 number_of_consecutive_successful_tries_achieved=0 [ -z "$url" ] && echo "missing url as first param" && exit 1 @@ -17,10 +17,21 @@ echo -n "Checking if SSL certificate for $url is installed: " # storage for the return value of the curl command retval=0 +# early break on success (no need to wait on existing deployments) +set +e +curl -sSLIm 10 "$url" > /dev/null 2>& 1 +retval=$? +set -e +if [ $retval -eq 0 ]; then + echo "success on first try, not checking further" + exit 0 +fi + + # shellcheck disable=SC2034 for i in {1..2500}; do set +e - out=$(curl -sSLI "$url" 2>&1) + out=$(curl -sSLIm 10 "$url" 2>& 1) retval=$? set -e # shellcheck disable=SC2181 @@ -31,6 +42,7 @@ for i in {1..2500}; do echo "test successful after $i total tries" exit 0 fi + sleep 1 else echo -n "." number_of_consecutive_successful_tries_achieved=0