forked from Upstream/mmocore
Update .gitlab-ci.yml file
This commit is contained in:
parent
7d6e0b74cc
commit
5da0bd3d7a
@ -1,33 +1,22 @@
|
|||||||
image: maven:3-openjdk-16-slim
|
build-job:
|
||||||
|
|
||||||
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
|
stage: build
|
||||||
script:
|
script:
|
||||||
- mvn $MAVEN_CLI_OPTS clean package
|
- echo "Hello, $GITLAB_USER_LOGIN!"
|
||||||
|
|
||||||
deploy:
|
test-job1:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- echo "This job tests something"
|
||||||
|
|
||||||
|
test-job2:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- echo "This job tests something, but takes more time than test-job1."
|
||||||
|
- echo "After the echo commands complete, it runs the sleep command for 20 seconds"
|
||||||
|
- echo "which simulates a test that runs 20 seconds longer than test-job1"
|
||||||
|
- sleep 20
|
||||||
|
|
||||||
|
deploy-prod:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
script:
|
script:
|
||||||
- mvn $MAVEN_CLI_OPTS deploy
|
- echo "This job deploys something from the $CI_COMMIT_BRANCH branch."
|
||||||
- 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/
|
|
||||||
only:
|
|
||||||
- master
|
|
Loading…
Reference in New Issue
Block a user