diff options
29 files changed, 504 insertions, 1597 deletions
diff --git a/jjb/apex/apex-project-jobs.yml b/jjb/apex/apex-project-jobs.yml index 58072865d..b12b1015c 100644 --- a/jjb/apex/apex-project-jobs.yml +++ b/jjb/apex/apex-project-jobs.yml @@ -46,6 +46,10 @@ branch: '{branch}' - apex-parameter: gs-pathname: '{gs-pathname}' + - string: + name: GERRIT_REFSPEC + default: 'refs/heads/{branch}' + description: "JJB configured GERRIT_REFSPEC parameter" scm: - git-scm-gerrit diff --git a/jjb/apex/apex-verify-jobs.yml b/jjb/apex/apex-verify-jobs.yml new file mode 100644 index 000000000..c57ac1d60 --- /dev/null +++ b/jjb/apex/apex-verify-jobs.yml @@ -0,0 +1,364 @@ +--- +- project: + name: 'apex-verify-jobs' + project: 'apex' + jobs: + - 'apex-verify-{stream}' + - 'apex-verify-gate-{stream}' + - 'apex-verify-unit-tests-{stream}' + stream: + - master: &master + branch: '{stream}' + gs-pathname: '' + verify-scenario: 'os-odl-nofeature-ha' + disabled: false + - danube: &danube + branch: 'stable/{stream}' + gs-pathname: '/{stream}' + verify-scenario: 'os-odl_l3-nofeature-ha' + disabled: true + - euphrates: &euphrates + branch: 'stable/{stream}' + gs-pathname: '/{stream}' + verify-scenario: 'os-odl-nofeature-ha' + disabled: false + +# Unit Test +- job-template: + name: 'apex-verify-unit-tests-{stream}' + + node: 'apex-build-{stream}' + + concurrent: true + + disabled: '{obj:disabled}' + + parameters: + - apex-parameter: + gs-pathname: '{gs-pathname}' + - project-parameter: + project: '{project}' + branch: '{branch}' + + 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: 'true' + - 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: 'apex' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + disable-strict-forbidden-file-verification: 'false' + file-paths: + - compare-type: ANT + pattern: 'apex/tests/**' + forbidden-file-paths: + - compare-type: ANT + pattern: '*' + - compare-type: ANT + pattern: 'apex/*' + - compare-type: ANT + pattern: 'build/**' + - compare-type: ANT + pattern: 'lib/**' + - compare-type: ANT + pattern: 'config/**' + - compare-type: ANT + pattern: 'apex/build/**' + - compare-type: ANT + pattern: 'apex/common/**' + - compare-type: ANT + pattern: 'apex/inventory/**' + - compare-type: ANT + pattern: 'apex/network/**' + - compare-type: ANT + pattern: 'apex/overcloud/**' + - compare-type: ANT + pattern: 'apex/settings/**' + - compare-type: ANT + pattern: 'apex/undercloud/**' + - compare-type: ANT + pattern: 'apex/virtual/**' + + properties: + - logrotate-default + - throttle: + max-per-node: 1 + max-total: 10 + option: 'project' + + builders: + - apex-unit-test + +# Verify +- job-template: + name: 'apex-verify-{stream}' + + node: 'apex-virtual-master' + + concurrent: true + + disabled: '{obj:disabled}' + + project-type: 'multijob' + + parameters: + - apex-parameter: + gs-pathname: '{gs-pathname}/dev' + - project-parameter: + project: '{project}' + branch: '{branch}' + - string: + name: ARTIFACT_VERSION + default: dev + description: "Used for overriding the ARTIFACT_VERSION" + 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: 'true' + - 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: 'apex' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + disable-strict-forbidden-file-verification: 'true' + file-paths: + - compare-type: ANT + pattern: '*' + - compare-type: ANT + pattern: 'apex/*' + - compare-type: ANT + pattern: 'build/**' + - compare-type: ANT + pattern: 'lib/**' + - compare-type: ANT + pattern: 'config/**' + - compare-type: ANT + pattern: 'apex/build/**' + - compare-type: ANT + pattern: 'apex/common/**' + - compare-type: ANT + pattern: 'apex/inventory/**' + - compare-type: ANT + pattern: 'apex/network/**' + - compare-type: ANT + pattern: 'apex/overcloud/**' + - compare-type: ANT + pattern: 'apex/settings/**' + - compare-type: ANT + pattern: 'apex/undercloud/**' + - compare-type: ANT + pattern: 'apex/virtual/**' + forbidden-file-paths: + - compare-type: ANT + pattern: 'apex/tests/**' + - compare-type: ANT + pattern: 'docs/**' + + properties: + - logrotate-default + - throttle: + max-per-node: 3 + max-total: 10 + option: 'project' + + builders: + - description-setter: + description: "Built on $NODE_NAME" + - multijob: + name: basic + condition: SUCCESSFUL + projects: + - name: 'apex-verify-unit-tests-{stream}' + current-parameters: false + predefined-parameters: | + GERRIT_BRANCH=$GERRIT_BRANCH + GERRIT_REFSPEC=$GERRIT_REFSPEC + GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER + GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE + node-parameters: false + kill-phase-on: FAILURE + abort-all-job: true + git-revision: true + - multijob: + name: build + condition: SUCCESSFUL + projects: + - name: 'apex-build-{stream}' + current-parameters: false + predefined-parameters: | + ARTIFACT_VERSION=$ARTIFACT_VERSION + GERRIT_BRANCH=$GERRIT_BRANCH + GERRIT_REFSPEC=$GERRIT_REFSPEC + GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER + GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE + node-parameters: false + kill-phase-on: FAILURE + abort-all-job: true + git-revision: true + - multijob: + name: deploy-virtual + condition: SUCCESSFUL + projects: + - name: 'apex-virtual-{stream}' + current-parameters: false + predefined-parameters: | + ARTIFACT_VERSION=$ARTIFACT_VERSION + DEPLOY_SCENARIO={verify-scenario} + OPNFV_CLEAN=yes + GERRIT_BRANCH=$GERRIT_BRANCH + GERRIT_REFSPEC=$GERRIT_REFSPEC + GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER + GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE + node-parameters: false + kill-phase-on: FAILURE + abort-all-job: true + git-revision: true + +# Verify Scenario Gate +- job-template: + name: 'apex-verify-gate-{stream}' + + node: 'apex-build-{stream}' + + concurrent: true + + disabled: '{obj:disabled}' + + project-type: 'multijob' + + parameters: + - apex-parameter: + gs-pathname: '{gs-pathname}/dev' + - project-parameter: + project: '{project}' + branch: '{branch}' + - string: + name: GIT_BASE + default: https://gerrit.opnfv.org/gerrit/$PROJECT + description: "Used for overriding the GIT URL coming from parameters macro." + - string: + name: ARTIFACT_VERSION + default: dev + description: "Used for overriding the ARTIFACT_VERSION" + + scm: + - git-scm-gerrit + + triggers: + - gerrit: + server-name: 'gerrit.opnfv.org' + trigger-on: + - comment-added-contains-event: + comment-contains-value: '^Patch Set [0-9]+: Code-Review\+2.*start-gate-scenario:.*' + projects: + - project-compare-type: 'ANT' + project-pattern: 'apex' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + file-paths: + - compare-type: ANT + pattern: 'ci/**' + - compare-type: ANT + pattern: 'build/**' + - compare-type: ANT + pattern: 'lib/**' + - compare-type: ANT + pattern: 'config/**' + - compare-type: ANT + pattern: 'apex/**' + + properties: + - logrotate-default + - build-blocker: + use-build-blocker: true + block-level: 'NODE' + blocking-jobs: + - 'apex-verify.*' + - 'apex-virtual.*' + - throttle: + max-per-node: 1 + max-total: 10 + option: 'project' + + builders: + - multijob: + name: deploy-virtual + condition: SUCCESSFUL + projects: + - name: 'apex-deploy-virtual-{stream}' + current-parameters: false + predefined-parameters: | + ARTIFACT_VERSION=$ARTIFACT_VERSION + DEPLOY_SCENARIO=gate + OPNFV_CLEAN=yes + GERRIT_BRANCH=$GERRIT_BRANCH + GERRIT_REFSPEC=$GERRIT_REFSPEC + GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER + GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE + GERRIT_EVENT_COMMENT_TEXT=$GERRIT_EVENT_COMMENT_TEXT + node-parameters: true + kill-phase-on: FAILURE + abort-all-job: true + git-revision: true + # yamllint disable rule:line-length + - shell: | + echo DEPLOY_SCENARIO=$(echo $GERRIT_EVENT_COMMENT_TEXT | grep start-gate-scenario | grep -Eo 'os-.*') > detected_scenario + # yamllint enable rule:line-length + - inject: + properties-file: detected_scenario + - multijob: + name: functest-smoke + condition: SUCCESSFUL + projects: + - name: 'functest-apex-virtual-suite-{stream}' + current-parameters: false + predefined-parameters: | + DEPLOY_SCENARIO=$DEPLOY_SCENARIO + FUNCTEST_MODE=tier + FUNCTEST_TIER=healthcheck + GERRIT_BRANCH=$GERRIT_BRANCH + GERRIT_REFSPEC=$GERRIT_REFSPEC + GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER + GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE + node-parameters: true + kill-phase-on: NEVER + abort-all-job: true + git-revision: false + +######################## +# builder macros +######################## +- builder: + name: apex-unit-test + builders: + - shell: + !include-raw: ./apex-unit-test.sh diff --git a/jjb/apex/apex.yml b/jjb/apex/apex.yml index 4ec6efbd4..1c0426029 100644 --- a/jjb/apex/apex.yml +++ b/jjb/apex/apex.yml @@ -3,9 +3,6 @@ name: 'apex' project: 'apex' jobs: - - 'apex-verify-{stream}' - - 'apex-verify-gate-{stream}' - - 'apex-verify-unit-tests-{stream}' - 'apex-runner-cperf-{stream}' - 'apex-virtual-{stream}' - 'apex-deploy-{platform}-{stream}' @@ -194,332 +191,6 @@ - 'baremetal' - 'virtual' -# Unit Test -- job-template: - name: 'apex-verify-unit-tests-{stream}' - - node: '{build-slave}' - - concurrent: true - - parameters: - - apex-parameter: - gs-pathname: '{gs-pathname}' - - project-parameter: - project: '{project}' - branch: '{branch}' - - 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: 'true' - - 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: 'apex' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/{branch}' - disable-strict-forbidden-file-verification: 'false' - file-paths: - - compare-type: ANT - pattern: 'apex/tests/**' - forbidden-file-paths: - - compare-type: ANT - pattern: '*' - - compare-type: ANT - pattern: 'apex/*' - - compare-type: ANT - pattern: 'build/**' - - compare-type: ANT - pattern: 'lib/**' - - compare-type: ANT - pattern: 'config/**' - - compare-type: ANT - pattern: 'apex/build/**' - - compare-type: ANT - pattern: 'apex/common/**' - - compare-type: ANT - pattern: 'apex/inventory/**' - - compare-type: ANT - pattern: 'apex/network/**' - - compare-type: ANT - pattern: 'apex/overcloud/**' - - compare-type: ANT - pattern: 'apex/settings/**' - - compare-type: ANT - pattern: 'apex/undercloud/**' - - compare-type: ANT - pattern: 'apex/virtual/**' - - properties: - - logrotate-default - - throttle: - max-per-node: 1 - max-total: 10 - option: 'project' - - builders: - - shell: - !include-raw-escape: ./apex-unit-test.sh - -# Verify -- job-template: - name: 'apex-verify-{stream}' - - node: '{virtual-slave}' - - concurrent: true - - project-type: 'multijob' - - parameters: - - apex-parameter: - gs-pathname: '{gs-pathname}/dev' - - project-parameter: - project: '{project}' - branch: '{branch}' - - string: - name: ARTIFACT_VERSION - default: dev - description: "Used for overriding the ARTIFACT_VERSION" - 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: 'true' - - 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: 'apex' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/{branch}' - disable-strict-forbidden-file-verification: 'true' - file-paths: - - compare-type: ANT - pattern: '*' - - compare-type: ANT - pattern: 'apex/*' - - compare-type: ANT - pattern: 'build/**' - - compare-type: ANT - pattern: 'lib/**' - - compare-type: ANT - pattern: 'config/**' - - compare-type: ANT - pattern: 'apex/build/**' - - compare-type: ANT - pattern: 'apex/common/**' - - compare-type: ANT - pattern: 'apex/inventory/**' - - compare-type: ANT - pattern: 'apex/network/**' - - compare-type: ANT - pattern: 'apex/overcloud/**' - - compare-type: ANT - pattern: 'apex/settings/**' - - compare-type: ANT - pattern: 'apex/undercloud/**' - - compare-type: ANT - pattern: 'apex/virtual/**' - forbidden-file-paths: - - compare-type: ANT - pattern: 'apex/tests/**' - - compare-type: ANT - pattern: 'docs/**' - - properties: - - logrotate-default - - throttle: - max-per-node: 3 - max-total: 10 - option: 'project' - - builders: - - description-setter: - description: "Built on $NODE_NAME" - - multijob: - name: basic - condition: SUCCESSFUL - projects: - - name: 'apex-verify-unit-tests-{stream}' - current-parameters: false - predefined-parameters: | - GERRIT_BRANCH=$GERRIT_BRANCH - GERRIT_REFSPEC=$GERRIT_REFSPEC - GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER - GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE - node-parameters: false - kill-phase-on: FAILURE - abort-all-job: true - git-revision: true - - multijob: - name: build - condition: SUCCESSFUL - projects: - - name: 'apex-build-{stream}' - current-parameters: false - predefined-parameters: | - ARTIFACT_VERSION=$ARTIFACT_VERSION - GERRIT_BRANCH=$GERRIT_BRANCH - GERRIT_REFSPEC=$GERRIT_REFSPEC - GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER - GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE - node-parameters: false - kill-phase-on: FAILURE - abort-all-job: true - git-revision: true - - multijob: - name: deploy-virtual - condition: SUCCESSFUL - projects: - - name: 'apex-virtual-{stream}' - current-parameters: false - predefined-parameters: | - ARTIFACT_VERSION=$ARTIFACT_VERSION - DEPLOY_SCENARIO={verify-scenario} - OPNFV_CLEAN=yes - GERRIT_BRANCH=$GERRIT_BRANCH - GERRIT_REFSPEC=$GERRIT_REFSPEC - GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER - GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE - node-parameters: true - kill-phase-on: FAILURE - abort-all-job: true - git-revision: true - -# Verify Scenario Gate -- job-template: - name: 'apex-verify-gate-{stream}' - - node: '{virtual-slave}' - - concurrent: true - - project-type: 'multijob' - - parameters: - - apex-parameter: - gs-pathname: '{gs-pathname}/dev' - - project-parameter: - project: '{project}' - branch: '{branch}' - - string: - name: GIT_BASE - default: https://gerrit.opnfv.org/gerrit/$PROJECT - description: "Used for overriding the GIT URL coming from parameters macro." - - string: - name: ARTIFACT_VERSION - default: dev - description: "Used for overriding the ARTIFACT_VERSION" - - scm: - - git-scm-gerrit - - triggers: - - gerrit: - server-name: 'gerrit.opnfv.org' - trigger-on: - - comment-added-contains-event: - comment-contains-value: '^Patch Set [0-9]+: Code-Review\+2.*start-gate-scenario:.*' - projects: - - project-compare-type: 'ANT' - project-pattern: 'apex' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/{branch}' - file-paths: - - compare-type: ANT - pattern: 'ci/**' - - compare-type: ANT - pattern: 'build/**' - - compare-type: ANT - pattern: 'lib/**' - - compare-type: ANT - pattern: 'config/**' - - compare-type: ANT - pattern: 'apex/**' - - properties: - - logrotate-default - - build-blocker: - use-build-blocker: true - block-level: 'NODE' - blocking-jobs: - - 'apex-verify.*' - - 'apex-virtual.*' - - throttle: - max-per-node: 1 - max-total: 10 - option: 'project' - - builders: - - multijob: - name: deploy-virtual - condition: SUCCESSFUL - projects: - - name: 'apex-deploy-virtual-{stream}' - current-parameters: false - predefined-parameters: | - ARTIFACT_VERSION=$ARTIFACT_VERSION - DEPLOY_SCENARIO=gate - OPNFV_CLEAN=yes - GERRIT_BRANCH=$GERRIT_BRANCH - GERRIT_REFSPEC=$GERRIT_REFSPEC - GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER - GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE - GERRIT_EVENT_COMMENT_TEXT=$GERRIT_EVENT_COMMENT_TEXT - node-parameters: true - kill-phase-on: FAILURE - abort-all-job: true - git-revision: true - # yamllint disable rule:line-length - - shell: | - echo DEPLOY_SCENARIO=$(echo $GERRIT_EVENT_COMMENT_TEXT | grep start-gate-scenario | grep -Eo 'os-.*') > detected_scenario - # yamllint enable rule:line-length - - inject: - properties-file: detected_scenario - - multijob: - name: functest-smoke - condition: SUCCESSFUL - projects: - - name: 'functest-apex-virtual-suite-{stream}' - current-parameters: false - predefined-parameters: | - DEPLOY_SCENARIO=$DEPLOY_SCENARIO - FUNCTEST_MODE=tier - FUNCTEST_TIER=healthcheck - GERRIT_BRANCH=$GERRIT_BRANCH - GERRIT_REFSPEC=$GERRIT_REFSPEC - GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER - GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE - node-parameters: true - kill-phase-on: NEVER - abort-all-job: true - git-revision: false - - job-template: name: 'apex-runner-cperf-{stream}' @@ -650,6 +321,8 @@ - job-template: name: 'apex-virtual-{stream}' + node: 'apex-virtual-master' + project-type: 'multijob' disabled: false @@ -1984,12 +1657,6 @@ abort-all-job: true git-revision: false - builder: - name: 'apex-unit-test' - builders: - - shell: - !include-raw: ./apex-unit-test.sh - -- builder: name: 'apex-upload-artifact' builders: - shell: diff --git a/jjb/apex/apex.yml.j2 b/jjb/apex/apex.yml.j2 index 31415499c..900002cdb 100644 --- a/jjb/apex/apex.yml.j2 +++ b/jjb/apex/apex.yml.j2 @@ -3,9 +3,6 @@ name: 'apex' project: 'apex' jobs: - - 'apex-verify-{stream}' - - 'apex-verify-gate-{stream}' - - 'apex-verify-unit-tests-{stream}' - 'apex-runner-cperf-{stream}' - 'apex-virtual-{stream}' - 'apex-deploy-{platform}-{stream}' @@ -62,332 +59,6 @@ - 'baremetal' - 'virtual' -# Unit Test -- job-template: - name: 'apex-verify-unit-tests-{stream}' - - node: '{build-slave}' - - concurrent: true - - parameters: - - apex-parameter: - gs-pathname: '{gs-pathname}' - - project-parameter: - project: '{project}' - branch: '{branch}' - - 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: 'true' - - 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: 'apex' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/{branch}' - disable-strict-forbidden-file-verification: 'false' - file-paths: - - compare-type: ANT - pattern: 'apex/tests/**' - forbidden-file-paths: - - compare-type: ANT - pattern: '*' - - compare-type: ANT - pattern: 'apex/*' - - compare-type: ANT - pattern: 'build/**' - - compare-type: ANT - pattern: 'lib/**' - - compare-type: ANT - pattern: 'config/**' - - compare-type: ANT - pattern: 'apex/build/**' - - compare-type: ANT - pattern: 'apex/common/**' - - compare-type: ANT - pattern: 'apex/inventory/**' - - compare-type: ANT - pattern: 'apex/network/**' - - compare-type: ANT - pattern: 'apex/overcloud/**' - - compare-type: ANT - pattern: 'apex/settings/**' - - compare-type: ANT - pattern: 'apex/undercloud/**' - - compare-type: ANT - pattern: 'apex/virtual/**' - - properties: - - logrotate-default - - throttle: - max-per-node: 1 - max-total: 10 - option: 'project' - - builders: - - shell: - !include-raw-escape: ./apex-unit-test.sh - -# Verify -- job-template: - name: 'apex-verify-{stream}' - - node: '{virtual-slave}' - - concurrent: true - - project-type: 'multijob' - - parameters: - - apex-parameter: - gs-pathname: '{gs-pathname}/dev' - - project-parameter: - project: '{project}' - branch: '{branch}' - - string: - name: ARTIFACT_VERSION - default: dev - description: "Used for overriding the ARTIFACT_VERSION" - 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: 'true' - - 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: 'apex' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/{branch}' - disable-strict-forbidden-file-verification: 'true' - file-paths: - - compare-type: ANT - pattern: '*' - - compare-type: ANT - pattern: 'apex/*' - - compare-type: ANT - pattern: 'build/**' - - compare-type: ANT - pattern: 'lib/**' - - compare-type: ANT - pattern: 'config/**' - - compare-type: ANT - pattern: 'apex/build/**' - - compare-type: ANT - pattern: 'apex/common/**' - - compare-type: ANT - pattern: 'apex/inventory/**' - - compare-type: ANT - pattern: 'apex/network/**' - - compare-type: ANT - pattern: 'apex/overcloud/**' - - compare-type: ANT - pattern: 'apex/settings/**' - - compare-type: ANT - pattern: 'apex/undercloud/**' - - compare-type: ANT - pattern: 'apex/virtual/**' - forbidden-file-paths: - - compare-type: ANT - pattern: 'apex/tests/**' - - compare-type: ANT - pattern: 'docs/**' - - properties: - - logrotate-default - - throttle: - max-per-node: 3 - max-total: 10 - option: 'project' - - builders: - - description-setter: - description: "Built on $NODE_NAME" - - multijob: - name: basic - condition: SUCCESSFUL - projects: - - name: 'apex-verify-unit-tests-{stream}' - current-parameters: false - predefined-parameters: | - GERRIT_BRANCH=$GERRIT_BRANCH - GERRIT_REFSPEC=$GERRIT_REFSPEC - GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER - GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE - node-parameters: false - kill-phase-on: FAILURE - abort-all-job: true - git-revision: true - - multijob: - name: build - condition: SUCCESSFUL - projects: - - name: 'apex-build-{stream}' - current-parameters: false - predefined-parameters: | - ARTIFACT_VERSION=$ARTIFACT_VERSION - GERRIT_BRANCH=$GERRIT_BRANCH - GERRIT_REFSPEC=$GERRIT_REFSPEC - GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER - GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE - node-parameters: false - kill-phase-on: FAILURE - abort-all-job: true - git-revision: true - - multijob: - name: deploy-virtual - condition: SUCCESSFUL - projects: - - name: 'apex-virtual-{stream}' - current-parameters: false - predefined-parameters: | - ARTIFACT_VERSION=$ARTIFACT_VERSION - DEPLOY_SCENARIO={verify-scenario} - OPNFV_CLEAN=yes - GERRIT_BRANCH=$GERRIT_BRANCH - GERRIT_REFSPEC=$GERRIT_REFSPEC - GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER - GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE - node-parameters: true - kill-phase-on: FAILURE - abort-all-job: true - git-revision: true - -# Verify Scenario Gate -- job-template: - name: 'apex-verify-gate-{stream}' - - node: '{virtual-slave}' - - concurrent: true - - project-type: 'multijob' - - parameters: - - apex-parameter: - gs-pathname: '{gs-pathname}/dev' - - project-parameter: - project: '{project}' - branch: '{branch}' - - string: - name: GIT_BASE - default: https://gerrit.opnfv.org/gerrit/$PROJECT - description: "Used for overriding the GIT URL coming from parameters macro." - - string: - name: ARTIFACT_VERSION - default: dev - description: "Used for overriding the ARTIFACT_VERSION" - - scm: - - git-scm-gerrit - - triggers: - - gerrit: - server-name: 'gerrit.opnfv.org' - trigger-on: - - comment-added-contains-event: - comment-contains-value: '^Patch Set [0-9]+: Code-Review\+2.*start-gate-scenario:.*' - projects: - - project-compare-type: 'ANT' - project-pattern: 'apex' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/{branch}' - file-paths: - - compare-type: ANT - pattern: 'ci/**' - - compare-type: ANT - pattern: 'build/**' - - compare-type: ANT - pattern: 'lib/**' - - compare-type: ANT - pattern: 'config/**' - - compare-type: ANT - pattern: 'apex/**' - - properties: - - logrotate-default - - build-blocker: - use-build-blocker: true - block-level: 'NODE' - blocking-jobs: - - 'apex-verify.*' - - 'apex-virtual.*' - - throttle: - max-per-node: 1 - max-total: 10 - option: 'project' - - builders: - - multijob: - name: deploy-virtual - condition: SUCCESSFUL - projects: - - name: 'apex-deploy-virtual-{stream}' - current-parameters: false - predefined-parameters: | - ARTIFACT_VERSION=$ARTIFACT_VERSION - DEPLOY_SCENARIO=gate - OPNFV_CLEAN=yes - GERRIT_BRANCH=$GERRIT_BRANCH - GERRIT_REFSPEC=$GERRIT_REFSPEC - GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER - GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE - GERRIT_EVENT_COMMENT_TEXT=$GERRIT_EVENT_COMMENT_TEXT - node-parameters: true - kill-phase-on: FAILURE - abort-all-job: true - git-revision: true - # yamllint disable rule:line-length - - shell: | - echo DEPLOY_SCENARIO=$(echo $GERRIT_EVENT_COMMENT_TEXT | grep start-gate-scenario | grep -Eo 'os-.*') > detected_scenario - # yamllint enable rule:line-length - - inject: - properties-file: detected_scenario - - multijob: - name: functest-smoke - condition: SUCCESSFUL - projects: - - name: 'functest-apex-virtual-suite-{stream}' - current-parameters: false - predefined-parameters: | - DEPLOY_SCENARIO=$DEPLOY_SCENARIO - FUNCTEST_MODE=tier - FUNCTEST_TIER=healthcheck - GERRIT_BRANCH=$GERRIT_BRANCH - GERRIT_REFSPEC=$GERRIT_REFSPEC - GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER - GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE - node-parameters: true - kill-phase-on: NEVER - abort-all-job: true - git-revision: false - - job-template: name: 'apex-runner-cperf-{stream}' @@ -518,6 +189,8 @@ - job-template: name: 'apex-virtual-{stream}' + node: 'apex-virtual-master' + project-type: 'multijob' disabled: false @@ -1294,12 +967,6 @@ {% endfor -%} - builder: - name: 'apex-unit-test' - builders: - - shell: - !include-raw: ./apex-unit-test.sh - -- builder: name: 'apex-upload-artifact' builders: - shell: diff --git a/jjb/ci_gate_security/opnfv-ci-gate-security.yml b/jjb/ci_gate_security/opnfv-ci-gate-security.yml index e09339a4b..0a412c240 100644 --- a/jjb/ci_gate_security/opnfv-ci-gate-security.yml +++ b/jjb/ci_gate_security/opnfv-ci-gate-security.yml @@ -81,7 +81,7 @@ comment-contains-value: 'reverify' projects: - project-compare-type: 'REG_EXP' - project-pattern: 'apex|armband|bamboo|barometer|bottlenecks|calipso|compass4nfv|conductor|cooper|cperf|daisy|doctor|dovetail|dpacc|enfv|escalator|fds|fuel|functest|octopus|pharos|releng|sandbox|yardstick' + project-pattern: 'apex|armband|bamboo|barometer|bottlenecks|calipso|compass4nfv|conductor|cooper|cperf|daisy|doctor|dovetail|dpacc|enfv|escalator|fds|fuel|functest|octopus|pharos|releng|sandbox|yardstick|infra|ipv6|kvmfornfv|lsoapi|models|moon|multisite|netready' branches: - branch-compare-type: 'ANT' branch-pattern: '**/{branch}' diff --git a/jjb/functest/functest-alpine.sh b/jjb/functest/functest-alpine.sh index bd2bdf4a8..3c1ac28bb 100755 --- a/jjb/functest/functest-alpine.sh +++ b/jjb/functest/functest-alpine.sh @@ -71,7 +71,7 @@ FUNCTEST_DIR=/home/opnfv/functest DEPLOY_TYPE=baremetal [[ $BUILD_TAG =~ "virtual" ]] && DEPLOY_TYPE=virt HOST_ARCH=$(uname -m) -DOCKER_TAG=${DOCKER_TAG:-latest} +DOCKER_TAG=`[[ ${BRANCH##*/} == "master" ]] && echo "latest" || echo ${BRANCH##*/}` # Prepare OpenStack credentials volume rc_file=${HOME}/opnfv-openrc.sh diff --git a/jjb/functest/functest-daily-jobs.yml b/jjb/functest/functest-daily-jobs.yml index 2fc70b916..2d5d397ae 100644 --- a/jjb/functest/functest-daily-jobs.yml +++ b/jjb/functest/functest-daily-jobs.yml @@ -14,12 +14,10 @@ stream: master branch: '{stream}' gs-pathname: '' - docker-tag: 'latest' euphrates: &euphrates stream: euphrates branch: 'stable/{stream}' gs-pathname: '/{stream}' - docker-tag: 'stable' # ------------------------------- # POD, INSTALLER, AND BRANCH MAPPING # ------------------------------- @@ -234,10 +232,6 @@ name: DEPLOY_SCENARIO default: 'os-odl_l2-nofeature-ha' - string: - name: DOCKER_TAG - default: '{docker-tag}' - description: 'Tag to pull docker image' - - string: name: CLEAN_DOCKER_IMAGES default: 'false' description: 'Remove downloaded docker images (opnfv/functest*:*)' @@ -399,8 +393,7 @@ !include-raw: - ./functest-env-presetup.sh - ../../utils/fetch_os_creds.sh - - ./set-functest-env.sh - - ./functest-loop.sh + - ./functest-alpine.sh # yamllint enable rule:indentation - builder: diff --git a/jjb/functest/functest-loop.sh b/jjb/functest/functest-loop.sh deleted file mode 100755 index a590d9f95..000000000 --- a/jjb/functest/functest-loop.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -set +e - -[[ "$PUSH_RESULTS_TO_DB" == "true" ]] && flags+="-r" -cmd="run_tests -t all ${flags}" - -container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1) -docker exec $container_id $cmd - -ret_value=$? -ret_val_file="${HOME}/opnfv/functest/results/${BRANCH##*/}/return_value" -echo ${ret_value}>${ret_val_file} - -exit 0 diff --git a/jjb/functest/functest-weekly-jobs.yml b/jjb/functest/functest-weekly-jobs.yml index 6826e4151..5d572aacc 100644 --- a/jjb/functest/functest-weekly-jobs.yml +++ b/jjb/functest/functest-weekly-jobs.yml @@ -118,13 +118,11 @@ # yamllint disable rule:indentation - shell: !include-raw: - - ./functest-env-presetup.sh - - ../../utils/fetch_os_creds.sh - - ./set-functest-env.sh + - ./functest-env-presetup.sh + - ../../utils/fetch_os_creds.sh + - ./functest-alpine.sh # yamllint enable rule:indentation - shell: - !include-raw: ./functest-loop.sh - - shell: !include-raw: ../../utils/push-test-logs.sh - shell: !include-raw: ./functest-exit.sh diff --git a/jjb/functest/set-functest-env.sh b/jjb/functest/set-functest-env.sh deleted file mode 100755 index b116a8528..000000000 --- a/jjb/functest/set-functest-env.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/bash - -set -e -set +u -set +o pipefail - -[[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null" - -DEPLOY_TYPE=baremetal -[[ $BUILD_TAG =~ "virtual" ]] && DEPLOY_TYPE=virt -HOST_ARCH=$(uname -m) - -# Prepare OpenStack credentials volume -rc_file_vol="-v ${HOME}/opnfv-openrc.sh:/home/opnfv/functest/conf/openstack.creds" - -if [[ ${INSTALLER_TYPE} == 'joid' ]]; then - rc_file_vol="-v $LAB_CONFIG/admin-openrc:/home/opnfv/functest/conf/openstack.creds" -elif [[ ${INSTALLER_TYPE} == 'compass' && ${BRANCH} == 'master' ]]; then - cacert_file_vol="-v ${HOME}/os_cacert:/home/opnfv/functest/conf/os_cacert" - echo "export OS_CACERT=/home/opnfv/functest/conf/os_cacert" >> ${HOME}/opnfv-openrc.sh -elif [[ ${INSTALLER_TYPE} == 'fuel' && ${DEPLOY_TYPE} == 'baremetal' ]]; then - cacert_file_vol="-v ${HOME}/os_cacert:/etc/ssl/certs/mcp_os_cacert" -fi - - -# Set iptables rule to allow forwarding return traffic for container -if ! sudo iptables -C FORWARD -j RETURN 2> ${redirect} || ! sudo iptables -L FORWARD | awk 'NR==3' | grep RETURN 2> ${redirect}; then - sudo iptables -I FORWARD -j RETURN -fi - -echo "Functest: Start Docker and prepare environment" - -if [ "$BRANCH" != 'stable/danube' ]; then - echo "Functest: Download images that will be used by test cases" - images_dir="${HOME}/opnfv/functest/images" - chmod +x ${WORKSPACE}/functest/ci/download_images.sh - ${WORKSPACE}/functest/ci/download_images.sh ${images_dir} > ${redirect} - images_vol="-v ${images_dir}:/home/opnfv/functest/images" - echo "Functest: Images successfully downloaded" -fi - -dir_result="${HOME}/opnfv/functest/results/${BRANCH##*/}" -mkdir -p ${dir_result} -sudo rm -rf ${dir_result}/* -results_vol="-v ${dir_result}:/home/opnfv/functest/results" -custom_params= -test -f ${HOME}/opnfv/functest/custom/params_${DOCKER_TAG} && custom_params=$(cat ${HOME}/opnfv/functest/custom/params_${DOCKER_TAG}) -echo "Functest: custom parameters successfully retrieved: ${custom_params}" - -envs="-e INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} \ - -e NODE_NAME=${NODE_NAME} -e DEPLOY_SCENARIO=${DEPLOY_SCENARIO} \ - -e BUILD_TAG=${BUILD_TAG} -e CI_DEBUG=${CI_DEBUG} -e DEPLOY_TYPE=${DEPLOY_TYPE}" - -ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" - -if [ "${INSTALLER_TYPE}" == 'fuel' ] && [ "$BRANCH" != 'stable/danube' ]; then - COMPUTE_ARCH=$(ssh -l ubuntu ${INSTALLER_IP} -i ${SSH_KEY} ${ssh_options} \ - "sudo salt 'cmp*' grains.get cpuarch --out yaml | awk '{print \$2; exit}'") - envs="${envs} -e POD_ARCH=${COMPUTE_ARCH}" -fi - -if [[ ${INSTALLER_TYPE} == 'compass' && ${DEPLOY_SCENARIO} == *'os-nosdn-openo-ha'* ]]; then - openo_msb_port=${openo_msb_port:-80} - openo_msb_endpoint="$(sshpass -p'root' ssh 2>/dev/null $ssh_options root@${installer_ip} \ - 'mysql -ucompass -pcompass -Dcompass -e "select package_config from cluster;" \ - | sed s/,/\\n/g | grep openo_ip | cut -d \" -f 4'):$openo_msb_port" - - envs=${env}" -e OPENO_MSB_ENDPOINT=${openo_msb_endpoint}" -fi - -if [ "$BRANCH" != 'stable/danube' ]; then - volumes="${images_vol} ${results_vol} ${sshkey_vol} ${stackrc_vol} ${rc_file_vol} ${cacert_file_vol}" -else - volumes="${results_vol} ${sshkey_vol} ${stackrc_vol} ${rc_file_vol}" -fi - -echo "Functest: volumes defined" - -FUNCTEST_IMAGE="opnfv/functest" -if [ "$HOST_ARCH" = "aarch64" ]; then - FUNCTEST_IMAGE="${FUNCTEST_IMAGE}_${HOST_ARCH}" -fi - -echo "Functest: Pulling Functest Docker image ${FUNCTEST_IMAGE}:${DOCKER_TAG}" -docker pull ${FUNCTEST_IMAGE}:$DOCKER_TAG >/dev/null - -cmd="sudo docker run --privileged=true -id ${envs} ${volumes} \ - ${custom_params} ${TESTCASE_OPTIONS} \ - ${FUNCTEST_IMAGE}:${DOCKER_TAG} /bin/bash" -echo "Functest: Running docker run command: ${cmd}" -${cmd} >${redirect} -sleep 5 -container_id=$(docker ps | grep "${FUNCTEST_IMAGE}:${DOCKER_TAG}" | awk '{print $1}' | head -1) -echo "Container ID=${container_id}" -if [ -z ${container_id} ]; then - echo "Cannot find opnfv/functest container ID ${container_id}. Please check if it is existing." - docker ps -a - exit 1 -fi -echo "Starting the container: docker start ${container_id}" -docker start ${container_id} -sleep 5 -docker ps >${redirect} -if [ $(docker ps | grep "${FUNCTEST_IMAGE}:${DOCKER_TAG}" | wc -l) == 0 ]; then - echo "The container ${FUNCTEST_IMAGE} with ID=${container_id} has not been properly started. Exiting..." - exit 1 -fi - -cmd="prepare_env start" -echo "Executing command inside the docker: ${cmd}" -docker exec ${container_id} ${cmd} diff --git a/jjb/global/releng-macros.yml b/jjb/global/releng-macros.yml index 62c22bd3f..08766943c 100644 --- a/jjb/global/releng-macros.yml +++ b/jjb/global/releng-macros.yml @@ -284,28 +284,6 @@ fi - builder: - name: build-and-upload-artifacts-json-api - builders: - - shell: | - #!/bin/bash - set -o errexit - set -o pipefail - export PATH=$PATH:/usr/local/bin/ - - virtualenv -p python2.7 $WORKSPACE/releng_artifacts - source $WORKSPACE/releng_artifacts/bin/activate - - # install python packages - pip install google-api-python-client - - # generate and upload index file - echo "Generating Artifacts API ..." - python $WORKSPACE/utils/opnfv-artifacts.py > index.json - gsutil cp index.json gs://artifacts.opnfv.org/index.json - - deactivate - -- builder: name: lint-python-code builders: - shell: | @@ -405,7 +383,12 @@ echo "Running yaml code on $PROJECT ..." # Get list of yaml files - YAML_FILES=$(git --no-pager diff --diff-filter=MCRAT --name-only HEAD^1 | egrep "ya?ml$") + YAML_FILES=$(git --no-pager diff --diff-filter=MCRAT --name-only HEAD^1 | egrep "ya?ml$") || true + + #If YAML_FILES is none exit with 0 + if [ -z "$YAML_FILES" ]; then + exit 0 + fi # Ensure we start with a clean environment rm -f yaml-violation.log lint.log diff --git a/jjb/ovn4nfv/ovn4nfv-project-jobs.yml b/jjb/ovn4nfv/ovn4nfv-project-jobs.yml index b5e078ca6..97d1baefd 100644 --- a/jjb/ovn4nfv/ovn4nfv-project-jobs.yml +++ b/jjb/ovn4nfv/ovn4nfv-project-jobs.yml @@ -4,7 +4,6 @@ project: '{name}' - stream: - master: branch: '{stream}' @@ -33,10 +32,11 @@ max-per-node: 1 option: 'project' - parametert: + parameters: - project-parameter: project: '{project}' branch: '{branch}' + - opnfv-build-defaults scm: - git-scm diff --git a/jjb/qtip/qtip-experimental-jobs.yml b/jjb/qtip/qtip-experimental-jobs.yml index fdfed2601..db2fb8b07 100644 --- a/jjb/qtip/qtip-experimental-jobs.yml +++ b/jjb/qtip/qtip-experimental-jobs.yml @@ -31,9 +31,9 @@ - project-parameter: project: '{project}' branch: '{branch}' - # Pin the tests on zte-pod4 with apex deployment - - apex-defaults - - zte-virtual5-defaults + # Pin the tests on zte-pod6 with MCP deployment + - fuel-defaults + - zte-virtual6-defaults scm: - git-scm-gerrit diff --git a/jjb/releng/automate.yml b/jjb/releng/automate.yml index de7fcd6c0..afeb35821 100644 --- a/jjb/releng/automate.yml +++ b/jjb/releng/automate.yml @@ -19,7 +19,7 @@ - '{module}-automate-{phase}-{stream}' - '{module}-verify-{stream}' - project: 'releng' + project: 'releng-testresults' - job: name: 'testapi-mongodb-backup' @@ -30,11 +30,11 @@ default: 'testresults' description: 'Slave label on Jenkins' - project-parameter: - project: 'releng' + project: 'releng-testresults' branch: 'master' - string: name: GIT_BASE - default: https://gerrit.opnfv.org/gerrit/releng + default: https://gerrit.opnfv.org/gerrit/releng-testresults description: 'Git URL to use on this Jenkins Slave' scm: @@ -79,11 +79,11 @@ branch-pattern: '**/{branch}' file-paths: - compare-type: 'ANT' - pattern: 'utils/test/{module}/**' + pattern: '{module}/**' builders: - shell: | - cd ./utils/test/{module}/ + cd {module}/ tox if [ -e *.xml ];then cp *.xml $WORKSPACE @@ -143,7 +143,7 @@ branch-pattern: '**/{branch}' file-paths: - compare-type: 'ANT' - pattern: 'utils/test/{module}/**' + pattern: '{module}/**' builders: - description-setter: @@ -208,8 +208,8 @@ - builder: name: 'docker-update' builders: - - shell: - !include-raw: ./docker-update.sh + - shell: | + bash ./ci/docker-update.sh - builder: name: 'testapi-automate-generate-doc-macro' @@ -221,13 +221,13 @@ name: 'testapi-doc-build' builders: - shell: | - bash ./jjb/releng/htmlize/doc-build.sh + bash ./ci/htmlize/doc-build.sh - builder: name: 'upload-doc-artifact' builders: - shell: | - bash ./jjb/releng/htmlize/push-doc-artifact.sh + bash ./ci/htmlize/push-doc-artifacts.sh - builder: name: 'reporting-automate-generate-doc-macro' @@ -238,7 +238,7 @@ name: 'testapi-automate-docker-deploy-macro' builders: - shell: | - sudo bash ./jjb/releng/docker-deploy.sh "sudo docker run -dti --name testapi -p 8082:8000 + 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" @@ -247,14 +247,15 @@ name: 'reporting-automate-docker-deploy-macro' builders: - shell: | - sudo bash ./jjb/releng/docker-deploy.sh "sudo docker run -itd --name reporting -p 8084:8000 opnfv/reporting" \ + 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 ./jjb/releng/testapi-backup-mongodb.sh + - shell: + bash ./ci/testapi-backup-mongodb.sh ################################ # job publishers diff --git a/jjb/releng/docker-deploy.sh b/jjb/releng/docker-deploy.sh deleted file mode 100644 index 1e8357717..000000000 --- a/jjb/releng/docker-deploy.sh +++ /dev/null @@ -1,152 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one * -# or more contributor license agreements. See the NOTICE file * -# distributed with this work for additional information * -# regarding copyright ownership. The ASF licenses this file * -# to you under the Apache License, Version 2.0 (the * -# "License"); you may not use this file except in compliance * -# with the License. You may obtain a copy of the License at * -# * -# http://www.apache.org/licenses/LICENSE-2.0 * -# * -# Unless required by applicable law or agreed to in writing, * -# software distributed under the License is distributed on an * -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * -# KIND, either express or implied. See the License for the * -# specific language governing permissions and limitations * -# under the License. * - - -command=$1 -url=$2 -module=$3 - -REPO="opnfv" -latest_image=$REPO/$module:latest -old_image=$REPO/$module:old -latest_container_name=$module -old_container_name=$module"_old" -latest_container_id= -old_container_id= -new_start_container= - -function DEBUG() { - echo `date "+%Y-%m-%d %H:%M:%S.%N"` ": $1" -} - -function check_connectivity() { - # check update status via test the connectivity of provide url - sleep 5 - cmd=`curl -s --head --request GET ${url} | grep '200 OK' > /dev/null` - rc=$? - DEBUG $rc - if [[ $rc == 0 ]]; then - return 0 - else - return 1 - fi -} - - -function pull_latest_image() { - DEBUG "pull latest image $latest_image" - docker pull $latest_image -} - -function get_latest_running_container() { - latest_container_id=`docker ps -q --filter name=^/$latest_container_name$` -} - -function get_old_running_container() { - old_container_id=`docker ps -q --filter name=^/$old_container_name$` -} - -function delete_old_image() { - DEBUG "delete old image: $old_image" - docker rmi -f $old_image -} - -function delete_old_container() { - DEBUG "delete old container: $old_container_name" - docker ps -a -q --filter name=^/$old_container_name$ | xargs docker rm -f &>/dev/null -} - -function delete_latest_container() { - DEBUG "delete latest container: $module" - docker ps -a -q --filter name=^/$latest_container_name$ | xargs docker rm -f &>/dev/null -} - -function delete_latest_image() { - DEBUG "delete latest image: $REPO/$module:latest" - docker rmi -f $latest_image -} - -function change_image_tag_2_old() { - DEBUG "change image tag 2 old" - docker tag $latest_image $old_image - docker rmi -f $latest_image -} - -function mark_latest_container_2_old() { - DEBUG "mark latest container to be old" - docker rename "$latest_container_name" "$old_container_name" -} - -function stop_old_container() { - DEBUG "stop old container" - docker stop "$old_container_name" -} - -function run_latest_image() { - new_start_container=`$command` - DEBUG "run latest image: $new_start_container" -} - -get_latest_running_container -get_old_running_container - -if [[ ! -z $latest_container_id ]]; then - DEBUG "latest container is running: $latest_container_id" - delete_old_container - delete_old_image - change_image_tag_2_old - mark_latest_container_2_old - pull_latest_image - stop_old_container - run_latest_image - -elif [[ ! -z $old_container_id ]]; then - DEBUG "old container is running: $old_container_id" - delete_latest_container - delete_latest_image - pull_latest_image - stop_old_container - run_latest_image -else - DEBUG "no container is running" - delete_old_container - delete_old_image - delete_latest_container - delete_latest_image - pull_latest_image - run_latest_image -fi - -if check_connectivity; then - DEBUG "CONGRATS: $module update successfully" -else - DEBUG "ATTENTION: $module update failed" - id=`docker ps -a -q --filter name=^/$old_container_name$` - if [[ ! -z $id ]]; then - DEBUG "start old container instead" - docker stop $new_start_container - docker start $id - fi - if ! check_connectivity; then - DEBUG "BIG ISSUE: no container is running normally" - fi - exit 1 -fi - -docker images -docker ps -a diff --git a/jjb/releng/docker-update.sh b/jjb/releng/docker-update.sh deleted file mode 100644 index 559ac835c..000000000 --- a/jjb/releng/docker-update.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one * -# or more contributor license agreements. See the NOTICE file * -# distributed with this work for additional information * -# regarding copyright ownership. The ASF licenses this file * -# to you under the Apache License, Version 2.0 (the * -# "License"); you may not use this file except in compliance * -# with the License. You may obtain a copy of the License at * -# * -# http://www.apache.org/licenses/LICENSE-2.0 * -# * -# Unless required by applicable law or agreed to in writing, * -# software distributed under the License is distributed on an * -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * -# KIND, either express or implied. See the License for the * -# specific language governing permissions and limitations * -# under the License. * - -set -o errexit -set -o nounset - -cd $WORKSPACE/utils/test/$MODULE_NAME/docker/ - -# Remove previous containers -docker ps -a | grep "opnfv/$MODULE_NAME" | awk '{ print $1 }' | xargs -r docker rm -f - -# Remove previous images -docker images | grep "opnfv/$MODULE_NAME" | awk '{ print $3 }' | xargs -r docker rmi -f - -# Start build -docker build --no-cache -t opnfv/$MODULE_NAME:$DOCKER_TAG . - -# Push Image -docker push opnfv/$MODULE_NAME:$DOCKER_TAG diff --git a/jjb/releng/functest-docker.yml b/jjb/releng/functest-docker.yml index dff08fe58..acf381f88 100644 --- a/jjb/releng/functest-docker.yml +++ b/jjb/releng/functest-docker.yml @@ -37,36 +37,35 @@ build-job-settings: &build-job-settings current-parameters: false git-revision: true - node-parameters: true + node-parameters: false predefined-parameters: | PUSH_IMAGE=$PUSH_IMAGE COMMIT_ID=$COMMIT_ID RELEASE_VERSION=$RELEASE_VERSION DOCKERFILE=$DOCKERFILE - ARCH_TAG=$ARCH_TAG kill-phase-on: FAILURE abort-all-jobs: false manifest-job-settings: &manifest-job-settings current-parameters: false git-revision: true - node-parameters: true - predefined-parameters: | + node-parameters: false + predefined-parameters: RELEASE_VERSION=$RELEASE_VERSION - ARCH_TAG=$ARCH_TAG kill-phase-on: FAILURE abort-all-jobs: false # yamllint enable rule:key-duplicates jobs: - - "functest-docker-build-push-{arch_tag}-{stream}" - - "functest-{image}-build-push-{arch_tag}-{stream}" - - "functest-{image}-create-manifest-{arch_tag}-{stream}" + - "functest-docker-{stream}" + - "functest-{image}-build-{arch_tag}-{stream}" + - "functest-{image}-manifest-{stream}" + ######################## # job templates ######################## - job-template: - name: 'functest-docker-build-push-{arch_tag}-{stream}' + name: 'functest-docker-{stream}' project-type: multijob @@ -76,12 +75,8 @@ - job-parameters: project: '{project}' branch: '{branch}' - slave_label: '{slave_label}' - arch_tag: '{arch_tag}' - - string: - name: ARCH_TAG - default: "{arch_tag}" - description: "If set, this value will be added to the docker image tag as a prefix" + slave_label: 'opnfv-build-ubuntu' + arch_tag: 'amd64' properties: - throttle: @@ -97,124 +92,142 @@ builders: - multijob: - name: 'build-base-img-create-manifest' - execution-type: SEQUENTIAL + name: 'build functest-core images' + execution-type: PARALLEL projects: - - name: 'functest-core-build-push-{stream}' + - name: 'functest-core-build-amd64-{stream}' <<: *build-job-settings - - name: 'functest-core-create-manifest-{stream}' + - name: 'functest-core-build-arm64-{stream}' + <<: *build-job-settings + - multijob: + name: 'publish functest-core manifests' + execution-type: PARALLEL + projects: + - name: 'functest-core-manifest-{stream}' <<: *manifest-job-settings - multijob: - name: 'build-child-img' + name: 'build all functest images' condition: SUCCESSFUL execution-type: PARALLEL projects: - - name: 'functest-healthcheck-build-push-{stream}' + - name: 'functest-healthcheck-build-amd64-{stream}' + <<: *build-job-settings + - name: 'functest-healthcheck-build-arm64-{stream}' + <<: *build-job-settings + - name: 'functest-features-build-amd64-{stream}' <<: *build-job-settings - - name: 'functest-features-build-push-{stream}' + - name: 'functest-features-build-arm64-{stream}' <<: *build-job-settings - - name: 'functest-components-build-push-{stream}' + - name: 'functest-components-build-amd64-{stream}' <<: *build-job-settings - - name: 'functest-parser-build-push-{stream}' + - name: 'functest-components-build-arm64-{stream}' <<: *build-job-settings - - name: 'functest-smoke-build-push-{stream}' + - name: 'functest-parser-build-amd64-{stream}' <<: *build-job-settings - - name: 'functest-vnf-build-push-{stream}' + - name: 'functest-parser-build-arm64-{stream}' <<: *build-job-settings - - name: 'functest-restapi-build-push-{stream}' + - name: 'functest-smoke-build-amd64-{stream}' + <<: *build-job-settings + - name: 'functest-smoke-build-arm64-{stream}' + <<: *build-job-settings + - name: 'functest-vnf-build-amd64-{stream}' + <<: *build-job-settings + - name: 'functest-restapi-build-amd64-{stream}' <<: *build-job-settings - multijob: - name: 'create-img-manifest' + name: 'publish all manifests' condition: SUCCESSFUL execution-type: PARALLEL projects: - - name: 'functest-healthcheck-create-manifest-{stream}' + - name: 'functest-healthcheck-manifest-{stream}' <<: *manifest-job-settings - - name: 'functest-features-create-manifest-{stream}' + - name: 'functest-features-manifest-{stream}' <<: *manifest-job-settings - - name: 'functest-components-create-manifest-{stream}' + - name: 'functest-components-manifest-{stream}' <<: *manifest-job-settings - - name: 'functest-parser-create-manifest-{stream}' + - name: 'functest-parser-manifest-{stream}' <<: *manifest-job-settings - - name: 'functest-smoke-create-manifest-{stream}' + - name: 'functest-smoke-manifest-{stream}' <<: *manifest-job-settings - - name: 'functest-vnf-create-manifest-{stream}' + - name: 'functest-vnf-manifest-{stream}' <<: *manifest-job-settings - - name: 'functest-restapi-create-manifest-{stream}' + - name: 'functest-restapi-manifest-{stream}' <<: *manifest-job-settings publishers: - - 'functest-{arch_tag}-recipients' + - 'functest-amd64-recipients' + - 'functest-arm64-recipients' - job-template: - - name: 'functest-{image}-build-push-{arch_tag}-{stream}' - + name: 'functest-{image}-build-{arch_tag}-{stream}' disabled: '{obj:disabled}' - parameters: - job-parameters: project: '{project}' branch: '{branch}' slave_label: '{slave_label}' arch_tag: '{arch_tag}' - - string: - name: DOCKER_REPO_NAME - default: "opnfv/functest-{image}" - description: "Dockerhub repo to be pushed to." - - string: - name: DOCKER_DIR - default: "docker/{image}" - description: "Directory containing files needed by the Dockerfile" - scm: - git-scm - - triggers: - - pollscm: - cron: "*/30 * * * *" - - publishers: - - 'functest-{arch_tag}-recipients' - builders: - - shell: - !include-raw-escape: ./opnfv-docker.sh + - shell: | + #!/bin/bash -ex + case "{arch_tag}" in + "arm64") + sudo amd64_dirs= arm64_dirs=docker/{image} bash ./build.sh ;; + *) + sudo amd64_dirs=docker/{image} arm64_dirs= bash ./build.sh ;; + esac + exit $? - job-template: - - name: 'functest-{image}-create-manifest-{arch_tag}-{stream}' - - disabled: '{obj:disabled}' + name: 'functest-{image}-manifest-{stream}' parameters: - - job-parameters: + - project-parameter: project: '{project}' branch: '{branch}' - slave_label: '{slave_label}' - arch_tag: '{arch_tag}' + - label: + name: SLAVE_LABEL + default: 'opnfv-build-ubuntu' + description: 'Slave label on Jenkins' - string: - name: DOCKER_REPO_NAME - default: "opnfv/functest-{image}" - description: "Dockerhub repo to be pushed to." + name: PROJECT + default: "{project}" + description: "Project name used to enable job conditions" - string: - name: DOCKER_DIR - default: "docker/{image}" - description: "Directory containing files needed by the Dockerfile" - - builders: - - shell: - !include-raw-escape: ./opnfv-manifest.sh - - scm: - - git-scm + name: RELEASE_VERSION + default: "" + description: "Docker tag to be built, e.g. 5.0.0, opnfv-5.0.0, 5.0.RC1" + - string: + name: GIT_BASE + default: https://gerrit.opnfv.org/gerrit/$PROJECT + description: 'Git URL to use on this Jenkins Slave' - triggers: - - pollscm: - cron: "*/30 * * * *" + disabled: '{obj:disabled}' - publishers: - - 'functest-{arch_tag}-recipients' + builders: + - shell: | + #!/bin/bash -ex + case "{stream}" in + "master") + tag="latest" ;; + *) + tag="{stream}" ;; + esac + case "{image}" in + "vnf"|"restapi") + sudo manifest-tool push from-args \ + --platforms linux/amd64 \ + --template opnfv/functest-{image}:ARCH-$tag \ + --target opnfv/functest-{image}:$tag ;; + *) + sudo manifest-tool push from-args \ + --platforms linux/amd64,linux/arm64 \ + --template opnfv/functest-{image}:ARCH-$tag \ + --target opnfv/functest-{image}:$tag ;; + esac + exit $? # parameter macro - parameter: diff --git a/jjb/releng/htmlize/doc-build.sh b/jjb/releng/htmlize/doc-build.sh deleted file mode 100644 index b89baa8e6..000000000 --- a/jjb/releng/htmlize/doc-build.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one * -# or more contributor license agreements. See the NOTICE file * -# distributed with this work for additional information * -# regarding copyright ownership. The ASF licenses this file * -# to you under the Apache License, Version 2.0 (the * -# "License"); you may not use this file except in compliance * -# with the License. You may obtain a copy of the License at * -# * -# http://www.apache.org/licenses/LICENSE-2.0 * -# * -# Unless required by applicable law or agreed to in writing, * -# software distributed under the License is distributed on an * -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * -# KIND, either express or implied. See the License for the * -# specific language governing permissions and limitations * -# under the License. * - -set -o errexit - -# Create virtual environment -virtualenv $WORKSPACE/testapi_venv -source $WORKSPACE/testapi_venv/bin/activate - -# Swgger Codegen Tool -url="http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.1/swagger-codegen-cli-2.2.1.jar" - -# Check for jar file locally and in the repo -if [ ! -f swagger-codegen-cli.jar ]; -then - wget http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.1/swagger-codegen-cli-2.2.1.jar -O swagger-codegen-cli.jar -fi - -# Install Pre-requistics -pip install requests - -python ./jjb/releng/htmlize/htmlize.py -o ${WORKSPACE}/ diff --git a/jjb/releng/htmlize/htmlize.py b/jjb/releng/htmlize/htmlize.py deleted file mode 100644 index da6a6cf91..000000000 --- a/jjb/releng/htmlize/htmlize.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python - -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 - -import argparse -import requests -import json -import os - - -def main(args): - - # Merging two specs - api_response = requests.get(args.api_declaration_url) - api_response = json.loads(api_response.content) - resource_response = requests.get(args.resource_listing_url) - resource_response = json.loads(resource_response.content) - resource_response['models'] = api_response['models'] - resource_response['apis'] = api_response['apis'] - - # Storing the swagger specs - with open('specs.json', 'w') as outfile: - json.dump(resource_response, outfile) - - # Generating html page - cmd = 'java -jar swagger-codegen-cli.jar generate \ - -i specs.json -l html2 -o %s' % (args.output_directory) - if os.system(cmd) == 0: - exit(0) - else: - exit(1) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser(description='Create \ - Swagger Spec documentation') - parser.add_argument('-ru', '--resource-listing-url', - type=str, - required=False, - default=('http://testresults.opnfv.org' - '/test/swagger/resources.json'), - help='Resource Listing Spec File') - parser.add_argument('-au', '--api-declaration-url', - type=str, - required=False, - default=('http://testresults.opnfv.org' - '/test/swagger/APIs'), - help='API Declaration Spec File') - parser.add_argument('-o', '--output-directory', - required=True, - default='./', - help='Output Directory where the \ - file should be stored') - main(parser.parse_args()) diff --git a/jjb/releng/htmlize/push-doc-artifact.sh b/jjb/releng/htmlize/push-doc-artifact.sh deleted file mode 100644 index 4cf1988b0..000000000 --- a/jjb/releng/htmlize/push-doc-artifact.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -set -e -set -o pipefail - -export PATH=$PATH:/usr/local/bin/ - -project=$PROJECT -workspace=$WORKSPACE -artifact_dir="$project/docs" - -set +e -gsutil&>/dev/null -if [ $? != 0 ]; then - echo "Not possible to push results to artifact: gsutil not installed" - exit 1 -else - gsutil ls gs://artifacts.opnfv.org/"$project"/ &>/dev/null - if [ $? != 0 ]; then - echo "Not possible to push results to artifact: gsutil not installed." - exit 1 - else - echo "Uploading document to artifact $artifact_dir" - gsutil cp "$workspace"/index.html gs://artifacts.opnfv.org/"$artifact_dir"/testapi.html >/dev/null 2>&1 - echo "Document can be found at http://artifacts.opnfv.org/releng/docs/testapi.html" - fi -fi diff --git a/jjb/releng/opnfv-docker-arm.yml b/jjb/releng/opnfv-docker-arm.yml index 3486a0775..d1566b48d 100644 --- a/jjb/releng/opnfv-docker-arm.yml +++ b/jjb/releng/opnfv-docker-arm.yml @@ -15,11 +15,6 @@ stream: euphrates branch: 'stable/{stream}' disabled: false - functest-arm-receivers: &functest-arm-receivers - receivers: > - cristina.pauna@enea.com - alexandru.avadanii@enea.com - delia.popescu@enea.com dovetail-arm-receivers: &dovetail-arm-receivers receivers: > cristina.pauna@enea.com @@ -48,10 +43,6 @@ # yamllint disable rule:key-duplicates dockerrepo: # projects with jobs for master - - 'functest': - project: 'functest' - <<: *master - <<: *functest-arm-receivers - 'dovetail': project: 'dovetail' <<: *master @@ -96,10 +87,6 @@ <<: *master <<: *yardstick-arm-receivers # projects with jobs for stable/euphrates - - 'functest': - project: 'functest' - <<: *euphrates - <<: *functest-arm-receivers - 'dovetail': project: 'dovetail' <<: *euphrates diff --git a/jjb/releng/opnfv-docker.yml b/jjb/releng/opnfv-docker.yml index 862e77ac8..8250bfea4 100644 --- a/jjb/releng/opnfv-docker.yml +++ b/jjb/releng/opnfv-docker.yml @@ -19,11 +19,6 @@ stream: euphrates branch: 'stable/{stream}' disabled: false - functest-receivers: &functest-receivers - receivers: > - jalausuch@suse.com morgan.richomme@orange.com - cedric.ollivier@orange.com feng.xiaowei@zte.com.cn - juha.kosonen@nokia.com wangwulin@huawei.com storperf-receivers: &storperf-receivers receivers: > mark.beierl@emc.com @@ -56,10 +51,6 @@ project: 'dovetail' <<: *master <<: *other-receivers - - 'functest': - project: 'functest' - <<: *master - <<: *functest-receivers - 'nfvbench': project: 'nfvbench' <<: *master @@ -116,10 +107,6 @@ project: 'bottlenecks' <<: *euphrates <<: *other-receivers - - 'functest': - project: 'functest' - <<: *euphrates - <<: *functest-receivers - 'storperf-master': project: 'storperf' dockerdir: 'docker/storperf-master' diff --git a/jjb/releng/opnfv-manifest.sh b/jjb/releng/opnfv-manifest.sh deleted file mode 100755 index a740491c2..000000000 --- a/jjb/releng/opnfv-manifest.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# SPDX-license-identifier: Apache-2.0 -############################################################################## -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - - -set -o errexit -set -o nounset -set -o pipefail - -# Starting creating manifest image for $DOCKER_REPO_NAME - -ARCH=(amd64 arm64) -DOCKER_REPO_NAME=${DOCKER_REPO_NAME-} -RELEASE_VERSION=${RELEASE_VERSION-} -BRANCH=${BRANCH-} -ARCH_TAG=${ARCH_TAG-} - -# Before script install manifest-tool: -# cd .. && git clone https://github.com/estesp/manifest-tool -# cd ../manifest-tool && sudo -E make && sudo -E make install - -if [[ "$BRANCH" == "master" ]]; then - DOCKER_TAG="latest" -elif [[ "$BRANCH" == "euphrates" ]]; then - DOCKER_TAG="euphrates" -elif [[ -n "${RELEASE_VERSION}" ]]; then - DOCKER_TAG="${RELEASE_VERSION}" -else - DOCKER_TAG="stable" -fi -if [[ "${ARCH_TAG}" =~ "arm64" || "${ARCH_TAG}" =~ "amd64" ]]; then - sudo manifest-tool push from-args --platforms linux/amd64,linux/arm64 \ - --template "${DOCKER_REPO_NAME}":"${ARCH[0]}"-"${DOCKER_TAG}" \ - --template "${DOCKER_REPO_NAME}":"${ARCH[1]}"-"${DOCKER_TAG}" \ - --target "${DOCKER_REPO_NAME}":"${DOCKER_TAG}" -fi - diff --git a/jjb/releng/opnfv-repo-archiver.sh b/jjb/releng/opnfv-repo-archiver.sh index c9fdba379..2408c2a83 100644 --- a/jjb/releng/opnfv-repo-archiver.sh +++ b/jjb/releng/opnfv-repo-archiver.sh @@ -35,7 +35,7 @@ for PROJECT in "${PROJECT_LIST[@]}"; do # Don't license scan kernel or qemu in kvmfornfv if [ "$PROJECT" == "kvmfornfv" ]; then - rm -rf "$CLONE_PATH/$PROJECT/{kernel,qemu}" + rm -rf "$CLONE_PATH/$PROJECT/"{kernel,qemu} fi done diff --git a/jjb/releng/releng-ci-jobs.yml b/jjb/releng/releng-ci-jobs.yml index d4f39708e..c4b7c8db3 100644 --- a/jjb/releng/releng-ci-jobs.yml +++ b/jjb/releng/releng-ci-jobs.yml @@ -5,7 +5,6 @@ - 'releng-verify-jjb' - 'releng-merge-jjb' - 'releng-comment-jjb' - - 'releng-generate-artifacts-api' project: 'releng' @@ -119,22 +118,3 @@ cd /opt/jenkins-ci/releng git pull jenkins-jobs update -r --delete-old jjb/ - -- job-template: - name: 'releng-generate-artifacts-api' - - # Generate and upload the JSON file to used for artifacts site - - parameters: - - project-parameter: - project: '{project}' - branch: 'master' - - scm: - - git-scm - - triggers: - - timed: '@hourly' - - builders: - - build-and-upload-artifacts-json-api diff --git a/jjb/releng/testapi-backup-mongodb.sh b/jjb/releng/testapi-backup-mongodb.sh deleted file mode 100644 index 795e479d9..000000000 --- a/jjb/releng/testapi-backup-mongodb.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -set -e - -# Run MongoDB backup -python $WORKSPACE/utils/test/testapi/update/templates/backup_mongodb.py -o $WORKSPACE/ - -# Compressing the dump -now=$(date +"%m_%d_%Y_%H_%M_%S") -echo $now - -file_name="testapi_mongodb_"$now".tar.gz" -echo $file_name - -tar cvfz "$file_name" test_results_collection* - -rm -rf test_results_collection* - -artifact_dir="testapibackup" -workspace="$WORKSPACE" - -set +e -/usr/local/bin/gsutil &>/dev/null -if [ $? != 0 ]; then - echo "Not possible to push results to artifact: gsutil not installed" - exit 1 -else - echo "Uploading mongodump to artifact $artifact_dir" - /usr/local/bin/gsutil cp -r "$workspace"/"$file_name" gs://artifacts.opnfv.org/"$artifact_dir"/ - echo "MongoDump can be found at http://artifacts.opnfv.org/$artifact_dir.html" -fi diff --git a/utils/fetch_os_creds.sh b/utils/fetch_os_creds.sh index ac7595053..4bc585885 100755 --- a/utils/fetch_os_creds.sh +++ b/utils/fetch_os_creds.sh @@ -114,7 +114,7 @@ if [ "$installer_type" == "fuel" ]; then ssh ${ssh_options} "${ssh_user}@${controller_ip}" \ "sudo cat /root/keystonercv3" > "${dest_path}" - if [[ "${BUILD_TAG}" =~ "baremetal" ]]; then + if [[ ! "${BUILD_TAG}" =~ 'virtual' ]]; then ssh ${ssh_options} "${ssh_user}@${installer_ip}" \ "cat /etc/ssl/certs/os_cacert" > "${os_cacert}" fi diff --git a/utils/opnfv-artifacts.py b/utils/opnfv-artifacts.py deleted file mode 100644 index 2f2cc41ba..000000000 --- a/utils/opnfv-artifacts.py +++ /dev/null @@ -1,232 +0,0 @@ -#!/usr/bin/python -# SPDX-license-identifier: Apache-2.0 -############################################################################## -# Copyright (c) 2016 The Linux Foundation and others -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -############################################################################## - -""" -Generate JSON listing of OPNFV Artifacts - -This produces a slimmed down version of metadata provided by Google -Storage for each artifact. Also excludes a large number of uninteresting -files. -""" - -from apiclient import discovery -from apiclient.errors import HttpError - -import argparse -import json -import sys - -api = { - 'projects': {}, - 'docs': {}, - 'releases': {}, -} - -releases = [ - 'arno.2015.1.0', - 'arno.2015.2.0', - 'brahmaputra.1.0', -] - -# List of file extensions to filter out -ignore_extensions = [ - '.buildinfo', - '.woff', - '.ttf', - '.svg', - '.eot', - '.pickle', - '.doctree', - '.js', - '.png', - '.css', - '.gif', - '.jpeg', - '.jpg', - '.bmp', -] - - -parser = argparse.ArgumentParser( - description='OPNFV Artifacts JSON Generator') - -parser.add_argument( - '-k', - dest='key', - default='', - help='API Key for Google Cloud Storage') - -parser.add_argument( - '-p', - default=None, - dest='pretty', - action='store_const', - const=2, - help='pretty print the output') - -# Parse and assign arguments -args = parser.parse_args() -key = args.key -pretty_print = args.pretty - - -def output(item, indent=2): - print(json.dumps(item, sort_keys=True, indent=indent)) - - -def has_gerrit_review(dir_list): - """ - If a directory contains an integer, it is assumed to be a gerrit - review number - """ - for d in dir_list: - if d.isdigit(): - return int(d) - return False - - -def has_release(dir_list): - """ - Checks if any directory contains a release name - """ - for d in dir_list: - if d in releases: - return d - return False - - -def has_documentation(dir_list): - """ - Checks for a directory specifically named 'docs' - """ - for d in dir_list: - if d == 'docs': - return True - return False - - -# Rename this or modify how gerrit review are handled -def has_logs(gerrit_review): - """ - If a gerrit review exists, create a link to the review - """ - if gerrit_review: - return "https://gerrit.opnfv.org/gerrit/#/c/%s" % gerrit_review - return False - - -def has_ignorable_extension(filename): - for extension in ignore_extensions: - if filename.lower().endswith(extension): - return True - return False - - -def get_results(key): - """ - Pull down all metadata from artifacts.opnfv.org - and store it in projects as: - { 'PROJECT': [file ...], } - """ - storage = discovery.build('storage', 'v1', developerKey=key) - files = storage.objects().list(bucket='artifacts.opnfv.org', - fields='nextPageToken,' - 'items(' - 'name,' - 'mediaLink,' - 'updated,' - 'contentType,' - 'size' - ')') - while (files is not None): - sites = files.execute() - - for site in sites['items']: - # Filter out unneeded files (js, images, css, buildinfo, etc) - if has_ignorable_extension(site['name']): - continue - - # Split /foo/bar/ into ['foo', 'bar'] and remove any extra - # slashes (ex. /foo//bar/) - site_split = filter(None, site['name'].split('/')) - - # Don't do anything if we aren't given files multiple - # directories deep - if len(site_split) < 2: - continue - - project = site_split[0] - name = '/'.join(site_split[1:]) - proxy = "http://build.opnfv.org/artifacts.opnfv.org/%s" % site[ - 'name'] - if name.endswith('.html'): - href = "http://artifacts.opnfv.org/%s" % site['name'] - href_type = 'view' - else: - href = site['mediaLink'] - href_type = 'download' - - gerrit = has_gerrit_review(site_split) - logs = False # has_logs(gerrit) - # documentation = has_documentation(site_split) - release = has_release(site_split) - - category = 'project' - if gerrit: - category = 'gerrit' - elif release: - category = 'release' - elif logs: - category = 'logs' - - metadata = { - 'category': category, - 'gerritreview': gerrit, - 'release': release, - 'name': name, - 'size': site['size'], - 'time': site['updated'], - 'contentType': site['contentType'], - 'href': href, - 'href_type': href_type, - 'proxy_href': proxy, - } - - if project in releases: - if project not in api['releases']: - api['releases'][project] = [metadata] - else: - api['releases'][project].append(metadata) - else: - if project not in api['projects']: - api['projects'][project] = [metadata] - else: - api['projects'][project].append(metadata) - - files = storage.objects().list_next(files, sites) - - return api - - -# Fail if there is an invalid response from GCE -try: - js = get_results(key) -except HttpError as e: - print >> sys.stderr, e - exit(1) - -output(js, indent=pretty_print) diff --git a/utils/push-test-logs.sh b/utils/push-test-logs.sh index 518d20ae5..8e00b9c0c 100644 --- a/utils/push-test-logs.sh +++ b/utils/push-test-logs.sh @@ -27,7 +27,7 @@ node_list=(\ 'ericsson-pod1' 'ericsson-pod2' \ 'ericsson-virtual1' 'ericsson-virtual2' 'ericsson-virtual3' \ 'ericsson-virtual4' 'ericsson-virtual5' 'ericsson-virtual12' \ -'arm-pod1' 'arm-pod5' \ +'arm-pod1' 'arm-pod5' 'arm-pod6' \ 'huawei-pod1' 'huawei-pod2' 'huawei-pod3' 'huawei-pod4' 'huawei-pod5' \ 'huawei-pod6' 'huawei-pod7' 'huawei-pod12' \ 'huawei-virtual1' 'huawei-virtual2' 'huawei-virtual3' 'huawei-virtual4' \ |