Merge "Jenkins not reporting lint results to gerrit"
[releng.git] / jjb / global / releng-macros.yml
index 68ec1b3..e58e1cf 100644 (file)
     name: lint-init
     builders:
       - shell: |
+          #!/bin/bash
           # Ensure we start with a clean environment
           rm -f bash-violation.log python-violation.log yaml-violation.log violation.log
-          git --no-pager diff --diff-filter=MCRAT --name-only HEAD^1) > modified_files
+          git --no-pager diff --diff-filter=MCRAT --name-only HEAD^1 > modified_files
 
 - builder:
     name: lint-report
     builders:
       - shell: |
+          #!/bin/bash
           if [[ -s violation.log ]]; then
-              echo "Reporting lint result..."
+              cat violation.log
+              echo "Reporting lint result...."
+              set -x
               msg="Found syntax error and/or coding style violation(s) in the files modified by your patchset."
-              sed -i -e '1s/^//$msg\n\n/' violation.log
+              sed -i -e "1s#^#${msg}\n\n#" violation.log
               cmd="gerrit review -p $GERRIT_PROJECT -m \"$(cat violation.log)\" $GERRIT_PATCHSET_REVISION --notify NONE"
               ssh -p 29418 gerrit.opnfv.org "$cmd"
 
     name: lint-bash-code
     builders:
       - shell: |
+          #!/bin/bash
           echo "Checking bash code..."
           for f in $(egrep '\.sh$' modified_files)
           do
     name: lint-python-code
     builders:
       - shell: |
-          # Install python packages
-          pip install "flake8==2.6.2"
+          #!/bin/bash
+          # Install python package
+          sudo pip install "flake8==2.6.2"
 
           echo "Checking python code..."
           for f in $(egrep '\.py$' modified_files)
     name: lint-yaml-code
     builders:
       - shell: |
-          # Install python packages
-          pip install "yamllint==1.8.2"
+          #!/bin/bash
+          # sudo Install python packages
+          sudo pip install "yamllint==1.8.2"
 
           echo "Checking yaml file..."
           for f in $(egrep '\.ya?ml$' modified_files)
       - email-ext:
           <<: *email_ptl_defaults
           recipients: >
-            hongbo.tianhongbo@huawei.com
+            georg.kunz@ericsson.com
 
 - publisher:
     name: 'email-dpacc-ptl'
       - email-ext:
           <<: *email_ptl_defaults
           recipients: >
-            jack.morgan@intel.com
+            zhang.jun3g@zte.com.cn
 - publisher:
     name: 'email-pharos-tools-ptl'
     <<: *email_pharos_ptl_defaults
       - email-ext:
           <<: *email_ptl_defaults
           recipients: >
-            ManuelBuilmbuil@suse.com
+            mbuil@suse.com
 
 - publisher:
     name: 'email-snaps-ptl'