.gitlab-ci.yml 935 Bytes
Newer Older
Schwieger, Jana's avatar
Schwieger, Jana committed
1
stages:
Schwieger, Jana's avatar
Schwieger, Jana committed
2
3
    - generate
    - consume
Nane Kratzke's avatar
Nane Kratzke committed
4

Schwieger, Jana's avatar
Schwieger, Jana committed
5
job1:
Schwieger, Jana's avatar
Schwieger, Jana committed
6
    stage: generate
Schwieger, Jana's avatar
Schwieger, Jana committed
7
    script:
Schwieger, Jana's avatar
Schwieger, Jana committed
8
        - mkdir build
9
        - echo "Hello I am job 1 executed on the $CI_COMMIT_REF_NAME branch only" > build/job1-result.txt
10
11
    artifacts:
        paths:
12
13
14
            - build/
    only:
        - master
Schwieger, Jana's avatar
Schwieger, Jana committed
15
16

job2:
Schwieger, Jana's avatar
Schwieger, Jana committed
17
    stage: generate
Schwieger, Jana's avatar
Schwieger, Jana committed
18
    script:
Schwieger, Jana's avatar
Schwieger, Jana committed
19
        - mkdir build
20
        - echo "Hello I am job 2 executed on the $CI_COMMIT_REF_NAME branch only" > build/job2-result.txt
21
22
    artifacts:
        paths:
23
24
25
26
            - build/
    only:
        variables:
            - $CI_COMMIT_REF_NAME == "release"
Schwieger, Jana's avatar
Schwieger, Jana committed
27
28

job3:
29
30
31
32
33
34
35
36
37
38
39
40
    stage: generate
    script:
        - mkdir build
        - echo "Hello I am job3 and always executed except for the master or release branch" > build/job3-result.txt
    artifacts:
        paths:
            - build/
    except:
        - master
        - release
            
job4:
Schwieger, Jana's avatar
Schwieger, Jana committed
41
    stage: consume
Schwieger, Jana's avatar
Schwieger, Jana committed
42
    script:
Schwieger, Jana's avatar
Schwieger, Jana committed
43
        - cat build/*-result.txt