[DRE-commits] [gitlab] 04/04: use su instead of sudo

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Sat Sep 17 10:52:03 UTC 2016


This is an automated email from the git hooks/post-receive script.

praveen pushed a commit to branch master
in repository gitlab.

commit 62fe446e3653c30e4253c3245e7cb9d7b0571f7c
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Sat Sep 17 15:33:46 2016 +0530

    use su instead of sudo
---
 debian/tests/control | 10 ----------
 debian/tests/setup   | 10 +++++-----
 2 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/debian/tests/control b/debian/tests/control
index 2bc0814..e026e19 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,15 +1,5 @@
-Test-Command: gem2deb-test-runner --autopkgtest 2>&1
-Depends: @, gem2deb-test-runner
-#FIXME: add to Depends ruby-rspec, ruby-test-unit... if needed
-#Restrictions: allow-stderr
-
-#FIXME: replace LIB by the name of the main file of the library
-#Test-Command: ruby -r LIB -e "puts true"
-#Depends: @
-
 Tests: setup
 Depends: @, 
-  sudo,
   ruby-factory-girl-rails, 
   ruby-rspec-rails,
   ruby-rspec-retry,
diff --git a/debian/tests/setup b/debian/tests/setup
index 47edc02..a5d5e23 100755
--- a/debian/tests/setup
+++ b/debian/tests/setup
@@ -14,7 +14,7 @@ exec 2>&1
 set -ex
 
 cd /usr/share/gitlab
-sudo truncate -s 0 Gemfile.lock
+su gitlab -c 'truncate -s 0 Gemfile.lock'
 if ! grep factory_girl_rails Gemfile >/dev/null; then
   cp Gemfile ${ADTTMP}
   cat <<EOF >> ${ADTTMP}/Gemfile
@@ -29,12 +29,12 @@ gem 'email_spec', '~> 1.6'
 gem 'ffaker', '~> 2.0'
 gem 'json-schema', '~> 2.6', '>= 2.6.2'
 EOF
-  sudo cp ${ADTTMP}/Gemfile .
+  su gitlab -c "cp ${ADTTMP}/Gemfile ."
 fi
 
 export $(cat /etc/gitlab/gitlab-debian.conf)
-sudo -u gitlab -E -H bundle install --local
-sudo -u gitlab -E -H bundle exec rspec spec/uploaders spec/routing spec/views \
-spec/factories_spec.rb spec/finders
+su gitlab -c "bundle install --local"
+su gitlab -c "bundle exec rspec spec/uploaders spec/routing spec/views \
+spec/factories_spec.rb spec/finders"
 
 #config 2/2 failed, controllers many failed

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/gitlab.git



More information about the Pkg-ruby-extras-commits mailing list