2021-06-13 23:21:20 +02:00
|
|
|
image: maven:3-openjdk-16-slim
|
2020-07-28 06:21:46 +02:00
|
|
|
|
|
|
|
variables:
|
2020-07-28 06:53:17 +02:00
|
|
|
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
|
2020-07-28 06:21:46 +02:00
|
|
|
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
- apt-get update -qq
|
|
|
|
# Setup SSH deploy keys
|
|
|
|
- 'which ssh-agent || ( apt-get install -qq openssh-client )'
|
|
|
|
- eval $(ssh-agent -s)
|
|
|
|
- ssh-add <(echo "$SSH_PRIVATE_KEY")
|
|
|
|
- mkdir -p ~/.ssh
|
|
|
|
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
|
|
|
|
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- .m2/repository/
|
|
|
|
- target/
|
|
|
|
|
|
|
|
build:
|
|
|
|
stage: build
|
|
|
|
script:
|
2020-09-06 03:51:47 +02:00
|
|
|
- mvn $MAVEN_CLI_OPTS clean package
|
2020-07-28 06:21:46 +02:00
|
|
|
|
|
|
|
deploy:
|
|
|
|
stage: deploy
|
|
|
|
script:
|
2020-07-28 06:53:17 +02:00
|
|
|
- mvn $MAVEN_CLI_OPTS deploy
|
2021-05-30 01:33:27 +02:00
|
|
|
- ssh builder@proxy.mythiccraft.io -p 2222 "mkdir -p /tmp/builds/$CI_JOB_ID && exit"
|
|
|
|
- scp -rp -o StrictHostKeyChecking=no -o Port=2222 ./target/ builder@proxy.mythiccraft.io:/tmp/builds/$CI_JOB_ID/
|
2020-07-28 06:21:46 +02:00
|
|
|
only:
|
|
|
|
- master
|