summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-04-10 21:59:53 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-04-11 00:39:19 +0800
commitc78f03ae6ef446e9862e185eba2dc3116b04fdb5 (patch)
treeeb2b556844f4076b2a1b786ff735b71f04187e54
parent76e7d2564d30a72604496acf8cd6fb1228905c0f (diff)
downloadgitlab-ce-c78f03ae6ef446e9862e185eba2dc3116b04fdb5.tar.gz
We cannot use array in yaml variables
-rw-r--r--.gitlab-ci.yml1
-rwxr-xr-xscripts/prepare_build.sh8
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