X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fglobal%2Freleng-macros.yml;h=89909b0090c7d9151bf8701080ed9b2c81d4be73;hb=76d12ac2d4bfd964f8a2851983aaa0098df380d8;hp=cd92480d482571817f0216474a9ba9849838933f;hpb=c6311f43a1d0bb366f9a789af49beb8c1fd9779e;p=releng.git diff --git a/jjb/global/releng-macros.yml b/jjb/global/releng-macros.yml index cd92480d4..89909b009 100644 --- a/jjb/global/releng-macros.yml +++ b/jjb/global/releng-macros.yml @@ -1,4 +1,15 @@ -# OLD Releng macros +# Releng macros +# +# NOTE: make sure macros are listed in execution ordered. +# +# 1. parameters/properties +# 2. scm +# 3. triggers +# 4. wrappers +# 5. prebuilders (maven only, configured like Builders) +# 6. builders (maven, freestyle, matrix, etc..) +# 7. postbuilders (maven only, configured like Builders) +# 8. publishers/reporters/notifications - parameter: name: project-parameter @@ -24,12 +35,14 @@ default: '{branch}' description: "JJB configured GERRIT_BRANCH parameter" -- wrapper: - name: ssh-agent-wrapper - wrappers: - - ssh-agent-credentials: - users: - - 'd42411ac011ad6f3dd2e1fa34eaa5d87f910eb2e' +- property: + name: logrotate-default + properties: + - build-discarder: + days-to-keep: 60 + num-to-keep: 200 + artifact-days-to-keep: 60 + artifact-num-to-keep: 200 - scm: name: git-scm @@ -59,6 +72,7 @@ triggers: - timed: '' +# NOTE: unused macro, but we may use this for some jobs. - trigger: name: gerrit-trigger-patch-submitted triggers: @@ -79,6 +93,7 @@ - branch-compare-type: 'ANT' branch-pattern: '**/{branch}' +# NOTE: unused macro, but we may use this for some jobs. - trigger: name: gerrit-trigger-patch-merged triggers: @@ -95,16 +110,36 @@ - branch-compare-type: 'ANT' branch-pattern: '**/{branch}' -- publisher: - name: archive-artifacts - publishers: - - archive: - artifacts: '{artifacts}' - allow-empty: true - fingerprint: true - latest-only: true +- trigger: + name: 'experimental' + triggers: + - gerrit: + server-name: 'gerrit.opnfv.org' + trigger-on: + - comment-added-contains-event: + comment-contains-value: 'check-experimental' + projects: + - project-compare-type: 'ANT' + project-pattern: '{project}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + file-paths: + - compare-type: 'ANT' + pattern: 'tests/**' + skip-vote: + successful: true + failed: true + unstable: true + notbuilt: true + silent-start: true -# New Releng macros +- wrapper: + name: ssh-agent-wrapper + wrappers: + - ssh-agent-credentials: + users: + - 'd42411ac011ad6f3dd2e1fa34eaa5d87f910eb2e' - builder: name: build-html-and-pdf-docs-output @@ -355,3 +390,45 @@ name: check-bash-syntax builders: - shell: "find . -name '*.sh' | xargs bash -n" + +- builder: + name: lint-yaml-code + builders: + - shell: | + #!/bin/bash + set -o errexit + set -o pipefail + set -o xtrace + export PATH=$PATH:/usr/local/bin/ + + # install python packages + pip install "yamllint==1.6.0" + + # generate and upload lint log + echo "Running yaml code on $PROJECT ..." + + # Ensure we start with a clean environment + rm -f yaml-violation.log lint.log + + # Get number of yaml violations. If none, this will be an + # empty string: "" + find . \ + -type f -name "*.yml" -print \ + -o -name "*.yaml" -print | \ + xargs yamllint > yaml-violation.log || true + + if [ -s "yaml-violation.log" ]; then + SHOWN=$(cat yaml-violation.log| grep -v "^$" |wc -l) + echo -e "First $SHOWN shown\n---" > lint.log + cat yaml-violation.log >> lint.log + sed -r -i '4,$s/^/ /g' lint.log + fi + +- publisher: + name: archive-artifacts + publishers: + - archive: + artifacts: '{artifacts}' + allow-empty: true + fingerprint: true + latest-only: true