Merge "enable compass verify job"
authorJun Li <matthew.lijun@huawei.com>
Wed, 12 Aug 2015 02:40:03 +0000 (02:40 +0000)
committerGerrit Code Review <gerrit@172.30.200.206>
Wed, 12 Aug 2015 02:40:03 +0000 (02:40 +0000)
1  2 
jjb/genesis/genesis-compass.yml

@@@ -7,10 -7,8 +7,10 @@@
  
      jobs:
          - 'genesis-compass-verify'
 +        - 'genesis-compass-upload-iso'
          - 'genesis-compass-merge'
          - 'genesis-compass-daily-{stream}'
 +        - 'genesis-compass-build'
          - 'genesis-compass-deploy-virtual-{flavor}'
  
      # stream:    branch with - in place of / (eg. stable-helium)
  
  
  
 -    project: 'genesis'
 +    project: 'compass4nfv'
  
  ########################
  # job templates
  ########################
 +- job-template:
 +    name: 'genesis-compass-upload-iso'
 +    project-type: freestyle
 +    disabled: false
 +
 +    node: master
 +
 +    logrotate:
 +        daysToKeep: 30
 +        numToKeep: 10
 +        artifactDaysToKeep: -1
 +        artifactNumToKeep: -1
 +
 +    parameters:
 +        - project-parameter:
 +            project: '{project}'
 +        - compass-parameter:
 +             installer: '{installer}'
 +
 +    wrappers:
 +        - ssh-agent-credentials:
 +            user: '{ssh-credentials}'
 +
 +    builders:
 +        - 'compass-copy-artifact'
 +        - 'compass-upload-artifact'
  
  - job-template:
      name: 'genesis-compass-verify'
  
      project-type: freestyle
  
-     disabled: true
+     disabled: false
  
      node: compass-build-deploy-03
  
              project: 'genesis-compass-deploy-virtual-cluster'
              threshold: SUCCESS
  
 +- job-template:
 +    name: 'genesis-compass-build'
 +
 +    project-type: freestyle
 +
 +    node: compass-build-deploy-03
 +
 +    logrotate:
 +        daysToKeep: 30
 +        numToKeep: 10
 +        artifactDaysToKeep: -1
 +        artifactNumToKeep: -1
 +
 +    parameters:
 +        - project-parameter:
 +            project: '{project}'
 +        - compass-parameter:
 +            installer: '{installer}'
 +
 +    scm:
 +        - git-scm:
 +            credentials-id: '{ssh-credentials}'
 +            refspec: ''
 +            branch: 'master'
 +
 +    builders:
 +        - 'compass-build'
 +        - 'compass-workspace-cleanup'
 +
 +    publishers:
 +        - archive:
 +            artifacts: '$BUILD_DIRECTORY/*.*'
 +            allow-empty: 'true'
 +            fingerprint: true
 +        - trigger:
 +            project: 'genesis-compass-upload-iso'
 +            threshold: SUCCESS
  
  - job-template:
      name: 'genesis-compass-deploy-virtual-{flavor}'
              description: "Installer to use."
          - string:
              name: BUILD_DIRECTORY
 -            default: $WORKSPACE/build_output
 +            default: build_output
              description: "Directory where the build artifact will be located upon the completion of the build."
          - string:
              name: CACHE_DIRECTORY
              description: "URL to Google Storage."
          - string:
              name: INTERNAL_REPO
 -            default: "root@192.168.121.12:~/kun/artifacts"
 +            default: "root@192.168.127.11:~/xh/work/build/work"
              description: "Artifact Repository"
  ########################
  # builder macros
  ########################
 +- builder:
 +    name: compass-copy-artifact
 +    builders:
 +        - copyartifact:
 +            project: "genesis-compass-build"
 +            filter: "$BUILD_DIRECTORY/compass.iso, $BUILD_DIRECTORY/opnfv.properties"
 +            target: ./
 +            which-build: upstream-build
 +            optional: true
 +            flatten: true
 +            parameter-filters: PUBLISH=true
  
  
  - builder:
              set -o pipefail
  
              # log info to console
 -            echo "Hello world!"
 +            echo "Starting the build of $INSTALLER. This could take some time..."
 +            echo "--------------------------------------------------------"
 +            echo
 +
 +            # create the cache directory if it doesn't exist
 +            [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
 +
 +            # set OPNFV_ARTIFACT_VERSION
 +            export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
 +
 +            # start the build
 +            cd $WORKSPACE/$INSTALLER/ci
 +            ./build.sh
 +            mkdir $WORKSPACE/$BUILD_DIRECTORY
 +            mv $WORKSPACE/$INSTALLER/ci/work/compass.iso $WORKSPACE/$BUILD_DIRECTORY/
 +
 +            # list the build artifacts
 +            ls -al $WORKSPACE/$BUILD_DIRECTORY
 +
 +            # save information regarding artifact into file
 +            (
 +                echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
 +                echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
 +                echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
 +                echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
 +                echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $WORKSPACE/$BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
 +                echo "OPNFV_BUILD_URL=$BUILD_URL"
 +            ) > $WORKSPACE/$BUILD_DIRECTORY/opnfv.properties
 +
 +            echo
 +            echo "--------------------------------------------------------"
 +            echo "Done!"
  
  - builder:
      name: 'compass-deploy'
              # source the opnfv.properties to get ARTIFACT_VERSION
              source $WORKSPACE/opnfv.properties
  
 +            scp $WORKSPACE/compass.iso $INTERNAL_REPO/
 +            scp $WORKSPACE/opnfv.properties $INTERNAL_REPO/
 +            scp $WORKSPACE/compass.iso $INTERNAL_REPO/opnfv-$OPNFV_ARTIFACT_VERSION.iso
 +
              # upload artifact and additional files to google storage
 -            gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
 +            gsutil cp $WORKSPACE/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
              gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
              gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
  
              echo
              echo "--------------------------------------------------------"
              echo "Done!"
 +            echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
  
  - builder:
      name: 'compass-download-artifact'