Commit 13aff31f authored by Alfredo Di Napoli's avatar Alfredo Di Napoli

feat(ci) consistent STORE_DIR env var and fixes for newer nix

parent 72da34f4
...@@ -5,7 +5,7 @@ image: adinapoli/gargantext:v3.5 ...@@ -5,7 +5,7 @@ image: adinapoli/gargantext:v3.5
variables: variables:
STACK_ROOT: "${CI_PROJECT_DIR}/.stack-root" STACK_ROOT: "${CI_PROJECT_DIR}/.stack-root"
STACK_OPTS: "--system-ghc" STACK_OPTS: "--system-ghc"
CABAL_STORE_DIR: "${CI_PROJECT_DIR}/.cabal" STORE_DIR: "${CI_PROJECT_DIR}/.cabal"
CORENLP: "4.5.4" CORENLP: "4.5.4"
FF_USE_FASTZIP: "true" FF_USE_FASTZIP: "true"
ARTIFACT_COMPRESSION_LEVEL: "fast" ARTIFACT_COMPRESSION_LEVEL: "fast"
...@@ -38,7 +38,7 @@ cabal: ...@@ -38,7 +38,7 @@ cabal:
- .cabal/ - .cabal/
policy: pull-push policy: pull-push
script: script:
- nix-shell --run "./bin/update-project-dependencies $CABAL_STORE_DIR && cabal --store-dir=$CABAL_STORE_DIR v2-build all --flags 'test-crypto no-phylo-debug-logs' --ghc-options='-O0 -fclear-plugins'" - nix-shell --run "./bin/update-project-dependencies $STORE_DIR && cabal --store-dir=$STORE_DIR v2-build all --flags 'test-crypto no-phylo-debug-logs' --ghc-options='-O0 -fclear-plugins'"
allow_failure: false allow_failure: false
bench: bench:
...@@ -51,7 +51,7 @@ bench: ...@@ -51,7 +51,7 @@ bench:
- .cabal/ - .cabal/
policy: pull-push policy: pull-push
script: script:
- nix-shell --run "./bin/update-project-dependencies $CABAL_STORE_DIR && cabal --store-dir=$CABAL_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
test: test:
...@@ -71,13 +71,14 @@ test: ...@@ -71,13 +71,14 @@ test:
useradd -U test useradd -U test
chown -R test:test dist-newstyle/ chown -R test:test dist-newstyle/
chown -R test:test /root/ chown -R test:test /root/
chown -R test:test $CABAL_STORE_DIR chown -R test:test $STORE_DIR
chown -R test:test /root/.cache/nix/
export CABAL=$(nix-shell --run "which cabal") export CABAL=$(nix-shell --run "which cabal")
export TEST_NIX_PATH=$(nix-shell --run "echo -n \$PATH") export TEST_NIX_PATH=$(nix-shell --run "echo -n \$PATH")
echo $CABAL echo $CABAL
echo $TEST_NIX_PATH echo $TEST_NIX_PATH
git config --global --add safe.directory '*' git config --global --add safe.directory '*'
nix-shell --run "./bin/update-project-dependencies $CABAL_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 /root/.cache/cabal/packages/hackage.haskell.org/ chown -R test:test /root/.cache/cabal/packages/hackage.haskell.org/
...@@ -85,12 +86,13 @@ test: ...@@ -85,12 +86,13 @@ test:
mkdir -p /builds/gargantext/haskell-gargantext/devops/coreNLP/stanford-corenlp-current mkdir -p /builds/gargantext/haskell-gargantext/devops/coreNLP/stanford-corenlp-current
cp -R /root/devops/coreNLP/stanford-corenlp-${CORENLP}/* /builds/gargantext/haskell-gargantext/devops/coreNLP/stanford-corenlp-current/ cp -R /root/devops/coreNLP/stanford-corenlp-${CORENLP}/* /builds/gargantext/haskell-gargantext/devops/coreNLP/stanford-corenlp-current/
nix-shell --run "chown -R test:test /root/.config/ && su -m test -c \"export PATH=$PATH:$TEST_NIX_PATH && cd /builds/gargantext/haskell-gargantext; $CABAL --store-dir=$CABAL_STORE_DIR v2-test --test-show-details=streaming --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 && cd /builds/gargantext/haskell-gargantext; $CABAL --store-dir=$STORE_DIR v2-test --test-show-details=streaming --flags 'test-crypto no-phylo-debug-logs' --ghc-options='-O0 -fclear-plugins'\""
chown -R root:root dist-newstyle/ chown -R root:root dist-newstyle/
chown -R root:root /root/ chown -R root:root /root/
chown -R root:root $CABAL_STORE_DIR chown -R root:root $STORE_DIR
chown -R root:root /root/.cache/cabal/logs/ chown -R root:root /root/.cache/cabal/logs/
chown -R root:root /root/.cache/cabal/packages/hackage.haskell.org/ chown -R root:root /root/.cache/cabal/packages/hackage.haskell.org/
chown -R root:root /root/.cache/nix/
chown -Rh root:root /builds/gargantext/haskell-gargantext/devops/coreNLP/stanford-corenlp-current chown -Rh root:root /builds/gargantext/haskell-gargantext/devops/coreNLP/stanford-corenlp-current
#docs: #docs:
......
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