Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bwinf
medal
Commits
3805c35b
Commit
3805c35b
authored
Oct 18, 2019
by
Robert Czechowski
Browse files
Update .gitlab-ci.yml: Add real deploy environment
parent
795897d5
Pipeline
#229
failed with stages
in 12 minutes and 27 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
3805c35b
...
...
@@ -3,6 +3,7 @@ image: 'rust:latest'
stages
:
-
test
-
build
-
testdeploy
-
deploy
variables
:
...
...
@@ -40,11 +41,12 @@ build:
-
cargo build --release
only
:
-
master
-
deploy
deploy
:
stage
:
deploy
test
deploy
:
stage
:
test
deploy
script
:
# Setup SSH deploy keys
-
'
which
ssh-agent
||
(
apt-get
install
-qq
openssh-client
)'
...
...
@@ -61,6 +63,27 @@ deploy:
-
ssh medald@jim.test.bwinf.de "sudo /bin/systemctl start medal && exit"
only
:
-
master
-
deploy
deploy
:
stage
:
deploy
script
:
# Setup SSH deploy keys
-
'
which
ssh-agent
||
(
apt-get
install
-qq
openssh-client
)'
-
eval $(ssh-agent -s)
-
ssh-add <(echo "$SSH_PRIVATE_DEPLOY_KEY" | base64 -d)
-
mkdir -p ~/.ssh
-
'
[[
-f
/.dockerenv
]]
&&
echo
-e
"Host
*\n\tStrictHostKeyChecking
no\n\n"
>
~/.ssh/config'
# Stop server and upload
-
ssh medald@2a01:4f8:c2c:e9a7::1 "sudo /bin/systemctl stop medal && exit"
-
"
scp
target/release/medal
medald@jim.test.bwinf.de:medal/"
-
"
scp
-r
migrations
static
templates
medald@jim.test.bwinf.de:medal/"
-
"
scp
-r
tasks/jwinf/wrapper.html
medald@jim.test.bwinf.de:medal/tasks/jwinf/"
-
ssh medald@2a01:4f8:c2c:e9a7::1 "sudo /bin/systemctl start medal && exit"
only
:
-
deploy
...
...
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