Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Robert Chatley
rbctestapp
Commits
d7782082
Commit
d7782082
authored
Nov 04, 2021
by
Alex
Browse files
Merge branch 'master' of
https://gitlab.doc.ic.ac.uk/paas-templates/python-flask-template
parents
991d8644
123b54cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
d7782082
...
...
@@ -9,9 +9,9 @@ testing:
-
echo "TODO - Add tests"
deploy
:
image
:
ilyasemenov/gitlab-ci-git-push
stage
:
deploy
only
:
-
master
script
:
-
git-push ssh://dokku@cloud-vm-42-75.doc.ic.ac.uk:22/$APP_NAME
-
chmod +x ./setup_push.sh
-
./setup_push.sh ssh://dokku@cloud-vm-42-75.doc.ic.ac.uk:22/$APP_NAME master
setup_push.sh
0 → 100644
View file @
d7782082
#!/bin/bash -e
url
=
$1
branch
=
$2
if
[
-z
"
$SSH_PRIVATE_KEY
"
]
;
then
>
&2
echo
"Set SSH_PRIVATE_KEY environment variable"
exit
1
fi
ssh_host
=
$(
echo
$url
|
sed
's/.*@//'
|
sed
's/[:/].*//'
)
if
[
-z
"
$ssh_host
"
]
;
then
>
&2
echo
"Usage:
$0
<user@git.host:project | ssh://user@git.host:port/project> [<branch>]"
exit
1
fi
ssh_port
=
if
[[
$url
=
~ ^ssh://[^/]+:
([
0-9]+
)
]]
;
then
ssh_port
=
"-p
${
BASH_REMATCH
[1]
}
"
fi
# TODO: skip on multiple runs
mkdir
-p
~/.ssh
echo
"
$SSH_PRIVATE_KEY
"
|
tr
-d
'\r'
>
~/.ssh/id_rsa
chmod
600 ~/.ssh/id_rsa
ssh-keyscan
-H
$ssh_port
"
$ssh_host
"
>>
~/.ssh/known_hosts
git push
$url
${
CI_COMMIT_SHA
:-
HEAD
}
:refs/heads/
${
branch
:-
master
}
$(
[
-z
"
$DISABLE_FORCE_PUSH
"
]
&&
echo
--force
)
Write
Preview
Supports
Markdown
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