Update .gitlab-ci.yml

This commit is contained in:
Administrator 2020-07-27 21:21:46 -07:00
parent d66f641bd8
commit 511d69f1ef

32
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,32 @@
image: maven:3-openjdk-8-slim
variables:
MAVEN_CLI_OPTS: "--batch-mode"
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:
- mvn $MAVEN_CLI_OPTS package
deploy:
stage: deploy
script:
- ssh lumine@proxy.mythiccraft.io -p 2222 "mkdir -p /tmp/builds/$CI_JOB_ID && exit"
- scp -rp -o StrictHostKeyChecking=no -o Port=2222 ./target/ lumine@proxy.mythiccraft.io:/tmp/builds/$CI_JOB_ID/
only:
- master