Skip to content
Snippets Groups Projects

Attempt at deploy via gitlab

1 file
+ 32
0
Compare changes
  • Side-by-side
  • Inline
+ 32
0
@@ -33,6 +33,7 @@ stages:
- review
- gitlab reports
- publish
- deploy
# Default build cache settings to extend from
.build_cached:
@@ -356,3 +357,34 @@ license_scanning:
variables:
MAVEN_CLI_OPTS: -q -Dmaven.main.skip -Dmaven.test.skip=true -DskipTests --batch-mode
LM_JAVA_VERSION: 11
deploy:
stage: deploy
dependencies:
- publish_jar
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
##
## Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
## We're using tr to fix line endings which makes ed25519 keys work
## without extra base64 encoding.
## https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_48526556
##
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan labrador.tudelft.nl >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
- scp labracore.jar labrador.tudelft.nl:/var/www/labracore/
environment:
name: production
url: https://labrador.tudelft.nl
rules:
- if: $CI_PIPELINE_SOURCE == "trigger" ||
$CI_MERGE_REQUEST_EVENT_TYPE == "merge_train"
when: never
- if: $CI_COMMIT_BRANCH == "master"
when: manual
Loading