From 6f51df3d7535e457637074a9a0b0d8af79404143 Mon Sep 17 00:00:00 2001 From: ddavison Date: Fri, 13 Dec 2019 12:07:01 -0800 Subject: [PATCH] Move test functions into test before_script --- .gitlab-ci.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 96a15a0..a438741 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -41,6 +41,15 @@ build: - kubectl config set-context k3s --cluster=k3s --user=default - kubectl config use-context k3s - kubectl version + - | + function expected_error() { + echo "Expected error but exited with $?, failing build!" + exit 1 + } + + function failed_as_expected() { + echo "Failed as expected and exited with $?" + } test-shellcheck: stage: test @@ -251,17 +260,6 @@ release-tag: only: - tags -before_script: - - | - function expected_error() { - echo "Expected error but exited with $?, failing build!" - exit 1 - } - - function failed_as_expected() { - echo "Failed as expected and exited with $?" - } - publish: extends: .semantic-release only: -- GitLab