From c78f03ae6ef446e9862e185eba2dc3116b04fdb5 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Mon, 10 Apr 2017 21:59:53 +0800 Subject: We cannot use array in yaml variables --- .gitlab-ci.yml | 1 - scripts/prepare_build.sh | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ee590e1d604..d08fbd58fe1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,6 @@ cache: variables: MYSQL_ALLOW_EMPTY_PASSWORD: "1" - GITLAB_DATABASE: $CI_JOB_NAME[1] RAILS_ENV: "test" NODE_ENV: "test" SIMPLECOV: "true" diff --git a/scripts/prepare_build.sh b/scripts/prepare_build.sh index 2b041892eab..48b046116e4 100755 --- a/scripts/prepare_build.sh +++ b/scripts/prepare_build.sh @@ -2,11 +2,15 @@ . scripts/utils.sh +echo $CI_JOB_NAME +job_name=$(echo $CI_JOB_NAME | cut -f2 -d' ') +echo $job_name + export SETUP_DB=${SETUP_DB:-true} -export GITLAB_DATABASE=${GITLAB_DATABASE:-postgresql} +export GITLAB_DATABASE=${GITLAB_DATABASE:-$job_name} export USE_BUNDLE_INSTALL=${USE_BUNDLE_INSTALL:-true} -if [ "$GITLAB_DATABASE" = 'pg' ]; then +if [ "$GITLAB_DATABASE" != 'mysql' ]; then export GITLAB_DATABASE='postgresql' fi -- cgit v1.2.1