File: gitlab-ci.sh

package info (click to toggle)
qcumber 2.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 2,276 kB
  • sloc: python: 3,097; sh: 153; makefile: 18
file content (26 lines) | stat: -rw-r--r-- 766 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash

# Inspired by OP of
# https://stackoverflow.com/questions/48540257/
# caching-virtual-environment-for-gitlab-ci

ENV_NAME="qcumber"
if [[ -z "${CI_PROJECT_DIR}" ]]; then
  CI_PROJECT_DIR="."
fi

if [ ! -d "$CI_PROJECT_DIR/.conda_cache/$ENV_NAME" ]; then
    echo "Environment $ENV_NAME does not exist. Creating it now!"
    conda-env create -f environment/packages.yaml \
    -p "$CI_PROJECT_DIR/.conda_cache/$ENV_NAME"
else
    echo "Updating $ENV_NAME with packages.yaml"
    conda-env update -f environment/packages.yaml \
    -p "$CI_PROJECT_DIR/.conda_cache/$ENV_NAME"
fi

echo "Activating environment: $CI_PROJECT_DIR/.conda_cache/$ENV_NAME"
source activate $CI_PROJECT_DIR/.conda_cache/qcumber

#"$CI_PROJECT_DIR/.conda_cache/$ENV_NAME"