summaryrefslogtreecommitdiffstats
path: root/jjb/genesis
diff options
context:
space:
mode:
Diffstat (limited to 'jjb/genesis')
-rw-r--r--jjb/genesis/docu-build.sh62
-rwxr-xr-xjjb/genesis/genesis-compass.yml122
2 files changed, 149 insertions, 35 deletions
diff --git a/jjb/genesis/docu-build.sh b/jjb/genesis/docu-build.sh
index ffb131114..52e380663 100644
--- a/jjb/genesis/docu-build.sh
+++ b/jjb/genesis/docu-build.sh
@@ -9,39 +9,41 @@ echo "Build"
echo "-----"
echo
-make
+#make
echo
echo "Upload"
echo "------"
echo
-# NOTE: make sure source parameters for GS paths are not empty.
-[[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
-[[ $GERRIT_PROJECT =~ .+ ]]
-[[ $GERRIT_BRANCH =~ .+ ]]
-
-gs_path_review="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
-if [[ $GERRIT_BRANCH = "master" ]] ; then
- gs_path_branch="artifacts.opnfv.org/$GERRIT_PROJECT"
-else
- gs_path_branch="artifacts.opnfv.org/$GERRIT_PROJECT/${{GERRIT_BRANCH##*/}}"
-fi
-
-if [[ $JOB_NAME =~ "verify" ]] ; then
- gsutil cp -r build/* "gs://$gs_path_review/"
- echo
- echo "Document is available at http://$gs_path_review"
-else
- gsutil cp -r build/design_docs "gs://$gs_path_branch/"
- gsutil cp -r build/requirements/html "gs://$gs_path_branch/"
- gsutil cp -r build/requirements/latex/*.pdf "gs://$gs_path_branch/"
- echo
- echo "Latest document is available at http://$gs_path_branch"
-
- if gsutil ls "gs://$gs_path_review" > /dev/null 2>&1 ; then
- echo
- echo "Deleting Out-of-dated Documents..."
- gsutil rm -r "gs://$gs_path_review"
- fi
-fi
+echo "document generation disabled"
+
+## NOTE: make sure source parameters for GS paths are not empty.
+#[[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
+#[[ $GERRIT_PROJECT =~ .+ ]]
+#[[ $GERRIT_BRANCH =~ .+ ]]
+#
+#gs_path_review="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
+#if [[ $GERRIT_BRANCH = "master" ]] ; then
+# gs_path_branch="artifacts.opnfv.org/$GERRIT_PROJECT"
+#else
+# gs_path_branch="artifacts.opnfv.org/$GERRIT_PROJECT/${{GERRIT_BRANCH##*/}}"
+#fi
+#
+#if [[ $JOB_NAME =~ "verify" ]] ; then
+# gsutil cp -r build/* "gs://$gs_path_review/"
+# echo
+# echo "Document is available at http://$gs_path_review"
+#else
+# gsutil cp -r build/design_docs "gs://$gs_path_branch/"
+# gsutil cp -r build/requirements/html "gs://$gs_path_branch/"
+# gsutil cp -r build/requirements/latex/*.pdf "gs://$gs_path_branch/"
+# echo
+# echo "Latest document is available at http://$gs_path_branch"
+#
+# if gsutil ls "gs://$gs_path_review" > /dev/null 2>&1 ; then
+# echo
+# echo "Deleting Out-of-dated Documents..."
+# gsutil rm -r "gs://$gs_path_review"
+# fi
+#fi
diff --git a/jjb/genesis/genesis-compass.yml b/jjb/genesis/genesis-compass.yml
index 3a0f8509d..a82c381a7 100755
--- a/jjb/genesis/genesis-compass.yml
+++ b/jjb/genesis/genesis-compass.yml
@@ -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)
@@ -27,11 +29,37 @@
- 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'
@@ -194,6 +222,43 @@
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}'
@@ -239,7 +304,7 @@
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
@@ -255,11 +320,22 @@
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:
@@ -280,7 +356,38 @@
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'
@@ -333,14 +440,19 @@
# 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'