diff options
Diffstat (limited to 'jjb')
-rwxr-xr-x | jjb/armband/armband-deploy.sh | 1 | ||||
-rw-r--r-- | jjb/compass4nfv/compass-dovetail-jobs.yml | 209 | ||||
-rw-r--r-- | jjb/doctor/doctor.yml | 8 | ||||
-rw-r--r-- | jjb/global/releng-macros.yml | 6 | ||||
-rw-r--r-- | jjb/opera/opera-daily-jobs.yml | 33 | ||||
-rw-r--r-- | jjb/releng/testapi-automate.yml | 116 | ||||
-rw-r--r-- | jjb/releng/testapi-docker-deploy.sh | 81 |
7 files changed, 413 insertions, 41 deletions
diff --git a/jjb/armband/armband-deploy.sh b/jjb/armband/armband-deploy.sh index 6ddd2e961..adabfcaeb 100755 --- a/jjb/armband/armband-deploy.sh +++ b/jjb/armband/armband-deploy.sh @@ -8,7 +8,6 @@ # 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 diff --git a/jjb/compass4nfv/compass-dovetail-jobs.yml b/jjb/compass4nfv/compass-dovetail-jobs.yml new file mode 100644 index 000000000..3337cd0ca --- /dev/null +++ b/jjb/compass4nfv/compass-dovetail-jobs.yml @@ -0,0 +1,209 @@ +- project: + + name: 'compass-dovetail-jobs' + installer: 'compass' + project: 'compass4nfv' +#---------------------------------- +# BRANCH ANCHORS +#---------------------------------- + colorado: &colorado + stream: colorado + branch: 'stable/{stream}' + gs-pathname: '/{stream}' + disabled: false + dovetail-branch: master +#------------------------------------ +# POD, INSTALLER, AND BRANCH MAPPING +#------------------------------------ +# CI PODs +#------------------------------------ + pod: + - baremetal: + slave-label: compass-baremetal + os-version: 'trusty' + <<: *colorado +#----------------------------------- +# scenarios +#----------------------------------- + scenario: + - 'os-nosdn-nofeature-ha': + disabled: false + auto-trigger-name: 'weekly-trigger-disabled' + + jobs: + - 'compass-{scenario}-{pod}-weekly-{stream}' + - 'compass-deploy-{pod}-weekly-{stream}' + +######################## +# job templates +######################## +- job-template: + name: 'compass-{scenario}-{pod}-weekly-{stream}' + + disabled: '{obj:disabled}' + + concurrent: false + + properties: + - build-blocker: + use-build-blocker: true + blocking-jobs: + - 'compass-os-.*?-{pod}-daily-.*?' + - 'compass-os-.*?-{pod}-weekly-.*?' + block-level: 'NODE' + + wrappers: + - build-name: + name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO' + + triggers: + - '{auto-trigger-name}' + + parameters: + - project-parameter: + project: '{project}' + branch: '{branch}' + - compass-ci-parameter: + installer: '{installer}' + gs-pathname: '{gs-pathname}' + - string: + name: DEPLOY_SCENARIO + default: '{scenario}' + - '{slave-label}-defaults' + - '{installer}-defaults' + + triggers: + - '{auto-trigger-name}' + + builders: + - description-setter: + description: "POD: $NODE_NAME" + - trigger-builds: + - project: 'compass-deploy-{pod}-weekly-{stream}' + current-parameters: false + predefined-parameters: | + DEPLOY_SCENARIO={scenario} + COMPASS_OS_VERSION={os-version} + same-node: true + block: true + - trigger-builds: + - project: 'dovetail-compass-{pod}-compliance_set-weekly-{stream}' + current-parameters: false + predefined-parameters: + DEPLOY_SCENARIO={scenario} + block: true + same-node: true + block-thresholds: + build-step-failure-threshold: 'never' + failure-threshold: 'never' + unstable-threshold: 'FAILURE' + - trigger-builds: + - project: 'dovetail-compass-{pod}-debug-weekly-{stream}' + current-parameters: false + predefined-parameters: + DEPLOY_SCENARIO={scenario} + block: true + same-node: true + block-thresholds: + build-step-failure-threshold: 'never' + failure-threshold: 'never' + unstable-threshold: 'FAILURE' + - trigger-builds: + - project: 'dovetail-compass-{pod}-proposed_tests-weekly-{stream}' + current-parameters: false + predefined-parameters: + DEPLOY_SCENARIO={scenario} + block: true + same-node: true + block-thresholds: + build-step-failure-threshold: 'never' + failure-threshold: 'never' + unstable-threshold: 'FAILURE' + +- job-template: + name: 'compass-deploy-{pod}-weekly-{stream}' + + disabled: false + + concurrent: true + + properties: + - logrotate-default + - throttle: + enabled: true + max-total: 4 + max-per-node: 1 + option: 'project' + - build-blocker: + use-build-blocker: true + blocking-jobs: + - 'compass-deploy-{pod}-daily-.*?' + - 'compass-deploy-{pod}-weekly-.*' + - 'compass-verify-deploy-.*?' + block-level: 'NODE' + + wrappers: + - build-name: + name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO' + - timeout: + timeout: 120 + abort: true + + parameters: + - project-parameter: + project: '{project}' + branch: '{branch}' + - compass-ci-parameter: + installer: '{installer}' + gs-pathname: '{gs-pathname}' + - '{slave-label}-defaults' + - '{installer}-defaults' + + scm: + - git-scm + + wrappers: + - build-name: + name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO' + + + builders: + - description-setter: + description: "POD: $NODE_NAME" + - shell: + !include-raw-escape: ./compass-download-artifact.sh + - shell: + !include-raw-escape: ./compass-deploy.sh + + publishers: + - archive: + artifacts: 'ansible.log' + allow-empty: 'true' + fingerprint: true + +######################## +# parameter macros +######################## +- parameter: + name: compass-dovetail-parameter + parameters: + - string: + name: BUILD_DIRECTORY + default: $WORKSPACE/build_output + description: "Directory where the build artifact will be located upon the completion of the build." + - string: + name: GS_URL + default: '$GS_BASE{gs-pathname}' + description: "URL to Google Storage." + - choice: + name: COMPASS_OPENSTACK_VERSION + choices: + - 'mitaka' + +######################## +# trigger macros +######################## +- trigger: + name: 'compass-os-nosdn-nofeature-ha-baremetal-weekly-colorado-trigger' + triggers: + - timed: '' diff --git a/jjb/doctor/doctor.yml b/jjb/doctor/doctor.yml index 11b4ffbc2..2333fca14 100644 --- a/jjb/doctor/doctor.yml +++ b/jjb/doctor/doctor.yml @@ -22,10 +22,9 @@ - fuel: slave-label: 'ool-virtual2' pod: 'ool-virtual2' - # TODO(r-mibu): enable this once joid is ready - #- joid: - # slave-label: 'ool-virtual3' - # pod: 'ool-virtual3' + - joid: + slave-label: 'ool-virtual3' + pod: 'ool-virtual3' inspector: - 'sample' @@ -145,6 +144,7 @@ branch: '{branch}' builders: + - 'clean-workspace-log' - 'functest-suite-builder' - shell: | functest_log="$HOME/opnfv/functest/results/{stream}/{project}.log" diff --git a/jjb/global/releng-macros.yml b/jjb/global/releng-macros.yml index e6440966a..7e11d92f6 100644 --- a/jjb/global/releng-macros.yml +++ b/jjb/global/releng-macros.yml @@ -423,6 +423,12 @@ sed -r -i '4,$s/^/ /g' lint.log fi +- builder: + name: clean-workspace-log + builders: + - shell: | + find $WORKSPACE -type f -print -name '*.log' | xargs rm -f + - publisher: name: archive-artifacts publishers: diff --git a/jjb/opera/opera-daily-jobs.yml b/jjb/opera/opera-daily-jobs.yml index a990072fa..f1ea1aa74 100644 --- a/jjb/opera/opera-daily-jobs.yml +++ b/jjb/opera/opera-daily-jobs.yml @@ -63,8 +63,6 @@ project: '{project}' branch: '{branch}' - 'huawei-virtual7-defaults' - - 'compass-defaults' - - 'opera-compass-parameter' builders: - description-setter: @@ -83,7 +81,10 @@ condition: SUCCESSFUL projects: - name: 'compass-deploy-virtual-daily-{stream}' - current-parameters: true + current-parameters: false + predefined-parameters: | + DEPLOY_SCENARIO=os-nosdn-openo-noha + COMPASS_OS_VERSION=xenial node-parameters: true kill-phase-on: FAILURE abort-all-job: true @@ -92,7 +93,7 @@ # condition: SUCCESSFUL # projects: # - name: 'functest-compass-baremetal-suite-{stream}' -# current-parameters: true +# current-parameters: false # predefined-parameters: # FUNCTEST_SUITE_NAME=opera # node-parameters: true @@ -144,27 +145,3 @@ #!/bin/bash echo "Hello world!" -######################## -# parameter macros -######################## -- parameter: - name: opera-compass-parameter - parameters: - - string: - name: BUILD_DIRECTORY - default: $WORKSPACE/build_output - description: "Directory where the build artifact will be located upon the completion of the build." - - string: - name: GS_URL - default: '$GS_BASE{gs-pathname}' - description: "URL to Google Storage." - - choice: - name: COMPASS_OPENSTACK_VERSION - choices: - - 'newton' - - string: - name: DEPLOY_SCENARIO - default: 'os-nosdn-openo-noha' - - string: - name: COMPASS_OS_VERSION - default: 'xenial' diff --git a/jjb/releng/testapi-automate.yml b/jjb/releng/testapi-automate.yml index 47d217e51..4d450f35c 100644 --- a/jjb/releng/testapi-automate.yml +++ b/jjb/releng/testapi-automate.yml @@ -4,8 +4,18 @@ - master: branch: '{stream}' gs-pathname: '' + + phase: + - 'docker-update': + slave-label: 'opnfv-build' + - 'docker-deploy': + slave-label: 'testresults' + - 'generate-doc': + slave-label: 'opnfv-build' + jobs: - 'testapi-automate-{stream}' + - 'testapi-automate-{phase}-{stream}' - 'testapi-verify-{stream}' project: 'releng' @@ -15,6 +25,11 @@ slave-label: 'testresults' + parameters: + - project-parameter: + project: '{project}' + branch: '{branch}' + scm: - git-scm @@ -80,10 +95,20 @@ healthy: 50 unhealthy: 40 failing: 30 + - 'email-publisher' - job-template: name: 'testapi-automate-{stream}' + project-type: multijob + + properties: + - throttle: + enabled: true + max-total: 1 + max-per-node: 1 + option: 'project' + parameters: - project-parameter: project: '{project}' @@ -97,6 +122,12 @@ scm: - git-scm + wrappers: + - ssh-agent-wrapper + - timeout: + timeout: 360 + fail: true + triggers: - gerrit: server-name: 'gerrit.opnfv.org' @@ -112,12 +143,57 @@ branch-pattern: '**/{branch}' file-paths: - compare-type: 'ANT' - pattern: 'utils/**' + pattern: 'utils/test/testapi/**' builders: - - docker-update - - testapi-doc-build - - upload-doc-artifact + - multijob: + name: docker-update + condition: SUCCESSFUL + projects: + - name: 'testapi-automate-docker-update-{stream}' + current-parameters: true + kill-phase-on: FAILURE + abort-all-job: true + - multijob: + name: docker-deploy + condition: SUCCESSFUL + projects: + - name: 'testapi-automate-docker-deploy-{stream}' + current-parameters: true + kill-phase-on: FAILURE + abort-all-job: true + - multijob: + name: generate-doc + condition: SUCCESSFUL + projects: + - name: 'testapi-automate-generate-doc-{stream}' + current-parameters: true + kill-phase-on: FAILURE + abort-all-job: true + + publishers: + - 'email-publisher' + +- job-template: + name: 'testapi-automate-{phase}-{stream}' + + properties: + - throttle: + enabled: true + max-per-node: 1 + option: 'project' + + wrappers: + - ssh-agent-wrapper + - timeout: + timeout: 120 + fail: true + + scm: + - git-scm + + builders: + - 'testapi-automate-{phase}-macro' ################################ # job builders @@ -129,25 +205,49 @@ bash ./jjb/releng/testapi-backup-mongodb.sh - builder: - name: run-unit-tests + name: 'run-unit-tests' builders: - shell: | bash ./utils/test/testapi/run_test.sh - builder: - name: docker-update + name: 'testapi-automate-docker-update-macro' builders: - shell: | bash ./jjb/releng/testapi-docker-update.sh - builder: - name: testapi-doc-build + name: 'testapi-automate-generate-doc-macro' + builders: + - 'testapi-doc-build' + - 'upload-doc-artifact' + +- builder: + name: 'testapi-doc-build' builders: - shell: | bash ./utils/test/testapi/htmlize/doc-build.sh - builder: - name: upload-doc-artifact + name: 'upload-doc-artifact' builders: - shell: | bash ./utils/test/testapi/htmlize/push-doc-artifact.sh + +- builder: + name: 'testapi-automate-docker-deploy-macro' + builders: + - shell: | + bash ./jjb/releng/testapi-docker-deploy.sh + +################################ +# job publishers +################################ + +- publisher: + name: 'email-publisher' + publishers: + - email: + recipients: rohitsakala@gmail.com serena.feng.711@gmail.com + notify-every-unstable-build: false + send-to-individuals: true
\ No newline at end of file diff --git a/jjb/releng/testapi-docker-deploy.sh b/jjb/releng/testapi-docker-deploy.sh new file mode 100644 index 000000000..04d71f76e --- /dev/null +++ b/jjb/releng/testapi-docker-deploy.sh @@ -0,0 +1,81 @@ +#!/bin/bash + +function check() { + + # Verify hosted + sleep 5 + cmd=`curl -s --head --request GET http://testresults.opnfv.org/auto/swagger/spec | grep '200 OK' > /dev/null` + rc=$? + echo $rc + + if [[ $rc == 0 ]] + then + return 0 + else + return 1 + fi + +} + +echo "Getting contianer Id of the currently running one" +contId=$(sudo docker ps | grep "opnfv/testapi:latest" | awk '{print $1}') + +echo "Pulling the latest image" +sudo docker pull opnfv/testapi:latest + +echo "Deleting old containers of opnfv/testapi:old" +sudo docker ps -a | grep "opnfv/testapi" | grep "old" | awk '{print $1}' | xargs -r sudo docker rm -f + +echo "Deleting old images of opnfv/testapi:latest" +sudo docker images | grep "opnfv/testapi" | grep "old" | awk '{print $3}' | xargs -r sudo docker rmi -f + + +if [[ -z "$contId" ]] +then + echo "No running testapi container" + + echo "Removing stopped testapi containers in the previous iterations" + sudo docker ps -f status=exited | grep "opnfv_testapi" | awk '{print $1}' | xargs -r sudo docker rm -f +else + echo $contId + + echo "Get the image id of the currently running conatiner" + currImgId=$(sudo docker ps | grep "$contId" | awk '{print $2}') + echo $currImgId + + if [[ -z "$currImgId" ]] + then + echo "No image id found for the container id" + exit 1 + fi + + echo "Changing current image tag to old" + sudo docker tag "$currImgId" opnfv/testapi:old + + echo "Removing stopped testapi containers in the previous iteration" + sudo docker ps -f status=exited | grep "opnfv_testapi" | awk '{print $1}' | xargs -r sudo docker rm -f + + echo "Renaming the running container name to opnfv_testapi as to identify it." + sudo docker rename $contId opnfv_testapi + + echo "Stop the currently running container" + sudo docker stop $contId +fi + +echo "Running a container with the new image" +sudo docker run -dti -p "8711:8000" -e "mongodb_url=mongodb://172.17.0.1:27017" -e "swagger_url=http://testresults.opnfv.org/auto" opnfv/testapi:latest + +if check; then + echo "TestResults Hosted." +else + echo "TestResults Hosting Failed" + if [[ $(sudo docker images | grep "opnfv/testapi" | grep "old" | awk '{print $3}') ]]; then + echo "Running old Image" + sudo docker run -dti -p "8711:8000" -e "mongodb_url=mongodb://172.17.0.1:27017" -e "swagger_url=http://testresults.opnfv.org/auto" opnfv/testapi:old + exit 1 + fi +fi + +# Echo Images and Containers +sudo docker images +sudo docker ps -a |