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

CD First Test

parent ce5fc191
Pipeline #92500320 failed
image: ubuntu:latest
variables:
WORK_DIR: ${CI_PROJECT_NAME}
BRANCH: ${CI_COMMIT_REF_NAME}
REPO: https://gitlab.com/Tecnonucleous/open-telegram-bot-nodejs.git
stages:
- deploy
deply:
# 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:
- '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:
- 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
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