-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
63 lines (56 loc) · 1.83 KB
/
.gitlab-ci.yml
File metadata and controls
63 lines (56 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
image: gradle:alpine
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
cache:
key: "$CI_COMMIT_REF_NAME"
paths:
- build
- .gradle
build:
stage: build
script:
- gradle --build-cache shadowJar
- mv build/libs/Craftlin.jar .
artifacts:
paths:
- Craftlin.jar
expire_in: 1 week
test:
stage: test
script:
- gradle check
- gradle dokka
- gradle jacocoTestReport
- cat build/reports/jacoco/test/html/index.html
artifacts:
paths:
- build/dokka/-craftlin/*
expire_in: 1 week
deploy:
stage: deploy
image: ubuntu:xenial
only: [master]
script:
- apt-get update && apt-get -y install sshpass zip unzip
- rpath='/var/www/craftlin' && rhost='www@company.libter.pl'
- rcmd() { sshpass -p $PASSWORD ssh -oStrictHostKeyChecking=no -p 531 "$rhost" "$1"; }
- rcp() { sshpass -p $PASSWORD scp -P 531 -r "$1" "$rhost:$rpath/$1"; }
- mv build/dokka/-craftlin docs && cd docs && zip -r ../docs.zip * && cd ..
- rcmd "rm -rf $rpath/Craftlin.jar $rpath/docs"
- rcp Craftlin.jar && rcp docs.zip
- rcmd "mkdir $rpath/docs && unzip $rpath/docs.zip -d $rpath/docs && rm $rpath/docs.zip"
deployDev:
stage: deploy
image: ubuntu:xenial
only: [dev]
script:
- apt-get update && apt-get -y install sshpass zip unzip
- rpath='/var/www/craftlin' && rhost='www@company.libter.pl'
- rcmd() { sshpass -p $PASSWORD ssh -oStrictHostKeyChecking=no -p 531 "$rhost" "$1"; }
- rcp() { sshpass -p $PASSWORD scp -P 531 -r "$1" "$rhost:$rpath/$1"; }
- mv build/dokka/-craftlin docs && cd docs && zip -r ../docs.zip * && cd ..
- rcmd "rm -rf $rpath/Craftlin-dev.jar $rpath/docs-dev"
- mv Craftlin.jar Craftlin-dev.jar && rcp Craftlin-dev.jar && rcp docs.zip
- rcmd "mkdir $rpath/docs-dev && unzip $rpath/docs.zip -d $rpath/docs-dev && rm $rpath/docs.zip"