# SSH / RSYNC deploy from # https://docs.gitlab.com/ee/ci/ssh_keys/#ssh-keys-when-using-the-docker-executor before_script: ## Install ssh-agent if not already installed, it is required by Docker. ## (change apt-get to yum if you use an RPM-based image) - 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )' - 'command -v rsync >/dev/null || ( apt-get install rsync -y )' ## Run ssh-agent (inside the build environment) - eval $(ssh-agent -s) ## Give the right permissions, otherwise ssh-add will refuse to add files ## Add the SSH key stored in SSH_PRIVATE_KEY file type CI/CD variable to the agent store - chmod 400 "$SSH_PRIVATE_KEY" - ssh-add "$SSH_PRIVATE_KEY" ## Create the SSH directory and give it the right permissions - mkdir -p ~/.ssh - chmod 700 ~/.ssh - cp "$SSH_KNOWN_HOSTS" ~/.ssh/known_hosts - chmod 644 ~/.ssh/known_hosts stages: # List of stages for jobs, and their order of execution - deploy deploy-job: stage: deploy environment: production script: - rsync --archive --hard-links --verbose --cvs-exclude --delete ./ deploy@guardiansofnaxos.gr:./