job-linux-prepare.yml 1009 Bytes
Newer Older
1 2 3 4 5 6 7
.linux-prepare:

  cache:
    key: $CI_JOB_NAME
    paths:
      - ccache/

8 9
  extends: .job-prepare

10 11 12 13 14 15 16 17 18 19 20 21 22 23
  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
24 25
    - echo $CCACHE_SIZE
    - echo ${PWD}/ccache
26 27 28 29 30 31 32 33
    - export CCACHE_BASEDIR=${PWD}
    - export CCACHE_DIR=${PWD}/ccache
    - ccache -s

  after_script:
    - if ! [ -z ${TUNNEL_USER_KEY+x} ]; then rm -rf ~/.ssh || true; fi
    - export CCACHE_DIR=${PWD}/ccache
    - ccache -s