From 35692a3184704c93549a953b3b33e3b5fb119060 Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Wed, 28 Feb 2018 16:31:20 +0800 Subject: simplify automate jjb definition using releng_macro 1. leveraging macro gerrit-trigger-patchset-created 2. leveraging macro gerrit-trigger-change-merged 3. rename automate to testresults-automate Change-Id: I3dfee8dad28db7e818b912fed6d65b60b3f96391 Signed-off-by: SerenaFeng --- jjb/releng/automate.yml | 276 ------------------------------------ jjb/releng/testresults-automate.yml | 249 ++++++++++++++++++++++++++++++++ 2 files changed, 249 insertions(+), 276 deletions(-) delete mode 100644 jjb/releng/automate.yml create mode 100644 jjb/releng/testresults-automate.yml diff --git a/jjb/releng/automate.yml b/jjb/releng/automate.yml deleted file mode 100644 index 6bd952a1d..000000000 --- a/jjb/releng/automate.yml +++ /dev/null @@ -1,276 +0,0 @@ ---- -- project: - name: utils-automate - stream: - - master: - branch: '{stream}' - - module: - - 'testapi' - - 'reporting' - - phase: - - 'docker-deploy': - slave-label: 'testresults' - - 'generate-doc' - - jobs: - - '{module}-automate-{stream}' - - '{module}-automate-{phase}-{stream}' - - '{module}-verify-{stream}' - - project: 'releng-testresults' - -- job: - name: 'testapi-mongodb-backup' - - parameters: - - label: - name: SLAVE_LABEL - default: 'testresults' - description: 'Slave label on Jenkins' - - project-parameter: - project: 'releng-testresults' - branch: 'master' - - string: - name: GIT_BASE - default: https://gerrit.opnfv.org/gerrit/releng-testresults - description: 'Git URL to use on this Jenkins Slave' - - scm: - - git-scm - - triggers: - - timed: '@weekly' - - builders: - - mongodb-backup - - publishers: - - email: - recipients: serena.feng.711@gmail.com - notify-every-unstable-build: true - send-to-individuals: true - -- job-template: - name: '{module}-verify-{stream}' - - parameters: - - project-parameter: - project: '{project}' - branch: '{branch}' - - 'opnfv-build-ubuntu-defaults' - - 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' - - comment-added-contains-event: - comment-contains-value: 'reverify' - projects: - - project-compare-type: 'ANT' - project-pattern: '{project}' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/{branch}' - file-paths: - - compare-type: 'ANT' - pattern: '{module}/**' - - builders: - - shell: | - cd {module}/ - tox - if [ -e *.xml ];then - cp *.xml $WORKSPACE - fi - - publishers: - - publish-coverage - - email-jenkins-admins-on-failure - -- job-template: - name: '{module}-automate-{stream}' - - project-type: multijob - - properties: - - throttle: - enabled: true - max-total: 1 - max-per-node: 1 - option: 'project' - - parameters: - - project-parameter: - project: '{project}' - branch: '{branch}' - - string: - name: DOCKER_TAG - default: 'latest' - description: 'Tag name for {module} docker image' - - string: - name: MODULE_NAME - default: '{module}' - description: "Name of the module" - - 'opnfv-build-defaults' - - scm: - - git-scm - - wrappers: - - ssh-agent-wrapper - - timeout: - timeout: 360 - fail: true - - triggers: - - gerrit: - server-name: 'gerrit.opnfv.org' - trigger-on: - - change-merged-event - - comment-added-contains-event: - comment-contains-value: 'remerge' - projects: - - project-compare-type: 'ANT' - project-pattern: '{project}' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/{branch}' - file-paths: - - compare-type: 'ANT' - pattern: '{module}/**' - - builders: - - description-setter: - description: "Built on $NODE_NAME" - - docker-update - - multijob: - name: docker-deploy - condition: SUCCESSFUL - projects: - - name: '{module}-automate-docker-deploy-{stream}' - current-parameters: false - predefined-parameters: | - GIT_BASE=$GIT_BASE - node-label-name: SLAVE_LABEL - node-label: testresults - kill-phase-on: FAILURE - abort-all-job: true - - multijob: - name: generate-doc - condition: SUCCESSFUL - projects: - - name: '{module}-automate-generate-doc-{stream}' - current-parameters: true - kill-phase-on: FAILURE - abort-all-job: true - - publishers: - - 'email-publisher' - - email-jenkins-admins-on-failure - -- job-template: - name: '{module}-automate-{phase}-{stream}' - - properties: - - throttle: - enabled: true - max-per-node: 1 - option: 'project' - - parameters: - - project-parameter: - project: '{project}' - branch: '{branch}' - - wrappers: - - ssh-agent-wrapper - - timeout: - timeout: 120 - fail: true - - scm: - - git-scm - - builders: - - description-setter: - description: "Built on $NODE_NAME" - - '{module}-automate-{phase}-macro' - -################################ -# job builders -################################ -- builder: - name: 'docker-update' - builders: - - shell: | - bash ./ci/docker-update.sh - -- builder: - name: 'testapi-automate-generate-doc-macro' - builders: - - 'testapi-doc-build' - - 'upload-doc-artifact' - -- builder: - name: 'testapi-doc-build' - builders: - - shell: | - bash ./ci/htmlize/doc-build.sh - -- builder: - name: 'upload-doc-artifact' - builders: - - shell: | - bash ./ci/htmlize/push-doc-artifacts.sh - -- builder: - name: 'reporting-automate-generate-doc-macro' - builders: - - shell: echo "To Be Done" - -- builder: - name: 'testapi-automate-docker-deploy-macro' - builders: - - shell: | - sudo bash ./ci/docker-deploy.sh "sudo docker run -dti --name testapi -p 8082:8000 - -e mongodb_url=mongodb://172.17.0.1:27017 - -e base_url=http://testresults.opnfv.org/test opnfv/testapi" \ - "http://testresults.opnfv.org/test/" "testapi" - -- builder: - name: 'reporting-automate-docker-deploy-macro' - builders: - - shell: | - sudo bash ./ci/docker-deploy.sh \ - "sudo docker run -itd --name reporting -p 8084:8000 opnfv/reporting" \ - "http://testresults.opnfv.org/reporting/index.html" "reporting" - -- builder: - name: mongodb-backup - builders: - - shell: - bash ./ci/testapi-backup-mongodb.sh - -################################ -# job publishers -################################ - -- publisher: - name: 'email-publisher' - publishers: - - email: - recipients: rohitsakala@gmail.com feng.xiaowei@zte.com.cn morgan.richomme@orange.com - notify-every-unstable-build: false - send-to-individuals: true diff --git a/jjb/releng/testresults-automate.yml b/jjb/releng/testresults-automate.yml new file mode 100644 index 000000000..c491e01c5 --- /dev/null +++ b/jjb/releng/testresults-automate.yml @@ -0,0 +1,249 @@ +--- +- project: + name: testresults-automate + stream: + - master: + branch: '{stream}' + + module: + - 'testapi' + - 'reporting' + + phase: + - 'docker-deploy': + slave-label: 'testresults' + - 'generate-doc' + + jobs: + - '{module}-automate-{stream}' + - '{module}-automate-{phase}-{stream}' + - '{module}-verify-{stream}' + + project: 'releng-testresults' + +- job: + name: 'testapi-mongodb-backup' + + parameters: + - label: + name: SLAVE_LABEL + default: 'testresults' + description: 'Slave label on Jenkins' + - project-parameter: + project: 'releng-testresults' + branch: 'master' + - string: + name: GIT_BASE + default: https://gerrit.opnfv.org/gerrit/releng-testresults + description: 'Git URL to use on this Jenkins Slave' + + scm: + - git-scm + + triggers: + - timed: '@weekly' + + builders: + - mongodb-backup + + publishers: + - email: + recipients: serena.feng.711@gmail.com + notify-every-unstable-build: true + send-to-individuals: true + +- job-template: + name: '{module}-verify-{stream}' + + parameters: + - project-parameter: + project: '{project}' + branch: '{branch}' + - 'opnfv-build-ubuntu-defaults' + + scm: + - git-scm-gerrit + + triggers: + - gerrit-trigger-patchset-created: + server: 'gerrit.opnfv.org' + project: '**' + branch: '{branch}' + files: '{module}/**' + + builders: + - shell: | + cd {module}/ + tox + if [ -e *.xml ];then + cp *.xml $WORKSPACE + fi + + publishers: + - publish-coverage + - email-jenkins-admins-on-failure + +- job-template: + name: '{module}-automate-{stream}' + + project-type: multijob + + properties: + - throttle: + enabled: true + max-total: 1 + max-per-node: 1 + option: 'project' + + parameters: + - project-parameter: + project: '{project}' + branch: '{branch}' + - string: + name: DOCKER_TAG + default: 'latest' + description: 'Tag name for {module} docker image' + - string: + name: MODULE_NAME + default: '{module}' + description: "Name of the module" + - 'opnfv-build-defaults' + + scm: + - git-scm + + wrappers: + - ssh-agent-wrapper + - timeout: + timeout: 360 + fail: true + + triggers: + - gerrit-trigger-change-merged: + project: '**' + branch: '{branch}' + files: '{module}/**' + + builders: + - description-setter: + description: "Built on $NODE_NAME" + - docker-update + - multijob: + name: docker-deploy + condition: SUCCESSFUL + projects: + - name: '{module}-automate-docker-deploy-{stream}' + current-parameters: false + predefined-parameters: | + GIT_BASE=$GIT_BASE + node-label-name: SLAVE_LABEL + node-label: testresults + kill-phase-on: FAILURE + abort-all-job: true + - multijob: + name: generate-doc + condition: SUCCESSFUL + projects: + - name: '{module}-automate-generate-doc-{stream}' + current-parameters: true + kill-phase-on: FAILURE + abort-all-job: true + + publishers: + - 'email-publisher' + - email-jenkins-admins-on-failure + +- job-template: + name: '{module}-automate-{phase}-{stream}' + + properties: + - throttle: + enabled: true + max-per-node: 1 + option: 'project' + + parameters: + - project-parameter: + project: '{project}' + branch: '{branch}' + + wrappers: + - ssh-agent-wrapper + - timeout: + timeout: 120 + fail: true + + scm: + - git-scm + + builders: + - description-setter: + description: "Built on $NODE_NAME" + - '{module}-automate-{phase}-macro' + +################################ +# job builders +################################ +- builder: + name: 'docker-update' + builders: + - shell: | + bash ./ci/docker-update.sh + +- builder: + name: 'testapi-automate-generate-doc-macro' + builders: + - 'testapi-doc-build' + - 'upload-doc-artifact' + +- builder: + name: 'testapi-doc-build' + builders: + - shell: | + bash ./ci/htmlize/doc-build.sh + +- builder: + name: 'upload-doc-artifact' + builders: + - shell: | + bash ./ci/htmlize/push-doc-artifacts.sh + +- builder: + name: 'reporting-automate-generate-doc-macro' + builders: + - shell: echo "To Be Done" + +- builder: + name: 'testapi-automate-docker-deploy-macro' + builders: + - shell: | + sudo bash ./ci/docker-deploy.sh "sudo docker run -dti --name testapi -p 8082:8000 + -e mongodb_url=mongodb://172.17.0.1:27017 + -e base_url=http://testresults.opnfv.org/test opnfv/testapi" \ + "http://testresults.opnfv.org/test/" "testapi" + +- builder: + name: 'reporting-automate-docker-deploy-macro' + builders: + - shell: | + sudo bash ./ci/docker-deploy.sh \ + "sudo docker run -itd --name reporting -p 8084:8000 opnfv/reporting" \ + "http://testresults.opnfv.org/reporting/index.html" "reporting" + +- builder: + name: mongodb-backup + builders: + - shell: + bash ./ci/testapi-backup-mongodb.sh + +################################ +# job publishers +################################ + +- publisher: + name: 'email-publisher' + publishers: + - email: + recipients: rohitsakala@gmail.com feng.xiaowei@zte.com.cn morgan.richomme@orange.com + notify-every-unstable-build: false + send-to-individuals: true -- cgit 1.2.3-korg