diff options
Diffstat (limited to 'jjb')
-rw-r--r-- | jjb/global/releng-macros.yaml | 95 | ||||
-rw-r--r-- | jjb/kuberef/kuberef-verify-jobs.yaml | 3 | ||||
-rw-r--r-- | jjb/nfvbench/nfvbench.yaml | 5 | ||||
-rw-r--r-- | jjb/opnfvdocs/opnfvdocs.yaml | 139 | ||||
-rw-r--r-- | jjb/releng/artifact-cleanup.yaml | 40 | ||||
-rw-r--r-- | jjb/releng/opnfv-lint.yaml | 82 | ||||
-rw-r--r-- | jjb/releng/opnfv-utils.yaml | 169 | ||||
-rw-r--r-- | jjb/releng/releng-jobs.yaml | 200 |
8 files changed, 242 insertions, 491 deletions
diff --git a/jjb/global/releng-macros.yaml b/jjb/global/releng-macros.yaml index 8a8bbaf16..89effa1c7 100644 --- a/jjb/global/releng-macros.yaml +++ b/jjb/global/releng-macros.yaml @@ -400,101 +400,6 @@ - report-build-result-to-gerrit - builder: - 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 - -- builder: - name: lint-report - builders: - - shell: | - #!/bin/bash - if [[ -s violation.log ]]; then - 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 - cmd="gerrit review -p $GERRIT_PROJECT -m \"$(cat violation.log)\" $GERRIT_PATCHSET_REVISION --notify NONE" - ssh -o 'PubkeyAcceptedKeyTypes +ssh-rsa' -p 29418 jenkins-ci@gerrit.opnfv.org "$cmd" - - # Make sure the caller job failed - exit 1 - fi - -- builder: - name: lint-bash-code - builders: - - shell: | - #!/bin/bash - echo "Checking bash code..." - for f in $(egrep '\.sh$' modified_files) - do - bash -n "$f" 2>> bash-violation.log - done - if [[ -s bash-violation.log ]]; then - echo -e "Bash syntax error(s)\n---" >> violation.log - sed -e 's/^/ /g' bash-violation.log >> violation.log - fi - -- builder: - name: lint-python-code - builders: - - shell: | - #!/bin/bash - - sudo apt-get -o DPkg::Lock::Timeout=300 update && \ - sudo DEBIAN_FRONTEND=noninteractive apt-get \ - -o DPkg::Lock::Timeout=300 dist-upgrade -y - sudo DEBIAN_FRONTEND=noninteractive \ - apt-get -o DPkg::Lock::Timeout=300 install flake8 -y - - echo "Checking python code..." - for f in $(egrep '\.py$' modified_files) - do - flake8 "$f" >> python-violation.log - done - if [[ -s python-violation.log ]]; then - echo -e "Python violation(s)\n---" >> violation.log - sed -e 's/^/ /g' python-violation.log >> violation.log - fi - -- builder: - name: lint-yaml-code - builders: - - shell: | - #!/bin/bash - - sudo apt-get -o DPkg::Lock::Timeout=300 update && \ - sudo DEBIAN_FRONTEND=noninteractive apt-get \ - -o DPkg::Lock::Timeout=300 dist-upgrade -y - sudo DEBIAN_FRONTEND=noninteractive \ - apt-get -o DPkg::Lock::Timeout=300 install yamllint -y - - echo "Checking yaml file..." - for f in $(egrep '\.ya?ml$' modified_files) - do - yamllint "$f" >> yaml-violation.log - done - if [[ -s yaml-violation.log ]]; then - echo -e "YAML violation(s)\n---" >> violation.log - sed -e 's/^/ /g' yaml-violation.log >> violation.log - fi - -- builder: - name: lint-all-code - builders: - - lint-init - - lint-bash-code - - lint-python-code - - lint-yaml-code - - lint-report - -- builder: name: clean-workspace builders: - shell: | diff --git a/jjb/kuberef/kuberef-verify-jobs.yaml b/jjb/kuberef/kuberef-verify-jobs.yaml index 92f29d096..cc55b1db8 100644 --- a/jjb/kuberef/kuberef-verify-jobs.yaml +++ b/jjb/kuberef/kuberef-verify-jobs.yaml @@ -5,9 +5,6 @@ stream: - master: branch: '{stream}' - - jerma: &jerma - branch: 'stable/{stream}' - disabled: false jobs: - '{project}-verify-lint-{stream}' diff --git a/jjb/nfvbench/nfvbench.yaml b/jjb/nfvbench/nfvbench.yaml index 5fd994d66..0976b8592 100644 --- a/jjb/nfvbench/nfvbench.yaml +++ b/jjb/nfvbench/nfvbench.yaml @@ -14,11 +14,6 @@ gs-pathname: '' docker-tag: 'latest' disabled: false - - gambia: - branch: 'stable/{stream}' - gs-pathname: '/{stream}' - docker-tag: 'stable' - disabled: false - parameter: name: nfvbench-parameter diff --git a/jjb/opnfvdocs/opnfvdocs.yaml b/jjb/opnfvdocs/opnfvdocs.yaml index a963d7726..3047a740e 100644 --- a/jjb/opnfvdocs/opnfvdocs.yaml +++ b/jjb/opnfvdocs/opnfvdocs.yaml @@ -1,113 +1,62 @@ --- -######################## -# Job configuration for opnfvdocs -######################## -- project: - - name: opnfvdocs - - project: '{name}' - - jobs: - - 'opnfvdocs-verify-shellcheck-{stream}' - - 'opnfvdocs-merge-shellcheck-{stream}' - - stream: - - master: - branch: '{stream}' - gs-pathname: '' - disabled: false - - nile: - branch: 'stable/{stream}' - gs-pathname: '/{stream}' - disabled: false - -######################## -# job templates -######################## - -- job-template: - name: 'opnfvdocs-verify-shellcheck-{stream}' - - disabled: '{obj:disabled}' - - parameters: - - project-parameter: - project: $GERRIT_PROJECT - branch: '{branch}' - - string: - name: GIT_CLONE_BASE - default: ssh://gerrit.opnfv.org:29418 - description: "Used for overriding the GIT URL coming from parameters macro." - - 'opnfv-build-defaults' - +- scm: + name: opnfvdocs-scm scm: - - git-scm-gerrit - + - git: + url: 'https://gerrit.opnfv.org/gerrit/opnfvdocs' + refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*' + branches: + - '{ref}' + +- builder: + name: opnfvdocs-lint-bash-code + builders: + - shell: | + #!/bin/bash + echo "Checking bash code..." + for f in $(egrep '\.sh$' modified_files) + do + bash -n "$f" 2>> bash-violation.log + done + if [[ -s bash-violation.log ]]; then + echo -e "Bash syntax error(s)\n---" >> violation.log + sed -e 's/^/ /g' bash-violation.log >> violation.log + fi + +- trigger: + name: opnfvdocs-patchset-created triggers: - gerrit: - server-name: 'gerrit.opnfv.org' trigger-on: - - patchset-created-event: - exclude-drafts: 'false' - exclude-trivial-rebase: 'false' - exclude-no-code-change: 'false' - - draft-published-event + - patchset-created-event - comment-added-contains-event: comment-contains-value: 'recheck' - comment-added-contains-event: comment-contains-value: 'reverify' projects: - - project-compare-type: 'REG_EXP' - project-pattern: '{project}' + - project-compare-type: 'ANT' + project-pattern: 'opnfvdocs' branches: - branch-compare-type: 'ANT' - branch-pattern: '**/{branch}' - skip-vote: - successful: true - failed: true - unstable: true - notbuilt: true - - builders: - - lint-bash-code + branch-pattern: master + - branch-compare-type: 'ANT' + branch-pattern: stable/nile - job-template: - name: 'opnfvdocs-merge-shellcheck-{stream}' - - disabled: '{obj:disabled}' - + name: opnfvdocs-verify-shellcheck parameters: - - project-parameter: - project: $GERRIT_PROJECT - branch: '{branch}' - - string: - name: GIT_CLONE_BASE - default: ssh://gerrit.opnfv.org:29418 - description: "Used for overriding the GIT URL coming from parameters macro." - - string: - name: GS_URL - default: '$GS_BASE{gs-pathname}' - description: "Directory where the build artifact will be located upon\ - \ the completion of the build." - - 'opnfv-build-defaults' - + - label: + name: node + default: opnfv-build scm: - - git-scm - + - opnfvdocs-scm: + ref: $GERRIT_REFSPEC triggers: - - gerrit: - server-name: 'gerrit.opnfv.org' - trigger-on: - - change-merged-event - - comment-added-contains-event: - comment-contains-value: 'remerge' - projects: - - project-compare-type: 'REG_EXP' - project-pattern: '{project}' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/{branch}' - + - opnfvdocs-patchset-created builders: - - lint-bash-code + - opnfvdocs-lint-bash-code + +- project: + name: opnfvdocs + jobs: + - opnfvdocs-verify-shellcheck diff --git a/jjb/releng/artifact-cleanup.yaml b/jjb/releng/artifact-cleanup.yaml deleted file mode 100644 index f64650b08..000000000 --- a/jjb/releng/artifact-cleanup.yaml +++ /dev/null @@ -1,40 +0,0 @@ ---- -- project: - name: releng-artifact-cleanup - - project: 'releng' - - jobs: - - 'releng-artifact-cleanup-daily-{stream}' - - stream: - - master: - branch: '{stream}' - gs-pathname: '' - - -- job-template: - name: 'releng-artifact-cleanup-daily-{stream}' - - # Job template for daily builders - # - # Required Variables: - # stream: branch with - in place of / (eg. stable) - # branch: branch (eg. stable) - disabled: false - - parameters: - - project-parameter: - project: '{project}' - branch: '{branch}' - - opnfv-build-defaults - - scm: - - git-scm - - triggers: - - timed: 'H H * * *' - - builders: - - shell: | - $WORKSPACE/utils/retention_script.sh diff --git a/jjb/releng/opnfv-lint.yaml b/jjb/releng/opnfv-lint.yaml deleted file mode 100644 index 173391596..000000000 --- a/jjb/releng/opnfv-lint.yaml +++ /dev/null @@ -1,82 +0,0 @@ ---- -######################## -# Job configuration for opnfv-lint -######################## -- project: - - name: opnfv-lint - - project: opnfv-lint - - jobs: - - 'opnfv-lint-verify-{stream}' - - stream: - - master: - branch: '{stream}' - gs-pathname: '' - disabled: false - - fraser: - branch: 'stable/{stream}' - gs-pathname: '/{stream}' - disabled: false - - danube: - branch: 'stable/{stream}' - gs-pathname: '/{stream}' - disabled: false - -######################## -# job templates -######################## - -- job-template: - name: 'opnfv-lint-verify-{stream}' - - disabled: '{obj:disabled}' - - concurrent: true - - parameters: - - project-parameter: - project: $GERRIT_PROJECT - branch: '{branch}' - - node: - name: SLAVE_NAME - description: Slaves to execute yamllint - default-slaves: - - lf-build6 - allowed-multiselect: true - ignore-offline-nodes: true - - scm: - - git-scm-gerrit - - triggers: - - gerrit: - server-name: 'gerrit.opnfv.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: 'REG_EXP' - project-pattern: 'releng' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/{branch}' - file-paths: - - compare-type: ANT - pattern: '**/*.py' - - compare-type: ANT - pattern: '**/*.sh' - - compare-type: ANT - pattern: '**/*.yml' - - compare-type: ANT - pattern: '**/*.yaml' - - builders: - - lint-all-code diff --git a/jjb/releng/opnfv-utils.yaml b/jjb/releng/opnfv-utils.yaml deleted file mode 100644 index 4a81c43bf..000000000 --- a/jjb/releng/opnfv-utils.yaml +++ /dev/null @@ -1,169 +0,0 @@ ---- -- project: - - name: opnfv-utils - - jobs: - - 'prune-docker-images' - - 'check-status-of-slaves' - - 'ansible-build-server' - - 'generate-artifacts-index-pages' - -######################## -# job templates -######################## -- job-template: - name: 'prune-docker-images' - - disabled: false - - concurrent: true - - parameters: - - node: - name: SLAVE_NAME - description: Slaves to prune docker images - default-slaves: - - lf-build6 - allowed-multiselect: true - ignore-offline-nodes: true - - builders: - - description-setter: - description: "Built on $NODE_NAME" - # yamllint disable rule:line-length - - shell: | - #!/bin/bash - sudo systemctl restart docker - (docker ps -q; docker ps -aq) | sort | uniq -u | xargs --no-run-if-empty docker rm - docker images -f dangling=true -q | xargs --no-run-if-empty docker rmi - - - # yamllint enable rule:line-length - triggers: - - timed: '@midnight' - -- job-template: - name: 'check-status-of-slaves' - - disabled: false - concurrent: true - - parameters: - - node: - name: SLAVE_NAME - description: 'script lives on master node' - default-slaves: - - lf-build6 - allowed-multiselect: false - ignore-offline-nodes: true - - project-parameter: - project: releng - branch: master - - scm: - - git-scm - - triggers: - - timed: '@midnight' - - builders: - - shell: | - cd $WORKSPACE/utils/ - bash slave-monitor-0.1.sh - -- job-template: - name: 'ansible-build-server' - - project-type: freestyle - - disabled: true - concurrent: true - - parameters: - - node: - name: SLAVE_NAME - description: Build Servers - default-slaves: - - lf-build6 - allowed-multiselect: true - ignore-offline-nodes: true - - project-parameter: - project: releng - branch: master - - scm: - - git-scm - - triggers: - - timed: '@midnight' - - builders: - - description-setter: - description: '$NODE_NAME' - - install-ansible - - run-ansible-build-server-playbook - - -- builder: - name: install-ansible - builders: - - shell: | - # Install ansible here - if [ -f /etc/centos-release ] \ - || [ -f /etc/redhat-release ] \ - || [ -f /etc/system-release ]; then - sudo yum -y install ansible - fi - if [ -f /etc/debian_version ] \ - || grep -qi ubuntu /etc/lsb-release \ - || grep -qi ubuntu /etc/os-release; then - sudo apt-get -y install ansible - fi - - -- builder: - name: run-ansible-build-server-playbook - builders: - - shell: | - # run playbook - sudo ansible-playbook -i \ - $WORKSPACE/utils/build-server-ansible/inventory.ini \ - $WORKSPACE/utils/build-server-ansible/main.yml - - -- job-template: - name: 'generate-artifacts-index-pages' - - project-type: freestyle - - disabled: false - - concurrent: false - - parameters: - - node: - name: SLAVE_NAME - description: Build Servers - default-slaves: - - lf-build6 - - project-parameter: - project: releng - branch: master - - scm: - - git-scm - - triggers: - - timed: '@hourly' - - builders: - - generate-artifact-html - - -- builder: - name: generate-artifact-html - builders: - - shell: | - cd $WORKSPACE/utils/ - ./artifacts.opnfv.org.sh diff --git a/jjb/releng/releng-jobs.yaml b/jjb/releng/releng-jobs.yaml index 9c2282f21..d8c4b3097 100644 --- a/jjb/releng/releng-jobs.yaml +++ b/jjb/releng/releng-jobs.yaml @@ -250,8 +250,6 @@ - job-template: name: 'releng-release-{stream}-merge' - triggers: - - releng-patchset-merged scm: - releng-scm: ref: $GERRIT_REFSPEC @@ -288,3 +286,201 @@ python3-ruamel.yaml -y - shell: !include-raw-escape: - branch-or-tag.sh + +- builder: + 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 + +- builder: + name: lint-report + builders: + - shell: | + #!/bin/bash + if [[ -s violation.log ]]; then + 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 + cmd="gerrit review -p $GERRIT_PROJECT -m \"$(cat violation.log)\" $GERRIT_PATCHSET_REVISION --notify NONE" + ssh -o 'PubkeyAcceptedKeyTypes +ssh-rsa' -p 29418 jenkins-ci@gerrit.opnfv.org "$cmd" + + # Make sure the caller job failed + exit 1 + fi + +- builder: + name: lint-bash-code + builders: + - shell: | + #!/bin/bash + echo "Checking bash code..." + for f in $(egrep '\.sh$' modified_files) + do + bash -n "$f" 2>> bash-violation.log + done + if [[ -s bash-violation.log ]]; then + echo -e "Bash syntax error(s)\n---" >> violation.log + sed -e 's/^/ /g' bash-violation.log >> violation.log + fi + +- builder: + name: lint-python-code + builders: + - shell: | + #!/bin/bash + + sudo apt-get -o DPkg::Lock::Timeout=300 update && \ + sudo DEBIAN_FRONTEND=noninteractive apt-get \ + -o DPkg::Lock::Timeout=300 dist-upgrade -y + sudo DEBIAN_FRONTEND=noninteractive \ + apt-get -o DPkg::Lock::Timeout=300 install flake8 -y + + echo "Checking python code..." + for f in $(egrep '\.py$' modified_files) + do + flake8 "$f" >> python-violation.log + done + if [[ -s python-violation.log ]]; then + echo -e "Python violation(s)\n---" >> violation.log + sed -e 's/^/ /g' python-violation.log >> violation.log + fi + +- builder: + name: lint-yaml-code + builders: + - shell: | + #!/bin/bash + + sudo apt-get -o DPkg::Lock::Timeout=300 update && \ + sudo DEBIAN_FRONTEND=noninteractive apt-get \ + -o DPkg::Lock::Timeout=300 dist-upgrade -y + sudo DEBIAN_FRONTEND=noninteractive \ + apt-get -o DPkg::Lock::Timeout=300 install yamllint -y + + echo "Checking yaml file..." + for f in $(egrep '\.ya?ml$' modified_files) + do + yamllint "$f" >> yaml-violation.log + done + if [[ -s yaml-violation.log ]]; then + echo -e "YAML violation(s)\n---" >> violation.log + sed -e 's/^/ /g' yaml-violation.log >> violation.log + fi + +- builder: + name: lint-all-code + builders: + - lint-init + - lint-bash-code + - lint-python-code + - lint-yaml-code + - lint-report + +- project: + name: releng-lint + jobs: + - 'releng-lint-verify' + +- job-template: + name: 'releng-lint-verify' + parameters: + - releng-jjb-node: + node: opnfv-build + scm: + - releng-scm: + ref: $GERRIT_REFSPEC + triggers: + - gerrit: + server-name: 'gerrit.opnfv.org' + trigger-on: + - patchset-created-event + - comment-added-contains-event: + comment-contains-value: recheck + - comment-added-contains-event: + comment-contains-value: reverify + projects: + - project-compare-type: 'ANT' + project-pattern: 'releng' + branches: + - branch-compare-type: 'ANT' + branch-pattern: 'master' + file-paths: + - compare-type: ANT + pattern: '**/*.py' + - compare-type: ANT + pattern: '**/*.sh' + - compare-type: ANT + pattern: '**/*.yml' + - compare-type: ANT + pattern: '**/*.yaml' + builders: + - lint-all-code + +- project: + name: releng-generate-artifacts-index-pages + jobs: + - releng-generate-artifacts-index-pages + +- job-template: + name: releng-generate-artifacts-index-pages + scm: + - releng-scm: + ref: master + parameters: + - releng-jjb-node: + node: opnfv-build + triggers: + - timed: '@daily' + builders: + - generate-artifact-html + +- builder: + name: generate-artifact-html + builders: + - shell: | + curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - + echo "deb https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee \ + /etc/apt/sources.list.d/google-cloud-sdk.list + sudo apt-get -o DPkg::Lock::Timeout=300 update && \ + sudo DEBIAN_FRONTEND=noninteractive apt-get \ + -o DPkg::Lock::Timeout=300 install \ + google-cloud-sdk s4cmd -y + cd $WORKSPACE/utils/ + ./artifacts.opnfv.org.sh + +- project: + name: releng-artifact-cleanup + jobs: + - releng-artifact-cleanup + +- job-template: + name: releng-artifact-cleanup + scm: + - releng-scm: + ref: master + parameters: + - releng-jjb-node: + node: opnfv-build + triggers: + - timed: '@daily' + builders: + - releng-artifact-cleanup + +- builder: + name: releng-artifact-cleanup + builders: + - shell: | + curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - + echo "deb https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee \ + /etc/apt/sources.list.d/google-cloud-sdk.list + sudo apt-get -o DPkg::Lock::Timeout=300 update && \ + sudo DEBIAN_FRONTEND=noninteractive apt-get \ + -o DPkg::Lock::Timeout=300 install \ + google-cloud-sdk s4cmd -y + $WORKSPACE/utils/retention_script.sh |