[CI] more permission fixes for gitlab-ci

parent f85213fd
Pipeline #7797 failed with stages
in 38 minutes and 15 seconds
...@@ -40,6 +40,8 @@ stack: ...@@ -40,6 +40,8 @@ stack:
paths: paths:
- .stack-root/ - .stack-root/
- .stack-work/ - .stack-work/
before_script:
- sudo chown -R test /builds/gargantext
script: script:
- echo "Building the project from '$CI_PROJECT_DIR'" - echo "Building the project from '$CI_PROJECT_DIR'"
- git config --global --add safe.directory $XDG_CACHE_HOME/nix/tarball-cache - git config --global --add safe.directory $XDG_CACHE_HOME/nix/tarball-cache
...@@ -56,6 +58,8 @@ bench: ...@@ -56,6 +58,8 @@ bench:
- dist-newstyle/ - dist-newstyle/
- .cabal/ - .cabal/
policy: pull-push policy: pull-push
before_script:
- sudo chown -R test /builds/gargantext
script: script:
- nix-shell --run "./bin/update-project-dependencies $STORE_DIR && cabal --store-dir=$STORE_DIR v2-bench --flags +no-phylo-debug-logs --ghc-options='-O2 -fclear-plugins'" - nix-shell --run "./bin/update-project-dependencies $STORE_DIR && cabal --store-dir=$STORE_DIR v2-bench --flags +no-phylo-debug-logs --ghc-options='-O2 -fclear-plugins'"
allow_failure: true allow_failure: true
...@@ -64,17 +68,8 @@ test: ...@@ -64,17 +68,8 @@ test:
stage: test stage: test
# The tests needs to run as the 'test' user, because they leverage the # The tests needs to run as the 'test' user, because they leverage the
# initdb utility from postgres that cannot be run by 'root'. # initdb utility from postgres that cannot be run by 'root'.
# before_script: before_script:
# - echo "Creating test user..." - sudo chown -R test /builds/gargantext
# - mkdir -p /home/test
# - mkdir -p /root/.config
# - useradd -U test
# - chown -R test:test dist-newstyle/
# - chown -R test:test /root/
# - chown -R test:test $STORE_DIR
# - chown -R test:test ${CABAL_DIR}
# - mkdir -p "$XDG_CACHE_HOME/nix"
# - chown -R test:test "$XDG_CACHE_HOME/nix"
cache: cache:
key: cabal.project key: cabal.project
...@@ -94,14 +89,8 @@ test: ...@@ -94,14 +89,8 @@ test:
echo "Found test nix path at ${TEST_NIX_PATH}" echo "Found test nix path at ${TEST_NIX_PATH}"
nix-shell --run "./bin/update-project-dependencies $STORE_DIR" nix-shell --run "./bin/update-project-dependencies $STORE_DIR"
mkdir -p /root/.cache/cabal/logs mkdir -p /root/.cache/cabal/logs
chown -R test:test /root/.cache/cabal/logs/ #chown -R test:test /root/.cache/cabal/logs/
chown -R test:test "$TEST_TMPDIR" #chown -R test:test "$TEST_TMPDIR"
# Fix
# opening lock file '/nix/var/nix/db/big-lock': Permission denied
# when starting CoreNLP
# chmod -R 777 /nix
# chmod 666 /nix/var/nix/db/big-lock
nix-shell --run "chown -R test:test /root/.config/ && su -m test -c \"export PATH=$PATH:$TEST_NIX_PATH && export TMPDIR=$TEST_TMPDIR && cd /builds/gargantext/haskell-gargantext; $CABAL --store-dir=$STORE_DIR v2-test --test-show-details=streaming --verbose=2 --flags 'test-crypto no-phylo-debug-logs' --ghc-options='-O0 -fclear-plugins'\"" nix-shell --run "chown -R test:test /root/.config/ && su -m test -c \"export PATH=$PATH:$TEST_NIX_PATH && export TMPDIR=$TEST_TMPDIR && cd /builds/gargantext/haskell-gargantext; $CABAL --store-dir=$STORE_DIR v2-test --test-show-details=streaming --verbose=2 --flags 'test-crypto no-phylo-debug-logs' --ghc-options='-O0 -fclear-plugins'\""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment