Skip to content
Snippets Groups Projects
build.sh 918 B
#!/usr/bin/env bash

export SCRIPT_DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

set -ex
os_kind=$(awk -F= '/^ID=/{print $2}' /etc/os-release)
os_kind=${os_kind//\"/}
if [[ "${os_kind}" == "ubuntu" ]]; then
    source /var/lib/gitlab-runner/.bashrc
elif [[ "${os_kind}" == "pop" ]]; then
    source /var/lib/gitlab-runner/.bashrc
else
    source ${HOME}/.bashrc
fi

if [[ -z "$METOBS_SITE_DEST" ]]; then
    if [[ "$CI_COMMIT_BRANCH" == "develop" ]]; then
        export METOBS_SITE_DEST="metobs-test"
    else
        export METOBS_SITE_DEST="metobs"
    fi
fi

# create or update the existing environment to the newest pelican version
# Environments should be created as gitlab-runner user and placed in
# /home/gitlab-runner/.conda/envs/<env name> by default
conda env update -n "rain_site_env" -f "${SCRIPT_DIR}/build_environment.yml"
conda activate "rain_site_env"
make clean
make publish
echo $PWD