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

Nane Kratzke's avatar
Nane Kratzke committed
5
job1:
6
    stage: generate
Nane Kratzke's avatar
Nane Kratzke committed
7
    script:
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
12
    artifacts:
        paths:
            - build/
13
14
    only:
        - master
Nane Kratzke's avatar
Nane Kratzke committed
15

Nane Kratzke's avatar
Nane Kratzke committed
16
job2:
17
    stage: generate
Nane Kratzke's avatar
Nane Kratzke committed
18
    script:
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
23
    artifacts:
        paths:
            - build/
24
25
26
27
    only:
        variables:
            $CI_COMMIT_REF_NAME == "release"

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