From e840025e45e913a57f13d741598ec4ae918c365b Mon Sep 17 00:00:00 2001 From: Administrator Date: Mon, 27 Jul 2020 22:02:01 -0700 Subject: [PATCH] Update .m2/settings.xml, .gitlab-ci.yml files --- .gitlab-ci.yml | 33 +++++++++++++++++++++++++++++++++ .m2/settings.xml | 9 +++++++++ 2 files changed, 42 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 .m2/settings.xml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..a10c4c08 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,33 @@ +image: maven:3-openjdk-8-slim + +variables: + MAVEN_CLI_OPTS: "-s .m2/settings.xml --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: + - mvn $MAVEN_CLI_OPTS deploy + - 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 diff --git a/.m2/settings.xml b/.m2/settings.xml new file mode 100644 index 00000000..f9f19f1d --- /dev/null +++ b/.m2/settings.xml @@ -0,0 +1,9 @@ + + + + nexus + ${env.M2_REPO_USER} + ${env.M2_REPO_PASS} + + +