Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
Tecnonucleous
Tecnonucleous Bot
Commits
a34d343c
Commit
a34d343c
authored
Oct 30, 2019
by
Daniel Pérez Fernández
🕶
Browse files
Other test...
parent
e308fcc7
Pipeline
#92506369
failed with stage
in 57 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
.gitlab-ci.yml
.gitlab-ci.yml
+7
-6
No files found.
.gitlab-ci.yml
View file @
a34d343c
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment