.gitlab-ci.yml 1.1 KB
Newer Older
Matthias Betz's avatar
Matthias Betz committed
1
2
variables:
  JAVA_HOME: "/usr/lib/jvm/java-1.8.0-openjdk-amd64"
3
4


Matthias Betz's avatar
Matthias Betz committed
5
6
7
build:
    script:
        - mvn package -B
Matthias Betz's avatar
Matthias Betz committed
8
9
10
        
release:
    script:
Matthias Betz's avatar
Matthias Betz committed
11
        - mvn package -B
Matthias Betz's avatar
Matthias Betz committed
12
        - FILE= ls target/ | grep '\.zip$' | head -n 1
Matthias Betz's avatar
Matthias Betz committed
13
14
15
        - echo ${FILE}
        - echo ${CI_PROJECT_ID}
        - echo ${CI_COMMIT_TAG}
Matthias Betz's avatar
Matthias Betz committed
16
        - echo ${CI_API_V4_URL}
Matthias Betz's avatar
Matthias Betz committed
17
        - echo ${CI_PROJECT_URL}
Matthias Betz's avatar
Matthias Betz committed
18
        - 'UPLOAD_RESULT= curl --request POST --header ''PRIVATE-TOKEN: ${TOKEN}'' --form "file=@${FILE}" ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/uploads'
Matthias Betz's avatar
Matthias Betz committed
19
20
21
        - echo ${UPLOAD_RESULT}
        - FILE_URL = echo $UPLOAD_RESULT | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["url"]'
        - echo ${FILE_URL}
Matthias Betz's avatar
Matthias Betz committed
22
        - 'curl --header ''Content-Type: application/json'' --header ''PRIVATE-TOKEN: ${TOKEN}'' --data ''{"name": "Release ${CI_COMMIT_TAG}", "tag_name": "${CI_COMMIT_TAG}", "description": "RegionChooser Release", "assets": { "links": [{ "name": "${FILE}", "url": "${CI_PROJECT_URL}${FILE_URL}"}] } }'' --request POST ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/releases'
Matthias Betz's avatar
Matthias Betz committed
23
24
    only:
        refs:
Matthias Betz's avatar
Matthias Betz committed
25
            - tags
Matthias Betz's avatar
Matthias Betz committed
26