aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/onap-lab-ci/jjb/macros.yaml
blob: 47d42416b51666366f2557bbec92cda457cd7a0b (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
152
153
154
155
156
157
158
159
160
161
162
163
---
- scm:
    name: git-integration
    scm:
      - git:
          url: 'http://gerrit.onap.org/r/integration'
          branches:
            - 'origin/{branch}'
          wipe-workspace: false
          skip-tag: true
          timeout: 30

- scm:
    name: gerrit-trigger-scm
    scm:
      - git:
          url: 'http://gerrit.onap.org/r/$GERRIT_PROJECT'
          refspec: '$GERRIT_REFSPEC'
          branches:
            - 'origin/$GERRIT_BRANCH'
          skip-tag: true
          choosing-strategy: 'gerrit'
          submodule:
            recursive: true

- publisher:
    name: integration-robot
    publishers:
      - robot:
          output-path: 'archives'
          other-files: ''
          unstable-threshold: 60
          pass-threshold: 100
          only-critical: false
      - postbuildscript:
          builders:
            - role: BOTH
              build-on:
                - ABORTED
                - FAILURE
                - NOT_BUILT
                - SUCCESS
                - UNSTABLE
              build-steps:
                - robot-influxdb
          mark-unstable-if-failed: true

- publisher:
    name: pods-influxdb
    publishers:
      - postbuildscript:
          builders:
            - role: BOTH
              build-on:
                - ABORTED
                - FAILURE
                - NOT_BUILT
                - SUCCESS
                - UNSTABLE
              build-steps:
                - pods-influxdb
          mark-unstable-if-failed: true

- publisher:
    name: archive-logs
    publishers:
      - postbuildscript:
          builders:
            - role: BOTH
              build-on:
                - ABORTED
                - FAILURE
                - NOT_BUILT
                - SUCCESS
                - UNSTABLE
              build-steps:
                - archive-logs
          mark-unstable-if-failed: true

- builder:
    name: archive-logs
    builders:
      - shell: |
          #!/bin/bash -x
          mkdir -p /var/www/html/logs/$JOB_NAME/$BUILD_NUMBER
          curl -s -f "http://localhost:8080/jenkins/job/$JOB_NAME/$BUILD_NUMBER/consoleText" > $WORKSPACE/archives/console.log
          curl -s -f "http://localhost:8080/jenkins/job/$JOB_NAME/$BUILD_NUMBER/timestamps/?time=HH:mm:ssZ&appendLog" >  $WORKSPACE/archives/console-source-timestamp.log
          rsync -avt $WORKSPACE/archives/ /var/www/html/logs/$JOB_NAME/$BUILD_NUMBER
          echo
          echo "Browse logs at http://onapci.org/logs/$JOB_NAME/$BUILD_NUMBER/"
          echo

- builder:
    name: robot-influxdb
    builders:
      - shell: |
          #!/bin/bash -x
          # $JENKINS_HOME/onap-lab-ci/scripts/process-robot.sh $WORKSPACE/archives/output.xml $JOB_NAME $BUILD_NUMBER

- builder:
    name: pods-influxdb
    builders:
      - shell: |
          #!/bin/bash -x
          # $JENKINS_HOME/onap-lab-ci/scripts/process-pods.sh $WORKSPACE/archives/onap-pods.json $JOB_NAME $BUILD_NUMBER

- publisher:
    name: trigger-lf-lab-job
    publishers:
      - postbuildscript:
          builders:
            - role: BOTH
              build-on:
                - ABORTED
                - FAILURE
                - NOT_BUILT
                - SUCCESS
                - UNSTABLE
              build-steps:
                - trigger-lf-lab-job:
                    lab-name: '{lab-name}'
          mark-unstable-if-failed: false

- builder:
    name: trigger-lf-lab-job
    builders:
      - shell: |
          #!/bin/bash
          set +x
          LF_JOBS="tlab-oom-daily tlab-oom-staging-daily windriver-oom-daily windriver-oom-staging-daily"
          echo $LF_JOBS | grep -q $JOB_NAME
          if [ $? -ne 0 ]; then
            exit 0
          fi

          . $JENKINS_HOME/onap-lab-ci/labs/{lab-name}-openrc

          set -v
          CRUMB=$(curl -s -u "$LF_USERNAME:$LF_PASSWORD" 'https://jenkins.onap.org/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)')
          curl -s -u "$LF_USERNAME:$LF_PASSWORD" -H "$CRUMB" -X POST "https://jenkins.onap.org/job/lab-$JOB_NAME/buildWithParameters?SRC_BUILD_URL=$BUILD_URL&LOG_DIR_URL=http://onapci.org/logs/$JOB_NAME/$BUILD_NUMBER/"

- trigger:
    name: gerrit-trigger-patch-submitted
    triggers:
      - gerrit:
          server-name: 'gerrit.onap.org'
          trigger-on:
            - patchset-created-event:
                exclude-drafts: 'false'
                exclude-trivial-rebase: 'false'
                exclude-no-code-change: 'false'
            - draft-published-event
            - comment-added-contains-event:
                comment-contains-value: 'recheck'
          projects:
            - project-compare-type: 'ANT'
              project-pattern: '{project}'
              branches:
                - branch-compare-type: 'ANT'
                  branch-pattern: '**/{branch}'
              file-paths:
                - compare-type: 'ANT'
                  pattern: '{files}'