X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=jjb%2Fglobal-macros.yaml;h=cdecdce3982968f952dc0897c3f4d85576bfb68b;hb=fdd0e07eff1b3717266f047c85a29a6c21c55ca5;hp=f3171a9a91579e29aead310b78a8fc192022b127;hpb=f6aa774a98755df06ad7decdec644fbe5e01108d;p=ci-management.git diff --git a/jjb/global-macros.yaml b/jjb/global-macros.yaml index f3171a9a9..cdecdce39 100644 --- a/jjb/global-macros.yaml +++ b/jjb/global-macros.yaml @@ -81,6 +81,14 @@ default: '{is-csit-vpp-job}' description: "Parameter is True if this is a CSIT vpp job." +- parameter: + name: stream-parameter + parameters: + - string: + name: STREAM + default: '{stream}' + description: "Stream job parameter to be used in shell scripts." + ##### SCMS - scm: @@ -329,3 +337,60 @@ variable: 'GLOBAL_SETTINGS_FILE' - file-id: '{settings-file}' variable: 'SETTINGS_FILE' + +- property: + name: fdio-infra-properties + properties: + - build-discarder: + days-to-keep: '{build-days-to-keep}' + num-to-keep: '{build-num-to-keep}' + + +- builder: + name: packer-validate + builders: + - config-file-provider: + files: + - file-id: 'packer-cloud-env' + variable: 'CLOUDENV' + - shell: | + #!/bin/bash + cd packer + varfiles="../packer/vars/*" + templates="../packer/templates/*" + provision="../packer/provision/*.sh" + for v in $varfiles; do + [[ "${v##*/}" =~ ^(cloud-env.*)$ ]] && continue + for t in $templates; do + export PACKER_LOG="yes" && \ + export PACKER_LOG_PATH="packer-validate-${v##*/}-${t##*/}.log" && \ + packer.io validate -var-file=$CLOUDENV \ + -var-file=$v $t + if [ $? -ne 0 ]; then + break + fi + done + done + for p in $provision; do + /bin/bash -n $p > provision-validate-${p##*/}.log 2>&1 + if [ $? -ne 0 ]; then + break + fi + done + + +- builder: + name: packer-build + builders: + - config-file-provider: + files: + - file-id: 'packer-cloud-env' + variable: 'CLOUDENV' + - shell: | + #!/bin/bash + cd packer + export PACKER_LOG="yes" && \ + export PACKER_LOG_PATH="packer-build.log" && \ + packer.io build -var-file=$CLOUDENV \ + -var-file=../packer/vars/{platform}.json \ + ../packer/templates/{template}.json