From 49d8396216eade4d2b3b053051de44752901286e Mon Sep 17 00:00:00 2001 From: Varac <varac@varac.net> Date: Wed, 18 Dec 2019 19:07:43 +0100 Subject: [PATCH] Add and include CI debug information template --- .gitlab-ci.yml | 41 +++++++++++++++++----- .gitlab/ci_templates/debug_information.yml | 15 ++++++++ 2 files changed, 48 insertions(+), 8 deletions(-) create mode 100644 .gitlab/ci_templates/debug_information.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3de8a8207..40a76ec34 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ include: - .gitlab/ci_templates/kaniko.yml - .gitlab/ci_templates/ssh_setup.yml + - .gitlab/ci_templates/debug_information.yml stages: - build - create-vps @@ -32,7 +33,9 @@ ci-test-image: - Dockerfile - requirements.txt - .gitlab/ci_templates/kaniko.yml - extends: .kaniko_build + extends: + - .kaniko_build + - .debug_information create-vps: stage: create-vps @@ -54,7 +57,9 @@ create-vps: - flux/**/* - test/**/* - openappstack/**/* - extends: .ssh_setup + extends: + - .ssh_setup + - .debug_information # Cache the cluster secrets so the next job can use it too cache: paths: @@ -87,7 +92,9 @@ setup-openappstack: - flux/**/* - test/**/* - openappstack/**/* - extends: .ssh_setup + extends: + - .ssh_setup + - .debug_information # Cache the cluster secrets so the next job can use them cache: paths: @@ -108,7 +115,9 @@ test-helmreleases: - flux/**/* - test/**/* - openappstack/**/* - extends: .ssh_setup + extends: + - .ssh_setup + - .debug_information testinfra: stage: health-test @@ -122,7 +131,9 @@ testinfra: - flux/**/* - test/**/* - openappstack/**/* - extends: .ssh_setup + extends: + - .ssh_setup + - .debug_information certs: stage: health-test @@ -137,7 +148,9 @@ certs: - flux/**/* - test/**/* - openappstack/**/* - extends: .ssh_setup + extends: + - .ssh_setup + - .debug_information prometheus-alerts: stage: health-test @@ -151,7 +164,9 @@ prometheus-alerts: - ansible/**/* - flux/**/* - test/**/* - extends: .ssh_setup + extends: + - .ssh_setup + - .debug_information behave-nextcloud: stage: integration-test @@ -171,7 +186,9 @@ behave-nextcloud: - flux/**/* - test/**/* - openappstack/**/* - extends: .ssh_setup + extends: + - .ssh_setup + - .debug_information behave-wordpress: stage: integration-test @@ -231,6 +248,8 @@ behave-grafana: - test/**/* - openappstack/**/* extends: .ssh_setup + extends: + - .debug_information terminate-mr-droplet-after-merge: stage: cleanup @@ -252,6 +271,8 @@ terminate-mr-droplet-after-merge: only: refs: - master + extends: + - .debug_information terminate-old-droplets: stage: cleanup @@ -265,6 +286,8 @@ terminate-old-droplets: - flux/**/* - test/**/* - openappstack/**/* + extends: + - .debug_information # We need one job that run every time (without any `only:` limitation). # This works around a Gitlab bug: if no job runs at all due to @@ -274,3 +297,5 @@ gitlab-merge-workaround: stage: cleanup script: - echo "That went well" + extends: + - .debug_information diff --git a/.gitlab/ci_templates/debug_information.yml b/.gitlab/ci_templates/debug_information.yml new file mode 100644 index 000000000..5d96750c5 --- /dev/null +++ b/.gitlab/ci_templates/debug_information.yml @@ -0,0 +1,15 @@ +.debug_information: + before_script: + - | + echo "Env vars:" + echo + echo "HOSTNAME: $HOSTNAME" + echo "SUBDOMAIN: $SUBDOMAIN" + echo "DOMAIN: $DOMAIN" + echo "FQDN: $FQDN" + echo "CLUSTER_DIR: $CLUSTER_DIR" + echo "ANSIBLE_HOST_KEY_CHECKING: $ANSIBLE_HOST_KEY_CHECKING" + echo "KANIKO_BUILD_IMAGENAME: $KANIKO_BUILD_IMAGENAME" + echo "SSH_KEY_ID: $SSH_KEY_ID" + echo + [ -d $CLUSTER_DIR ] && find $CLUSTER_DIR -- GitLab