Move build job to ericsson's node and upload compass artifacts 44/1444/14
authorm00133142 <meimei@huawei.com>
Thu, 10 Sep 2015 02:29:54 +0000 (10:29 +0800)
committerFatih Degirmenci <fatih.degirmenci@ericsson.com>
Thu, 10 Sep 2015 12:28:44 +0000 (12:28 +0000)
- undo uploading to internal repo
- upload compass artifacts to gs repo
- download compass artifacts from gs repo proxy

JIRA:COMPASS-38

Change-Id: I59abfa88501b84fc20b44e905605a06934154984
Signed-off-by: m00133142 <meimei@huawei.com>
jjb/compass4nfv/compass4nfv.yml

index e56c262..b53dc84 100644 (file)
@@ -8,7 +8,6 @@
     jobs:
         - 'compass-verify'
         - 'compass-verify-on-ericsson-node'
     jobs:
         - 'compass-verify'
         - 'compass-verify-on-ericsson-node'
-        - 'compass-upload-iso'
         - 'compass-merge'
         - 'compass-daily-{stream}'
         - 'compass-build'
         - 'compass-merge'
         - 'compass-daily-{stream}'
         - 'compass-build'
 ########################
 # job templates
 ########################
 ########################
 # job templates
 ########################
-- job-template:
-    name: '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-from-upstream-build'
-        - 'compass-upload-artifact'
-
 - job-template:
     name: 'compass-verify-on-ericsson-node'
 
 - job-template:
     name: 'compass-verify-on-ericsson-node'
 
             branch: 'master'
         - compass-parameter:
             installer: '{installer}'
             branch: 'master'
         - compass-parameter:
             installer: '{installer}'
+
     scm:
         - gerrit-trigger-scm:
             credentials-id: '{ssh-credentials}'
     scm:
         - gerrit-trigger-scm:
             credentials-id: '{ssh-credentials}'
 
     project-type: freestyle
 
 
     project-type: freestyle
 
-    node: huawei-build
+    node: ericsson-build
 
     logrotate:
         daysToKeep: 30
 
     logrotate:
         daysToKeep: 30
 
     builders:
         - 'compass-build'
 
     builders:
         - 'compass-build'
-        - 'compass-workspace-cleanup'
-
-    publishers:
-        - archive:
-            artifacts: '$BUILD_DIRECTORY/*.*'
-            allow-empty: 'true'
-            fingerprint: true
-        - trigger:
-            project: 'compass-upload-iso'
-            threshold: SUCCESS
+        - 'compass-upload-artifact'
 
 - job-template:
     name: 'compass-deploy-virtual-{flavor}'
 
 - job-template:
     name: 'compass-deploy-virtual-{flavor}'
 
     builders:
         - 'compass-ci-preclean-workspace'
 
     builders:
         - 'compass-ci-preclean-workspace'
-        - 'compass-download-artifact-from-internal-repo'
+        - 'compass-download-artifact'
         - 'compass-deploy-virtual-flavor'
 
 ########################
         - 'compass-deploy-virtual-flavor'
 
 ########################
             description: "Installer to use."
         - string:
             name: BUILD_DIRECTORY
             description: "Installer to use."
         - string:
             name: BUILD_DIRECTORY
-            default: build_output
+            default: $WORKSPACE/build_output
             description: "Directory where the build artifact will be located upon the completion of the build."
         - string:
             name: CACHE_DIRECTORY
             description: "Directory where the build artifact will be located upon the completion of the build."
         - string:
             name: CACHE_DIRECTORY
-            default: $HOME/opnfv/cache/
+            default: $HOME/opnfv/cache/$PROJECT
             description: "Directory where the cache to be used during the build is located."
         - string:
             name: GIT_BASE
             description: "Directory where the cache to be used during the build is located."
         - string:
             name: GIT_BASE
             description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
         - string:
             name: GS_URL
             description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
         - string:
             name: GS_URL
-            default: artifacts.opnfv.org/$PROJECT/$INSTALLER
+            default: artifacts.opnfv.org/$PROJECT/
             description: "URL to Google Storage."
             description: "URL to Google Storage."
+        - string:
+            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: INTERNAL_REPO_XA
             default: "root@192.168.127.11:~/xh/work/build/work"
             description: "Artifact Repository"
-        - string:
-            name: ISO_DIRECTORY
-            default: "http://192.168.127.11:9999/"
+
 
 ########################
 # builder macros
 ########################
 
 ########################
 # builder macros
 ########################
-- builder:
-    name: compass-copy-artifact-from-upstream-build
-    builders:
-        - copyartifact:
-            project: "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:
     name: compass-merge
     builders:
 - builder:
     name: compass-merge
     builders:
 
             # create the cache directory if it doesn't exist
             [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
 
             # create the cache directory if it doesn't exist
             [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
+            [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
 
             # set OPNFV_ARTIFACT_VERSION
             export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
 
             # start the build
             cd $WORKSPACE/
 
             # set OPNFV_ARTIFACT_VERSION
             export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
 
             # start the build
             cd $WORKSPACE/
-            mkdir $WORKSPACE/$BUILD_DIRECTORY
-            ./build.sh  --iso-dir $WORKSPACE/$BUILD_DIRECTORY/ --iso-name compass.iso -c $CACHE_DIRECTORY
+            ./build.sh  --iso-dir $BUILD_DIRECTORY/ --iso-name compass.iso -c $CACHE_DIRECTORY
 
             # list the build artifacts
 
             # list the build artifacts
-            ls -al $WORKSPACE/$BUILD_DIRECTORY
+            ls -al $BUILD_DIRECTORY
 
             # save information regarding artifact into file
             (
 
             # save information regarding artifact into file
             (
                 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_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_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
                 echo "OPNFV_BUILD_URL=$BUILD_URL"
                 echo "OPNFV_BUILD_URL=$BUILD_URL"
-            ) > $WORKSPACE/$BUILD_DIRECTORY/opnfv.properties
+            ) > $BUILD_DIRECTORY/opnfv.properties
             echo
             echo "--------------------------------------------------------"
             echo "Done!"
 
             echo
             echo "--------------------------------------------------------"
             echo "Done!"
 
-            sudo rm -rf $WORKSPACE/work/
+            sudo rm -rf $WORKSPACE/work
 
 - builder:
     name: 'compass-deploy-virtual-flavor'
 
 - builder:
     name: 'compass-deploy-virtual-flavor'
             echo "--------------------------------------------------------"
             echo
 
             echo "--------------------------------------------------------"
             echo
 
-            export ISO_URL=$WORKSPACE/$BUILD_DIRECTORY/compass.iso
+            export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
             cd $WORKSPACE
             ./deploy.sh $FLAVOR_CONF
 
             echo
             echo "--------------------------------------------------------"
             echo "Done!"
             cd $WORKSPACE
             ./deploy.sh $FLAVOR_CONF
 
             echo
             echo "--------------------------------------------------------"
             echo "Done!"
-- builder:
-    name: 'compass-download-artifact-from-internal-repo'
-    builders:
-        - shell: |
-            #!/bin/bash
-            echo "download iso from internal repo"
-            curl -s -o $WORKSPACE/$BUILD_DIRECTORY/compass.iso $ISO_DIRECTORY/compass.iso > download.iso.log 2>&1
 
 - builder:
     name: 'compass-upload-artifact'
 
 - builder:
     name: 'compass-upload-artifact'
             echo
 
             # source the opnfv.properties to get ARTIFACT_VERSION
             echo
 
             # source the opnfv.properties to get ARTIFACT_VERSION
-            source $WORKSPACE/$BUILD_DIRECTORY/opnfv.properties
-
-            scp $WORKSPACE/$BUILD_DIRECTORY/compass.iso $INTERNAL_REPO_XA/
-            scp $WORKSPACE/$BUILD_DIRECTORY/opnfv.properties $INTERNAL_REPO_XA/
-            scp $WORKSPACE/$BUILD_DIRECTORY/compass.iso $INTERNAL_REPO_XA/opnfv-$OPNFV_ARTIFACT_VERSION.iso
+            source $BUILD_DIRECTORY/opnfv.properties
 
             # upload artifact and additional files to google storage
 
             # upload artifact and additional files to google storage
-            gsutil cp $WORKSPACE/$BUILD_DIRECTORY/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
-            gsutil cp $WORKSPACE/$BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
-            gsutil cp $WORKSPACE/$BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
+            gsutil cp $BUILD_DIRECTORY/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
+            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
             echo "--------------------------------------------------------"
             echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
 
 - builder:
             echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
 
 - builder:
-    name: 'compass-download-artifact-from-opnfv-repo'
+    name: 'compass-download-artifact'
     builders:
         - shell: |
             #!/bin/bash
     builders:
         - shell: |
             #!/bin/bash