wrong variable name in gitlab-ci
SSS_USER
master-deploy:
stage: deploy
image: collaborating.tuhh.de:5005/cfg0846/research-topics-mat-tuhh/alpine-ssh
before_script:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh && touch ~/.ssh/known_hosts
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 700 ~/.ssh/known_hosts
script:
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- rsync -v -r -a --delete -e "ssh -p${SSH_PORT}" build-tuhh-asteroid/* ${SSH_USER}@${HOST_NAME}:/usr/local/apache2/htdocs/.
- ssh -v -p "${SSH_PORT}" "${SSH_USER}"@"${HOST_NAME}" "rm -rf /usr/local/apache2/htdocs/.htaccess" #only temporary fix
cache:
key: "$CI_COMMIT_REF_SLUG"
environment:
name: $CI_COMMIT_REF_NAME
url: https://$PROXY_HOST_NAME$BASE_DIR
rules:
# - if: $SSH_USER #use this only for testing
- if: $CI_COMMIT_REF_NAME == "master" && $SSS_USER