Commit a34d343c authored by Daniel Pérez Fernández's avatar Daniel Pérez Fernández 🕶
Browse files

Other test...

parent e308fcc7
Pipeline #92506369 failed with stage
in 57 seconds
......@@ -3,21 +3,22 @@ variables:
WORK_DIR: ${CI_PROJECT_NAME}
BRANCH: ${CI_COMMIT_REF_NAME}
REPO: https://gitlab.com/Tecnonucleous/open-telegram-bot-nodejs.git
SSH_PRIVATE_KEY: $PRIVATE_KEY
SERVER_IP: $SERVER_IP
SERVER_PORT: $SERVER_PORT
SSH_USERNAME: $SSH_USERNAME
stages:
- deploy
deploy:
stage: deploy
# Within before_script what we are doing is creating and adding ssh key, also we are disabling command line to ask for password. 'StrictHostKeyChecking no'
before_script:
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 *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
script:
script:
- ssh-add <(echo "$PRIVATE_KEY")
- ssh -o StrictHostKeyChecking=no "$ssh_username"@"$server_ip" -p "$server_port" "cd ${WORK_DIR}; git init; git clone -b ${BRANCH} ${REPO};"
only:
- master
- ssh -o StrictHostKeyChecking=no "$SSH_USERNAME"@"$SERVER_IP" -p "$SERVER_PORT" "cd ${WORK_DIR}; git init; git clone -b ${BRANCH} ${REPO};"
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment