linphone-desktop/.gitlab-ci-files/job-linux-prepare.yml
Julien Wadel 82791dfed4 Initial
2023-10-02 14:37:16 +02:00

36 lines
1.1 KiB
YAML

.linux-prepare:
cache:
key: $CI_JOB_NAME
paths:
- ccache/
extends: .job-prepare
before_script:
##
## If a TUNNEL_USER_KEY is defined then start ssh-agent and add the key
##
- if ! [ -z ${TUNNEL_USER_KEY+x} ]; then eval $(ssh-agent -s); fi
- if ! [ -z ${TUNNEL_USER_KEY+x} ]; then echo "$TUNNEL_USER_KEY" | tr -d '\r' | ssh-add - > /dev/null; fi
- if ! [ -z ${TUNNEL_USER_KEY+x} ]; then mkdir -p ~/.ssh && chmod 700 ~/.ssh; fi
- if ! [ -z ${TUNNEL_USER_KEY+x} ]; then echo -e "Host gitlab.linphone.org\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config; fi
##
## Then configure ccache
##
- mkdir -p ccache
- echo "max_size = $CCACHE_SIZE" > ccache/ccache.conf
- echo $CCACHE_SIZE
- echo ${PWD}/ccache
- export CCACHE_BASEDIR=${PWD}
- export CCACHE_DIR=${PWD}/ccache
- ccache -s
- find $CI_PROJECT_DIR -name '.git' -exec bash -c 'git config --global --add safe.directory ${0%/.git}' {} \;
- git describe --debug || true
after_script:
- if ! [ -z ${TUNNEL_USER_KEY+x} ]; then rm -rf ~/.ssh || true; fi
- export CCACHE_DIR=${PWD}/ccache
- ccache -s