2016-09-15 21:33:05 +05:30
|
|
|
#!/bin/sh
|
|
|
|
|
2016-09-18 20:24:51 +05:30
|
|
|
export SOURCE_TREE=${PWD}
|
|
|
|
|
2016-09-15 21:33:05 +05:30
|
|
|
if [ -z "$ADTTMP" ]; then
|
|
|
|
ADTTMP=$(mktemp -d)
|
|
|
|
cleanup() {
|
|
|
|
rm -rf "$ADTTMP"
|
|
|
|
}
|
|
|
|
trap cleanup INT TERM EXIT
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd $ADTTMP
|
|
|
|
|
|
|
|
exec 2>&1
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
cd /usr/share/gitlab
|
2016-09-17 15:33:46 +05:30
|
|
|
su gitlab -c 'truncate -s 0 Gemfile.lock'
|
2016-09-15 21:33:05 +05:30
|
|
|
|
2017-03-17 22:27:14 +05:30
|
|
|
. /etc/gitlab/gitlab-debian.conf
|
2017-03-17 22:52:59 +05:30
|
|
|
export RAILS_ENV=test
|
|
|
|
export DB=postgres
|
2016-09-18 19:06:28 +05:30
|
|
|
export INCLUDE_TEST_DEPENDS="true"
|
2020-02-23 18:05:03 +05:30
|
|
|
|
2016-09-18 19:41:30 +05:30
|
|
|
su gitlab -c "bundle install --local"
|
2016-11-30 14:38:34 +05:30
|
|
|
su gitlab -c "mkdir -p tmp/tests/gitlab-shell"
|
|
|
|
export dbname=gitlab_test
|
2020-11-22 16:07:35 +05:30
|
|
|
export gitlab_user=gitlab
|
2016-11-30 14:38:34 +05:30
|
|
|
su postgres -c "createdb $dbname"
|
|
|
|
# enable the pg_trgm extension
|
|
|
|
su postgres -c "psql -d $dbname -c \"CREATE EXTENSION IF NOT EXISTS pg_trgm;\"" || {
|
|
|
|
exit 1
|
|
|
|
}
|
2020-11-22 16:07:35 +05:30
|
|
|
# enable the btree_gist extension
|
|
|
|
su postgres -c "psql -d $dbname -c \"CREATE EXTENSION IF NOT EXISTS btree_gist;\"" || {
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
# Allow gitlab user required permissions
|
|
|
|
su postgres -c "psql -c \"GRANT ALL on schema public TO ${gitlab_user};\""
|
|
|
|
su postgres -c "psql -c \"GRANT ALL on database ${dbname} TO ${gitlab_user};\""
|
|
|
|
# gitlab user need to create files here
|
|
|
|
chown -R ${gitlab_user}: /usr/share/gitlab/db
|
2016-11-30 14:38:34 +05:30
|
|
|
su gitlab -c "bundle exec rake db:migrate"
|
2016-09-18 20:24:51 +05:30
|
|
|
su gitlab -c "bundle exec rake -f ${SOURCE_TREE}/debian/tests/spec.rake"
|
2016-09-16 00:02:48 +05:30
|
|
|
#config 2/2 failed, controllers many failed
|