From cc81494e4549a24dc192051638ca1d0261aa3fbd Mon Sep 17 00:00:00 2001 From: sasha0552 Date: Thu, 19 Sep 2019 20:30:43 +0000 Subject: [PATCH] GitLab CI --- .gitlab-ci.yml | 70 ++++++++++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 31 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f5cc7c9d..fc383772 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,41 +1,49 @@ -image: frekele/java +image: docker:latest +services: +- docker:dind + +variables: + DOCKER_DRIVER: overlay2 + CI_VERSION: '6.6.$CI_PIPELINE_IID' stages: - - build - - test - - deploy - -before_script: - # - echo `pwd` # debug - # - echo "$CI_BUILD_NAME, $CI_BUILD_REF_NAME $CI_BUILD_STAGE" # debug - - export GRADLE_USER_HOME=`pwd`/.gradle - - apt-get update -qq && apt-get install -y -qq git git-core - -cache: - key: ${CI_COMMIT_REF_NAME} - paths: - - .gradle/wrapper - - .gradle/caches +- build +- test build: + image: frekele/java stage: build + before_script: + - apt-get -y update + - apt-get -y install zip git + - export GRADLE_USER_HOME=`pwd`/.gradle + - chmod +x gradlew + - sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules + - git submodule sync + - git submodule update --init --recursive script: - - sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules - - git submodule sync - - git submodule update --init --recursive - - ./gradlew assemble - - mv LaunchServer/build/libs/*.jar LaunchServer - - mv ServerWrapper/build/libs/*.jar ServerWrapper - - mv modules/*_module/build/libs/*.jar modules - artifacts: + - ./gradlew assemble + after_script: + - mkdir -p artifacts/modules + - cd LaunchServer/build/libs/ + - zip -r -9 ../../../artifacts/libraries.zip * -x "LaunchServer.jar" -x "LaunchServer-clean.jar" + - mv LaunchServer.jar ../../../artifacts/LaunchServer.jar + - cd ../../../ServerWrapper/build/libs + - mv ServerWrapper.jar ../../../artifacts/ServerWrapper.jar + - cd ../../../ + - mv modules/*_module/build/libs/*.jar artifacts/modules + - mv modules/*_swmodule/build/libs/*.jar artifacts/modules + - mv modules/*_lmodule/build/libs/*.jar artifacts/modules + cache: paths: - - LaunchServer/*.jar - - ServerWrapper/*.jar - - modules/*.jar + - .gradle + artifacts: + expire_in: 6 week + paths: + - artifacts + test: + image: frekele/java stage: test script: - - ./gradlew check - -after_script: - - echo "End CI" + - ./gradlew check \ No newline at end of file