I already asked this question on StackOverflow and they said I should better do it here.
I am used to Gitlab, and now I want to start implementing with Gitlab-CI, directly on the server. I have an OVH Cloud Web 1 account.
Currently, I made it work with this code in the .gitlab-ci.yml file and according to the variables in Gitlab:
stages: - deploy deploy: stage: deploy image: ubuntu:latest environment: name: production only: - master before_script: - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' - mkdir -p ~/.ssh - eval $(ssh-agent -s) - '(( -f /.dockerenv )) && echo -e "Host *ntStrictHostKeyChecking nonn" > ~/.ssh/config' - apt-get update -qq && apt-get install -y -qq sshpass - export SSHPASS=$DEPLOY_PASSWORD script: - sshpass -e ssh -tt -p $DEPLOY_PORT $DEPLOY_USER@$DEPLOY_HOST git pull
I feel like this code is not clean or safe. Can you give me some advice?