X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=jjb%2Fcompass4nfv%2Fcompass4nfv.yml;h=3645bbba339b48c0c097217ece8ba7bae10685af;hb=a2c1087761be5f8b3fa792f11b52615165b58ec5;hp=032cd9b37e205f8dd6c17ad6800932f0ef3cc79c;hpb=140a1099660354535c07d9baf863998e6a58b6cc;p=releng.git diff --git a/jjb/compass4nfv/compass4nfv.yml b/jjb/compass4nfv/compass4nfv.yml index 032cd9b37..3645bbba3 100644 --- a/jjb/compass4nfv/compass4nfv.yml +++ b/jjb/compass4nfv/compass4nfv.yml @@ -1,4 +1,3 @@ -# this is the job configuration for bgs - project: name: compass @@ -6,29 +5,32 @@ installer: 'compass' jobs: - - 'compass-verify' - - 'compass-verify-on-ericsson-node' - - 'compass-merge' + - 'compass-verify-{stream}' - 'compass-daily-{stream}' - - 'compass-build-iso' - - 'compass-build' + - 'compass-build-iso-{stream}' + - 'compass-build-ppa-{stream}' - 'compass-deploy-virtual-{flavor}' + - 'compass-deploy-bare-huawei-us' - # stream: branch with - in place of / (eg. stable-helium) - # branch: branch (eg. stable/helium) +# only master branch is enabled at the moment to keep no of jobs sane stream: - master: branch: 'master' + gs-pathname: '' +# - brahmaputra: +# branch: 'stable/brahmaputra' +# gs-pathname: '/brahmaputra' flavor: - - five: - conf: 'virtual_five' - node: 'huawei-build' + - cluster-odl: + conf: 'virtual_cluster_odl' + node: 'huawei-deploy-vm' + - cluster-onos: + conf: 'virtual_cluster_onos' + node: 'huawei-deploy-vm' - cluster: conf: 'virtual_cluster' - node: 'huawei-build' - - + node: 'huawei-deploy-vm' project: 'compass4nfv' @@ -36,84 +38,25 @@ # job templates ######################## - job-template: - name: 'compass-verify-on-ericsson-node' - - project-type: freestyle - - disabled: true - - node: ericsson-build - - logrotate: - daysToKeep: 30 - numToKeep: 10 - artifactDaysToKeep: -1 - artifactNumToKeep: -1 - - parameters: - - project-parameter: - project: '{project}' - - gerrit-parameter: - branch: 'master' - - compass-parameter: - installer: '{installer}' - - scm: - - gerrit-trigger-scm: - credentials-id: '{ssh-credentials}' - refspec: '$GERRIT_REFSPEC' - choosing-strategy: 'gerrit' - - wrappers: - - ssh-agent-credentials: - user: '{ssh-credentials}' - - triggers: - - gerrit: - 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: '**/master' - forbidden-file-paths: - - compare-type: ANT - pattern: 'docs/**' - - builders: - - 'builder-compass-build-iso' - - 'builder-compass-workspace-cleanup' - -- job-template: - name: 'compass-verify' - - project-type: freestyle + name: 'compass-verify-{stream}' disabled: false - node: huawei-build + node: 'huawei-deploy-vm' + + concurrent: true - logrotate: - daysToKeep: 30 - numToKeep: 10 - artifactDaysToKeep: -1 - artifactNumToKeep: -1 + properties: + - throttle: + enabled: true + max-total: 3 + max-per-node: 1 parameters: - project-parameter: project: '{project}' - gerrit-parameter: - branch: 'master' + branch: '{branch}' - compass-parameter: installer: '{installer}' - string: @@ -126,10 +69,6 @@ refspec: '$GERRIT_REFSPEC' choosing-strategy: 'gerrit' - wrappers: - - ssh-agent-credentials: - user: '{ssh-credentials}' - triggers: - gerrit: trigger-on: @@ -147,77 +86,32 @@ project-pattern: '{project}' branches: - branch-compare-type: 'ANT' - branch-pattern: '**/master' + branch-pattern: '**/{branch}' forbidden-file-paths: - compare-type: ANT - pattern: 'docs/**' + pattern: 'docs/**|.gitignore' builders: - 'builder-compass-build-iso' -# - 'builder-compass-deploy-virtual-flavor' -# - 'builder-compass-backup-logs' -# publishers: -# - archive: -# artifacts: 'ansible.log' -# allow-empty: 'true' -# fingerprint: true + - 'builder-compass-deploy-virtual-flavor' + publishers: + - archive: + artifacts: 'ansible.log' + allow-empty: 'true' + fingerprint: true - job-template: - name: 'compass-merge' - - # builder-merge job to run JJB update - # - # This job's purpose is to update all the JJB - - project-type: freestyle + name: 'compass-daily-{stream}' node: huawei-build - logrotate: - daysToKeep: 30 - numToKeep: 40 - artifactDaysToKeep: -1 - artifactNumToKeep: 5 - - parameters: - - project-parameter: - project: '{project}' - - gerrit-parameter: - branch: 'master' - - compass-parameter: - installer: '{installer}' - - scm: - - gerrit-trigger-scm: - credentials-id: '{ssh-credentials}' - refspec: '' - choosing-strategy: 'default' - - wrappers: - - ssh-agent-credentials: - user: '{ssh-credentials}' - - triggers: - - gerrit: - 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: '**/master' - builders: - - 'builder-compass-merge' - -- job-template: - name: 'compass-daily-{stream}' + concurrent: true - project-type: freestyle - - node: huawei-build + properties: + - throttle: + enabled: true + max-total: 1 + max-per-node: 1 parameters: - project-parameter: @@ -232,42 +126,38 @@ branch: '{branch}' triggers: - - pollscm: '@midnight' - - logrotate: - daysToKeep: 30 - numToKeep: 10 - artifactDaysToKeep: -1 - artifactNumToKeep: -1 + - timed: '@midnight' builders: - #- 'builder-compass-build-iso' - #- 'builder-compass-upload-artifact' - #- 'builder-compass-workspace-cleanup' - - shell: | - echo "Hello world!" - echo "compass-deploy-virtual job will be triggered!" - - publishers: - - trigger: - project: 'compass-build' - threshold: SUCCESS - - trigger: - project: 'compass-deploy-virtual-cluster' - threshold: SUCCESS + - trigger-builds: + - project: 'compass-build-iso-{stream}' + git-revision: true + block: true + - trigger-builds: + - project: 'compass-deploy-virtual-cluster' + git-revision: true + block: true +# - trigger-builds: +# - project: 'compass-deploy-virtual-cluster-odl' +# git-revision: true +# block: true + - trigger-builds: + - project: 'compass-deploy-virtual-cluster-onos' + git-revision: true + block: true - job-template: - name: 'compass-build-iso' - - project-type: freestyle + name: 'compass-build-iso-{stream}' node: ericsson-build - logrotate: - daysToKeep: 30 - numToKeep: 10 - artifactDaysToKeep: -1 - artifactNumToKeep: -1 + concurrent: true + + properties: + - throttle: + enabled: true + max-total: 1 + max-per-node: 1 parameters: - project-parameter: @@ -279,7 +169,7 @@ - git-scm: credentials-id: '{ssh-credentials}' refspec: '' - branch: 'master' + branch: '{branch}' builders: - 'builder-compass-build-iso' @@ -287,19 +177,19 @@ - 'builder-compass-workspace-cleanup' - job-template: - name: 'compass-build' + name: 'compass-build-ppa-{stream}' description: "build ppa(using docker) in huawei lab" - project-type: freestyle - node: huawei-build - logrotate: - daysToKeep: 30 - numToKeep: 10 - artifactDaysToKeep: -1 - artifactNumToKeep: -1 + concurrent: true + + properties: + - throttle: + enabled: true + max-total: 1 + max-per-node: 1 parameters: - project-parameter: @@ -310,26 +200,30 @@ scm: - git-scm: credentials-id: '{ssh-credentials}' - refspec: '' - branch: 'master' + branch: '{branch}' + + triggers: + - timed: 'H 16 * * *' builders: - 'builder-compass-make-ppa' - - trigger-builds: - - project: 'compass-build-iso' - git-revision: true - block: true - job-template: name: 'compass-deploy-virtual-{flavor}' - project-type: freestyle - disabled: false node: '{node}' + concurrent: true + + properties: + - throttle: + enabled: true + max-total: 1 + max-per-node: 1 + parameters: - project-parameter: project: '{project}' @@ -340,20 +234,42 @@ default: '{conf}' description: "" - triggers: - - pollscm: "H/2 * * * *" + builders: + - 'builder-compass-ci-preclean-workspace' + - 'builder-compass-download-artifact' + - 'builder-compass-deploy-virtual-flavor' + publishers: + - archive: + artifacts: 'ansible.log' + allow-empty: 'true' + fingerprint: true - logrotate: - daysToKeep: 30 - numToKeep: 10 - artifactDaysToKeep: -1 - artifactNumToKeep: -1 +- job-template: + name: 'compass-deploy-bare-huawei-us' + + disabled: false + + node: 'huawei-us-deploy-bare-1' + + concurrent: true + + properties: + - throttle: + enabled: true + max-total: 1 + max-per-node: 1 + + parameters: + - project-parameter: + project: '{project}' + - compass-parameter: + installer: '{installer}' builders: - 'builder-compass-ci-preclean-workspace' - 'builder-compass-download-artifact' - - 'builder-compass-deploy-virtual-flavor' - - 'builder-compass-backup-logs' + - 'builder-compass-deploy-bare' + publishers: - archive: artifacts: 'ansible.log' @@ -390,31 +306,29 @@ name: GS_URL_PROXY default: build.opnfv.org/artifacts/$PROJECT/ description: "URL to Google Storage proxy" - - string: - name: INTERNAL_REPO_XA - default: "root@192.168.127.11:~/xh/work/build/work" - description: "Artifact Repository" - - string: name: installer_ip - default: "10.1.0.12" + default: "192.168.200.2" - string: name: PPA_REPO - default: "http://58.251.166.184:9999" + default: "http://205.177.226.235:9999" - string: name: PPA_CACHE default: "$WORKSPACE/work/repo/" + - choice: + name: COMPASS_OPENSTACK_VERSION + choices: + - 'liberty' + - 'juno' + - choice: + name: COMPASS_OS_VERSION + choices: + - 'ubuntu-trusty' + - 'rhel7' ######################## # builder macros ######################## -- builder: - name: 'builder-compass-merge' - builders: - - shell: | - #!/bin/bash - echo "Hello World!" - - builder: name: 'builder-compass-make-ppa' builders: @@ -429,15 +343,12 @@ ./build/make_repo.sh # calc MD5 of ppa cd $PPA_CACHE - for i in `find *.gz *.iso *.img -type f` + for i in $(find *.gz *.iso *.img -type f) do - md5=`md5sum $i | cut -d ' ' -f1` + md5=$(md5sum $i | cut -d ' ' -f1) echo $md5 > $i.md5 - done - # upload PPA - for i in `find *.* -type f` - do curl -T $i $PPA_REPO + curl -T $i.md5 $PPA_REPO done - builder: @@ -491,9 +402,6 @@ builders: - shell: | #!/bin/bash - set -o errexit - set -o nounset - set -o pipefail set -x # log info to console @@ -502,13 +410,64 @@ echo export ISO_URL=file://$BUILD_DIRECTORY/compass.iso + sudo brctl addbr vnic_ci + sudo ifconfig vnic_ci up + export EXTERNAL_NIC=vnic_ci cd $WORKSPACE + + export OS_VERSION=${COMPASS_OS_VERSION} + export OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION} ./deploy.sh $FLAVOR_CONF + if [ $? -ne 0 ]; then + echo "depolyment failed!" + deploy_ret=1 + fi + + echo + echo "--------------------------------------------------------" + echo "Done!" + + ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" + sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_${COMPASS_OPENSTACK_VERSION}-opnfv2/ansible.log ./ &> /dev/null + + exit $deploy_ret + +- builder: + name: 'builder-compass-deploy-bare' + builders: + - shell: | + #!/bin/bash + set -x + + # log info to console + echo "Starting the deployment on baremetal environment using $INSTALLER. This could take some time..." + echo "--------------------------------------------------------" + echo + + export CONFDIR=$WORKSPACE/deploy/conf/hardware_environment/huawei_us_lab/pod1 + export ISO_URL=file://$BUILD_DIRECTORY/compass.iso + export EXTERNAL_NIC=eth0 + export INSTALL_NIC=eth1 + + cd $WORKSPACE + + export OS_VERSION=${COMPASS_OS_VERSION} + export OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION} + ./deploy.sh --dha $CONFDIR/dha.yml --network $CONFDIR/network.yml + if [ $? -ne 0 ]; then + echo "depolyment failed!" + deploy_ret=1 + fi echo echo "--------------------------------------------------------" echo "Done!" + ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" + sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_${COMPASS_OPENSTACK_VERSION}-opnfv2/ansible.log ./ &> /dev/null + + exit $deploy_ret + - builder: name: 'builder-compass-upload-artifact' builders: @@ -531,7 +490,6 @@ gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1 - echo echo "--------------------------------------------------------" echo "Done!" @@ -552,19 +510,20 @@ echo # get the latest.properties file in order to get info regarding latest artifact - curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties + [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY + curl -s -o $BUILD_DIRECTORY/latest.properties http://$GS_URL/latest.properties # check if we got the file - [[ -f latest.properties ]] || exit 1 + [[ -f $BUILD_DIRECTORY/latest.properties ]] || exit 1 # source the file so we get OPNFV vars - source latest.properties + source $BUILD_DIRECTORY/latest.properties # download the file - curl -s -o $WORKSPACE/compass.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1 + curl -s -o $BUILD_DIRECTORY/compass.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1 # list the file - ls -al $WORKSPACE/compass.iso + ls -al $BUILD_DIRECTORY/compass.iso echo echo "--------------------------------------------------------" @@ -595,9 +554,3 @@ sudo rm $WORKSPACE -rf git clone $GIT_BASE $WORKSPACE -- builder: - name: 'builder-compass-backup-logs' - builders: - - shell: | - ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" - sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_juno-opnfv2/ansible.log ./ &> /dev/null