mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[ANY] Try new gitlab ci
This commit is contained in:
parent
e26a15d26a
commit
602a20325c
1 changed files with 28 additions and 24 deletions
|
@ -1,41 +1,41 @@
|
||||||
image: docker:latest
|
image: gradle:jdk11
|
||||||
services:
|
|
||||||
- docker:dind
|
|
||||||
|
|
||||||
variables:
|
|
||||||
DOCKER_DRIVER: overlay2
|
|
||||||
CI_VERSION: '6.6.$CI_PIPELINE_IID'
|
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
|
- deploy
|
||||||
|
|
||||||
build:
|
|
||||||
image: gradle:jdk11
|
|
||||||
stage: build
|
|
||||||
before_script:
|
before_script:
|
||||||
- apt-get -y update
|
- apt-get -y update
|
||||||
- apt-get -y install zip git
|
- 'which zip || ( apt-get -y install zip )'
|
||||||
|
- 'which git || ( apt-get -y install git )'
|
||||||
- export GRADLE_USER_HOME=`pwd`/.gradle
|
- export GRADLE_USER_HOME=`pwd`/.gradle
|
||||||
- chmod +x gradlew
|
- chmod +x gradlew
|
||||||
- sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules
|
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
|
||||||
|
- eval $(ssh-agent -s)
|
||||||
|
- echo "$SSH_PRIVATE_KEY" | base64 -d | ssh-add - > /dev/null
|
||||||
|
- mkdir -p ~/.ssh
|
||||||
|
- chmod 700 ~/.ssh
|
||||||
|
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
|
||||||
- git submodule sync
|
- git submodule sync
|
||||||
- git submodule update --init --recursive
|
- git submodule update --init --recursive
|
||||||
|
build:
|
||||||
|
stage: build
|
||||||
script:
|
script:
|
||||||
- ./gradlew assemble
|
- ./gradlew assemble
|
||||||
after_script:
|
after_script:
|
||||||
- mkdir -p artifacts/modules
|
- mkdir -p artifacts/modules
|
||||||
- cd LaunchServer/build/libs/
|
- cd LaunchServer/build/libs/
|
||||||
- zip -r -9 ../../../artifacts/libraries.zip * -x "LaunchServer.jar" -x "LaunchServer-clean.jar"
|
- zip -r -9 ../../../artifacts/libraries.zip * -x "LaunchServer.jar" -x "LaunchServer-clean.jar"
|
||||||
- mv LaunchServer.jar ../../../artifacts/LaunchServer.jar
|
- cp LaunchServer.jar ../../../artifacts/LaunchServer.jar
|
||||||
- cd ../../../ServerWrapper/build/libs
|
- cd ../../../ServerWrapper/build/libs
|
||||||
- mv ServerWrapper.jar ../../../artifacts/ServerWrapper.jar
|
- cp ServerWrapper.jar ../../../artifacts/ServerWrapper.jar
|
||||||
- cd ../../../LauncherAuthlib/build/libs
|
- cd ../../../LauncherAuthlib/build/libs
|
||||||
- mv LauncherAuthlib.jar ../../../artifacts/LauncherAuthlib.jar
|
- cp LauncherAuthlib.jar ../../../artifacts/LauncherAuthlib.jar
|
||||||
- cd ../../../
|
- cd ../../../
|
||||||
- mv modules/*_module/build/libs/*.jar artifacts/modules
|
- cp modules/*_module/build/libs/*.jar artifacts/modules
|
||||||
- mv modules/*_swmodule/build/libs/*.jar artifacts/modules
|
- cp modules/*_swmodule/build/libs/*.jar artifacts/modules
|
||||||
- mv modules/*_lmodule/build/libs/*.jar artifacts/modules
|
- cp modules/*_lmodule/build/libs/*.jar artifacts/modules
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
- .gradle
|
- .gradle
|
||||||
|
@ -45,7 +45,11 @@ build:
|
||||||
- artifacts
|
- artifacts
|
||||||
|
|
||||||
test:
|
test:
|
||||||
image: gradle:jdk11
|
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- ./gradlew check
|
- ./gradlew check
|
||||||
|
|
||||||
|
deploy-demo:
|
||||||
|
stage: deploy
|
||||||
|
script:
|
||||||
|
- ssh $SSH_USER@$SSH_HOST 'echo HELLO WORLD'
|
Loading…
Reference in a new issue