summaryrefslogtreecommitdiffstats
path: root/jjb/functest/xtesting.yaml
blob: f1cdd107ed8c90b3aa379209554568825aa3bc13 (plain)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
---
- xtesting-jobs: &xtesting-jobs
    name: 'xtesting-jobs'
    current-parameters: true

- xtesting-params: &xtesting-params
    name: 'xtesting-params'
    tag:
      - latest
      - gambia
      - hunter

- parameter:
    name: xtesting-slave
    parameters:
      - label:
          name: slave
          default: lf-build2

- job-template:
    name: '{repo}-{container}-{tag}-pull'
    parameters:
      - xtesting-slave
    builders:
      - shell: |
          if [ "{port}" = "None" ]; then
            image={repo}/{container}:{tag}
          else
            image={repo}:{port}/{container}:{tag}
          fi
          sudo docker pull $image

- project:
    name: 'opnfv-xtesting-pull'
    <<: *xtesting-params
    repo: 'opnfv'
    port:
    container: 'xtesting'
    jobs:
      - '{repo}-{container}-{tag}-pull'

- job-template:
    name: '{repo}-{container}-{tag}-rmi'
    parameters:
      - xtesting-slave
    builders:
      - shell: sudo docker rmi {repo}/{container}:{tag} || true

- project:
    name: 'opnfv-xtesting-rmi'
    <<: *xtesting-params
    repo: 'opnfv'
    port:
    container: 'xtesting'
    jobs:
      - '{repo}-{container}-{tag}-rmi'

- job-template:
    name: '{repo}-{container}-{tag}-{test}-run'
    parameters:
      - xtesting-slave
    builders:
      - shell: |
          set +ex
          [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/* || true
          if [ "{port}" = "None" ]; then
            image={repo}/{container}:{tag}
          else
            image={repo}:{port}/{container}:{tag}
          fi
          sudo docker run --rm \
            -v $WORKSPACE/results:/var/lib/xtesting/results \
            $image run_tests -t {test}
          res=$?
          gsutil -m cp -r $WORKSPACE/ \
            gs://artifacts.opnfv.org/xtesting/$JOB_NAME-$BUILD_ID > /dev/null 2>&1
          find $WORKSPACE -type f \
            -printf \
            "http://artifacts.opnfv.org/xtesting/$JOB_NAME-$BUILD_ID/%P\n"
          exit $res

- project:
    name: 'opnfv-xtesting'
    <<: *xtesting-params
    repo: 'opnfv'
    port:
    container: 'xtesting'
    test:
      - first
      - second
      - third
      - fourth
      - fifth
    jobs:
      - '{repo}-{container}-{tag}-{test}-run'

- job-template:
    name: 'xtesting-{tag}'
    project-type: multijob
    triggers:
      - timed: '@daily'
    parameters:
      - xtesting-slave
    properties:
      - build-blocker:
          use-build-blocker: true
          blocking-level: 'NODE'
          blocking-jobs:
            - 'xtesting-.*'
    builders:
      - multijob:
          name: remove former images
          projects:
            - name: 'opnfv-xtesting-{tag}-rmi'
              <<: *xtesting-jobs
      - multijob:
          name: pull containers
          projects:
            - name: 'opnfv-xtesting-{tag}-pull'
              <<: *xtesting-jobs
      - multijob:
          name: opnfv/xtesting:{tag}
          projects:
            - name: 'opnfv-xtesting-{tag}-first-run'
              <<: *xtesting-jobs
            - name: 'opnfv-xtesting-{tag}-second-run'
              <<: *xtesting-jobs
            - name: 'opnfv-xtesting-{tag}-third-run'
              <<: *xtesting-jobs
            - name: 'opnfv-xtesting-{tag}-fourth-run'
              <<: *xtesting-jobs
            - name: 'opnfv-xtesting-{tag}-fifth-run'
              <<: *xtesting-jobs

- project:
    name: 'xtesting'
    <<: *xtesting-params
    jobs:
      - 'xtesting-{tag}'

- view:
    name: xtesting
    view-type: list
    columns:
      - status
      - weather
      - job
      - last-success
      - last-failure
      - last-duration
    regex: ^xtesting-[a-z0-9]*$