summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-11-21 12:18:34 +0000
committerRémy Coutable <remy@rymai.me>2016-11-21 12:18:34 +0000
commit5018bdcd0ab45df924956125f9d11f66847f8164 (patch)
treed5b02e388f41940186c52a25d1f017065ef294b1
parent220c258c68c8f2e4f0315153c443c036c3ace90c (diff)
parentc3adf40fd1f12053737f3f3e30643e974ff2ef44 (diff)
downloadgitlab-ce-5018bdcd0ab45df924956125f9d11f66847f8164.tar.gz
Merge branch 'make-prepare-build-sh-compat' into 'master'
Remove bashism from scripts/prepare_build.sh Make `scripts/prepare_build.sh` an sh, rather than bash, script Write once, run everywhere. Even alpine. See merge request !7561
-rwxr-xr-xscripts/prepare_build.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/prepare_build.sh b/scripts/prepare_build.sh
index 1eaafdce389..6e3f76b8399 100755
--- a/scripts/prepare_build.sh
+++ b/scripts/prepare_build.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
retry() {
if eval "$@"; then
@@ -24,11 +24,12 @@ if [ -f /.dockerenv ] || [ -f ./dockerinit ]; then
cp config/resque.yml.example config/resque.yml
sed -i 's/localhost/redis/g' config/resque.yml
- export FLAGS=(--path vendor --retry 3 --quiet)
+ export FLAGS="--path vendor --retry 3 --quiet"
else
- export PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin
+ rnd=$(awk 'BEGIN { srand() ; printf("%d\n",rand()*5) }')
+ export PATH="$HOME/bin:/usr/local/bin:/usr/bin:/bin"
cp config/database.yml.mysql config/database.yml
sed "s/username\:.*$/username\: runner/" -i config/database.yml
sed "s/password\:.*$/password\: 'password'/" -i config/database.yml
- sed "s/gitlabhq_test/gitlabhq_test_$((RANDOM/5000))/" -i config/database.yml
+ sed "s/gitlabhq_test/gitlabhq_test_$rnd/" -i config/database.yml
fi