From 5da0bd3d7ad127ce81a26bc2d1e2a9f0844ee62c Mon Sep 17 00:00:00 2001 From: Jules Date: Thu, 28 Jul 2022 23:01:43 +0000 Subject: [PATCH 1/3] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 47 ++++++++++++++++++----------------------------- 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 270f9d0b..20554d3c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,33 +1,22 @@ -image: maven:3-openjdk-16-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: +build-job: stage: build script: - - mvn $MAVEN_CLI_OPTS clean package - -deploy: + - echo "Hello, $GITLAB_USER_LOGIN!" + +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 script: - - mvn $MAVEN_CLI_OPTS deploy - - 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 + - echo "This job deploys something from the $CI_COMMIT_BRANCH branch." \ No newline at end of file From 54031102f9dc3b03d9cf75dc7f1727db73d5c04d Mon Sep 17 00:00:00 2001 From: Jules Date: Thu, 28 Jul 2022 23:04:45 +0000 Subject: [PATCH 2/3] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 20554d3c..e69de29b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,22 +0,0 @@ -build-job: - stage: build - script: - - echo "Hello, $GITLAB_USER_LOGIN!" - -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 - script: - - echo "This job deploys something from the $CI_COMMIT_BRANCH branch." \ No newline at end of file From c298ec23016193ac7db1f3566095c0939eb35c02 Mon Sep 17 00:00:00 2001 From: Jules Date: Thu, 28 Jul 2022 23:09:53 +0000 Subject: [PATCH 3/3] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e69de29b..12d7438c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -0,0 +1,11 @@ +image: maven:3-openjdk-16-slim + +build: + stage: build + script: + - mvn clean package + +deploy: + stage: deploy + script: + - mvn deploy