apex: fixes daily and brahm trigger
[releng.git] / jjb / apex / apex.yml
1 - project:
2     name: apex
3     jobs:
4         - 'apex-verify-{stream}'
5         - 'apex-merge-{stream}'
6         - 'apex-build-{stream}'
7         - 'apex-deploy-virtual-{scenario}-{stream}'
8         - 'apex-deploy-baremetal-{scenario}-{stream}'
9         - 'apex-daily-{stream}'
10
11     # stream:    branch with - in place of / (eg. stable-arno)
12     # branch:    branch (eg. stable/arno)
13     stream:
14         - master:
15             branch: 'master'
16             gs-pathname: ''
17         - brahmaputra:
18             branch: 'stable/brahmaputra'
19             gs-pathname: '/brahmaputra'
20             disabled: true
21
22     project: 'apex'
23
24     scenario:
25          - 'os-odl_l2-nofeature-ha'
26          - 'os-odl_l2-sfc-ha'
27          - 'os-odl_l3-nofeature-ha'
28          - 'os-onos-nofeature-ha'
29          - 'os-opencontrail-nofeature-ha'
30
31 - job-template:
32     name: 'apex-verify-{stream}'
33
34     node: opnfv-jump-1
35
36     parameters:
37         - apex-parameter:
38             gs-pathname: '{gs-pathname}'
39         - project-parameter:
40             project: '{project}'
41         - gerrit-parameter:
42             branch: '{branch}'
43         - string:
44             name: GIT_BASE
45             default: https://gerrit.opnfv.org/gerrit/$PROJECT
46             description: "Used for overriding the GIT URL coming from parameters macro."
47
48     scm:
49         - gerrit-trigger-scm:
50             credentials-id: '{ssh-credentials}'
51             refspec: '$GERRIT_REFSPEC'
52             choosing-strategy: 'gerrit'
53
54     triggers:
55         - gerrit:
56             trigger-on:
57                 - patchset-created-event:
58                     exclude-drafts: 'false'
59                     exclude-trivial-rebase: 'false'
60                     exclude-no-code-change: 'false'
61                 - draft-published-event
62                 - comment-added-contains-event:
63                     comment-contains-value: 'recheck'
64                 - comment-added-contains-event:
65                     comment-contains-value: 'reverify'
66             projects:
67               - project-compare-type: 'ANT'
68                 project-pattern: 'apex'
69                 branches:
70                   - branch-compare-type: 'ANT'
71                     branch-pattern: '**/{branch}'
72                 file-paths:
73                   - compare-type: ANT
74                     pattern: 'ci/**'
75                   - compare-type: ANT
76                     pattern: 'build/**'
77                   - compare-type: ANT
78                     pattern: 'lib/**'
79                   - compare-type: ANT
80                     pattern: 'config/**'
81                 forbidden-file-paths:
82                   - compare-type: ANT
83                     pattern: 'docs/**'
84
85     properties:
86         - build-blocker:
87             use-build-blocker: true
88             blocking-jobs:
89                 - "apex-daily.*"
90                 - "apex-deploy.*"
91                 - "apex-build.*"
92
93     builders:
94         - 'apex-build'
95         - trigger-builds:
96           - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream}'
97             predefined-parameters:
98               BUILD_DIRECTORY=apex-verify-master/build_output
99             git-revision: false
100             block: true
101         - trigger-builds:
102           - project: 'apex-deploy-virtual-os-onos-nofeature-ha-{stream}'
103             predefined-parameters:
104               BUILD_DIRECTORY=apex-verify-master/build_output
105             git-revision: false
106             block: true
107         - 'apex-workspace-cleanup'
108
109 - job-template:
110     name: 'apex-merge-{stream}'
111
112     # builder-merge job to run JJB update
113     #
114     # This job's purpose is to update all the JJB
115
116     node: opnfv-jump-1
117
118     disabled: true
119
120     parameters:
121         - apex-parameter:
122             gs-pathname: '{gs-pathname}'
123         - project-parameter:
124             project: '{project}'
125         - gerrit-parameter:
126             branch: '{branch}'
127         - string:
128             name: GIT_BASE
129             default: https://gerrit.opnfv.org/gerrit/$PROJECT
130             description: "Used for overriding the GIT URL coming from parameters macro."
131
132     scm:
133         - gerrit-trigger-scm:
134             credentials-id: '{ssh-credentials}'
135             refspec: ''
136             choosing-strategy: 'default'
137
138     triggers:
139         - gerrit:
140             trigger-on:
141                 - change-merged-event
142                 - comment-added-contains-event:
143                     comment-contains-value: 'remerge'
144             projects:
145               - project-compare-type: 'ANT'
146                 project-pattern: 'apex'
147                 branches:
148                     - branch-compare-type: 'ANT'
149                       branch-pattern: '**/master'
150                 forbidden-file-paths:
151                   - compare-type: ANT
152                     pattern: 'docs/**'
153
154     builders:
155         - 'apex-build'
156         - 'apex-deploy-virtual'
157         - 'apex-workspace-cleanup'
158
159 - job-template:
160     name: 'apex-build-{stream}'
161
162     # Job template for builds
163     #
164     # Required Variables:
165     #     stream:    branch with - in place of / (eg. stable)
166     #     branch:    branch (eg. stable)
167     node: opnfv-jump-1
168
169     disabled: false
170
171     parameters:
172         - project-parameter:
173             project: '{project}'
174         - apex-parameter:
175             gs-pathname: '{gs-pathname}'
176         - gerrit-parameter:
177             branch: '{branch}'
178         - string:
179             name: GIT_BASE
180             default: https://gerrit.opnfv.org/gerrit/$PROJECT
181             description: "Used for overriding the GIT URL coming from parameters macro."
182
183     scm:
184         - git-scm:
185             credentials-id: '{ssh-credentials}'
186             refspec: ''
187             branch: '{branch}'
188
189     properties:
190         - build-blocker:
191             use-build-blocker: true
192             blocking-jobs:
193                 - "apex-deploy.*"
194
195     builders:
196         - 'apex-build'
197         - trigger-builds:
198           - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream}'
199             predefined-parameters:
200               BUILD_DIRECTORY=apex-build-master/build_output
201             git-revision: false
202             block: true
203         - 'apex-upload-artifact'
204
205 - job-template:
206     name: 'apex-deploy-virtual-{scenario}-{stream}'
207
208     # Job template for virtual deployment
209     #
210     # Required Variables:
211     #     stream:    branch with - in place of / (eg. stable)
212     #     branch:    branch (eg. stable)
213     node: opnfv-jump-1
214
215     disabled: false
216
217     scm:
218         - git-scm:
219             credentials-id: '{ssh-credentials}'
220             refspec: ''
221             branch: '{branch}'
222
223     parameters:
224         - project-parameter:
225             project: '{project}'
226         - apex-parameter:
227             gs-pathname: '{gs-pathname}'
228         - string:
229             name: DEPLOY_SCENARIO
230             default: '{scenario}'
231             description: "Scenario to deploy with."
232
233     properties:
234         - build-blocker:
235             use-build-blocker: true
236             blocking-jobs:
237                 - "apex-deploy.*"
238
239     builders:
240         - 'apex-deploy-virtual'
241         - 'apex-workspace-cleanup'
242
243 - job-template:
244     name: 'apex-deploy-baremetal-{scenario}-{stream}'
245
246     # Job template for baremetal deployment
247     #
248     # Required Variables:
249     #     stream:    branch with - in place of / (eg. stable)
250     #     branch:    branch (eg. stable)
251     node: opnfv-jump-1
252
253     disabled: false
254
255     scm:
256         - git-scm:
257             credentials-id: '{ssh-credentials}'
258             refspec: ''
259             branch: '{branch}'
260
261     parameters:
262         - project-parameter:
263             project: '{project}'
264         - apex-parameter:
265             gs-pathname: '{gs-pathname}'
266         - string:
267             name: DEPLOY_SCENARIO
268             default: '{scenario}'
269             description: "Scenario to deploy with."
270
271     properties:
272         - build-blocker:
273             use-build-blocker: true
274             blocking-jobs:
275                 - "apex-verify.*"
276                 - "apex-deploy.*"
277                 - "apex-build.*"
278
279
280     builders:
281         - 'apex-deploy-baremetal'
282         - 'apex-workspace-cleanup'
283
284 - job-template:
285     name: 'apex-daily-{stream}'
286
287     # Job template for daily build
288     #
289     # Required Variables:
290     #     stream:    branch with - in place of / (eg. stable)
291     #     branch:    branch (eg. stable)
292     node: opnfv-jump-1
293
294     disabled: false
295
296     scm:
297         - git-scm:
298             credentials-id: '{ssh-credentials}'
299             refspec: ''
300             branch: '{branch}'
301
302     parameters:
303         - project-parameter:
304             project: '{project}'
305         - apex-parameter:
306             gs-pathname: '{gs-pathname}'
307
308     properties:
309         - build-blocker:
310             use-build-blocker: true
311             blocking-jobs:
312                 - "apex-verify.*"
313                 - "apex-deploy.*"
314                 - "apex-build.*"
315
316     triggers:
317         - 'apex-{stream}'
318
319     builders:
320         - trigger-builds:
321           - project: 'apex-build-{stream}'
322             git-revision: true
323             current-parameters: true
324             block: true
325         - trigger-builds:
326           - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream}'
327             predefined-parameters:
328               BUILD_DIRECTORY=apex-build-master/build_output
329             git-revision: true
330             block: true
331         - trigger-builds:
332           - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
333             block: true
334             block-thresholds:
335                 build-step-failure-threshold: 'never'
336                 failure-threshold: 'never'
337                 unstable-threshold: 'FAILURE'
338         - trigger-builds:
339           - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
340             block: true
341             block-thresholds:
342                 build-step-failure-threshold: 'never'
343                 failure-threshold: 'never'
344                 unstable-threshold: 'FAILURE'
345         - trigger-builds:
346           - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream}'
347             predefined-parameters:
348               BUILD_DIRECTORY=apex-build-master/build_output
349             git-revision: true
350             block: true
351         - trigger-builds:
352           - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
353             block: true
354             block-thresholds:
355                 build-step-failure-threshold: 'never'
356                 failure-threshold: 'never'
357                 unstable-threshold: 'FAILURE'
358         - trigger-builds:
359           - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
360             block: true
361             block-thresholds:
362                 build-step-failure-threshold: 'never'
363                 failure-threshold: 'never'
364                 unstable-threshold: 'FAILURE'
365
366 ########################
367 # parameter macros
368 ########################
369 - parameter:
370     name: apex-parameter
371     parameters:
372         - string:
373             name: ARTIFACT_NAME
374             default: 'latest'
375             description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
376         - string:
377             name: ARTIFACT_VERSION
378             default: 'daily'
379             description: "Artifact version type"
380         - string:
381             name: BUILD_DIRECTORY
382             default: $WORKSPACE/build_output
383             description: "Directory where the build artifact will be located upon the completion of the build."
384         - string:
385             name: CACHE_DIRECTORY
386             default: $HOME/opnfv/cache{gs-pathname}
387             description: "Directory where the cache to be used during the build is located."
388         - string:
389             name: GIT_BASE
390             default: https://gerrit.opnfv.org/gerrit/$PROJECT
391             description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
392         - string:
393             name: GS_URL
394             default: artifacts.opnfv.org/$PROJECT{gs-pathname}
395             description: "URL to Google Storage."
396
397 ########################
398 # builder macros
399 ########################
400 - builder:
401     name: 'apex-build'
402     builders:
403         - shell: |
404             #!/bin/bash
405             set -o errexit
406             set -o nounset
407             set -o pipefail
408             # log info to console
409             echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
410             echo "---------------------------------------------------------------------------------------"
411             echo
412             # create the cache directory if it doesn't exist
413             [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
414             # set OPNFV_ARTIFACT_VERSION
415             if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
416               export OPNFV_ARTIFACT_VERSION="bramaputra.1.rc0"
417             else
418               if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
419                 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
420               elif [ "$ARTIFACT_VERSION" == "daily" ]; then
421                 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
422               else
423                 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
424               fi
425             fi
426             # start the build
427             cd $WORKSPACE/ci
428             ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
429             RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
430             # list the contents of BUILD_OUTPUT directory
431             ls -al $BUILD_DIRECTORY
432             # save information regarding artifact into file
433             (
434                 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
435                 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
436                 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
437                 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
438                 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
439                 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
440                 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
441                 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
442                 echo "OPNFV_BUILD_URL=$BUILD_URL"
443             ) > $WORKSPACE/opnfv.properties
444             echo
445             echo "--------------------------------------------------------"
446
447 - builder:
448     name: 'apex-workspace-cleanup'
449     builders:
450         - shell: |
451             #!/bin/bash
452             set -o errexit
453             set -o nounset
454             set -o pipefail
455
456             # delete everything that is in $WORKSPACE
457             /bin/rm -rf $WORKSPACE
458
459 - builder:
460     name: 'apex-upload-artifact'
461     builders:
462         - shell: |
463             #!/bin/bash
464             set -o errexit
465             set -o nounset
466             set -o pipefail
467
468             # log info to console
469             echo "Uploading the Apex artifact. This could take some time..."
470             echo "--------------------------------------------------------"
471             echo
472
473             # source the opnfv.properties to get ARTIFACT_VERSION
474             source $WORKSPACE/opnfv.properties
475
476             # upload artifact and additional files to google storage
477             gsutil cp $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
478             RPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL)
479             RPM_LIST=$RPM_INSTALL_PATH
480             for pkg in common undercloud; do
481                 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
482             done
483             SRPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL)
484             SRPM_LIST=$SRPM_INSTALL_PATH
485             for pkg in common undercloud; do
486                 SRPM_LIST+=" ${SRPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
487             done
488             for artifact in $RPM_LIST $SRPM_LIST; do
489               gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
490             done
491             gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
492             gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
493
494             echo
495             echo "--------------------------------------------------------"
496             echo "Done!"
497             echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
498             echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
499
500 - builder:
501     name: 'apex-deploy-virtual'
502     builders:
503         - shell: |
504             #!/bin/bash
505             set -o errexit
506             set -o nounset
507             set -o pipefail
508
509             # log info to console
510             echo "Starting the Apex virtual deployment."
511             echo "--------------------------------------------------------"
512             echo
513
514             if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
515                 # if artifact name is passed the pull a
516                 # specific artifact from artifacts.opnfv.org
517                 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
518             else
519                 if [[ $BUILD_DIRECTORY == *verify* ]]; then
520                   BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
521                   echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
522                 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
523                   BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
524                   echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
525                 fi
526
527                 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
528                     # if opnfv.properties exists then use the
529                     # local build. Source the file so we get local OPNFV vars
530                     source ${BUILD_DIRECTORY}/../opnfv.properties
531                     RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
532                 else
533                     if [[ $BUILD_DIRECTORY == *verify* ]]; then
534                       echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
535                       echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
536                       exit 1
537                     elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
538                       echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
539                       echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
540                       exit 1
541                     fi
542                     # no opnfv.properties means use the latest from artifacts.opnfv.org
543                     # get the latest.properties to get the link to the latest artifact
544                     curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
545                     [[ -f opnfv.properties ]] || exit 1
546                     # source the file so we get OPNFV vars
547                     source opnfv.properties
548                     RPM_INSTALL_PATH=$OPNFV_RPM_URL
549                 fi
550             fi
551
552             RPM_LIST=$RPM_INSTALL_PATH
553             for pkg in common undercloud; do
554                 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
555             done
556
557             # update / install the new rpm
558             if rpm -q opnfv-apex > /dev/null; then
559                if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
560                  echo "RPM is already installed"
561                elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
562                    if ! sudo yum downgrade -y $RPM_LIST; then
563                      sudo yum remove -y opnfv-undercloud opnfv-common
564                      sudo yum downgrade -y $RPM_INSTALL_PATH
565                    fi
566                fi
567             else
568                sudo yum install -y $RPM_LIST;
569             fi
570
571             # cleanup virtual machines before we start
572             sudo opnfv-clean
573             # initiate virtual deployment
574             if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
575               if [ -n "$DEPLOY_SCENARIO" ]; then
576                 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
577                 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
578                   sudo opnfv-deploy -v -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml -n /etc/opnfv-apex/network_settings.yaml
579                 else
580                   echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
581                   exit 1
582                 fi
583               else
584                 echo "Deploy scenario not set!"
585                 exit 1
586               fi
587             else
588               sudo opnfv-deploy -v
589             fi
590             echo
591             echo "--------------------------------------------------------"
592             echo "Done!"
593
594 - builder:
595     name: 'apex-deploy-baremetal'
596     builders:
597         - shell: |
598             #!/bin/bash
599             set -o errexit
600             set -o nounset
601             set -o pipefail
602
603             # log info to console
604             echo "Starting the Apex baremetal deployment."
605             echo "--------------------------------------------------------"
606             echo
607
608             if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
609                 # if artifact name is passed the pull a
610                 # specific artifact from artifacts.opnfv.org
611                 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
612             else
613                 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
614                   BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
615                   echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
616                 fi
617                 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
618                     # if opnfv.properties exists then use the
619                     # local build. Source the file so we get local OPNFV vars
620                     source ${BUILD_DIRECTORY}/../opnfv.properties
621                     RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
622                 else
623                     # no opnfv.properties means use the latest from artifacts.opnfv.org
624                     # get the latest.properties to get the link to the latest artifact
625                     curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
626                     [[ -f opnfv.properties ]] || exit 1
627                     # source the file so we get OPNFV vars
628                     source opnfv.properties
629                     RPM_INSTALL_PATH=$OPNFV_RPM_URL
630                 fi
631             fi
632
633             if [ ! -e "$RPM_INSTALL_PATH" ]; then
634                RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
635             fi
636
637             RPM_LIST=$RPM_INSTALL_PATH
638             for pkg in common undercloud; do
639                 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
640             done
641
642             # update / install the new rpm
643             if rpm -q opnfv-apex > /dev/null; then
644                if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
645                  echo "RPM is already installed"
646                elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
647                    if ! sudo yum downgrade -y $RPM_LIST; then
648                      sudo yum remove -y opnfv-undercloud opnfv-common
649                      sudo yum downgrade -y $RPM_INSTALL_PATH
650                    fi
651                fi
652             else
653                sudo yum install -y $RPM_LIST;
654             fi
655
656             # cleanup environment before we start
657             sudo opnfv-clean
658             # initiate baremetal deployment
659             if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
660               if [ -n "$DEPLOY_SCENARIO" ]; then
661                 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
662                 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
663                   sudo opnfv-deploy -i  /root/inventory/pod_settings.yaml \
664                   -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
665                   -n /root/network_settings.yaml
666                 else
667                   echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
668                   exit 1
669                 fi
670               else
671                 echo "Deploy scenario not set!"
672                 exit 1
673               fi
674             else
675               echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
676               exit 1
677             fi
678
679             echo
680             echo "--------------------------------------------------------"
681             echo "Done!"
682
683 #######################
684 # trigger macros
685 ########################
686 - trigger:
687     name: 'apex-master'
688     triggers:
689         - timed: '0 3 * * *'
690 - trigger:
691     name: 'apex-brahmaputra'
692     triggers:
693         - timed: '0 6 * * 2050'