]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
jenkins-job-builder: use build_utils
authorAlfredo Deza <adeza@redhat.com>
Tue, 3 May 2016 12:33:50 +0000 (08:33 -0400)
committerAlfredo Deza <adeza@redhat.com>
Tue, 3 May 2016 12:33:50 +0000 (08:33 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
jenkins-job-builder/build/build

index ef0a4c0724bf4c46265a82d854f61a4cd45493a7..95aa2c9d63e95310fd9a3ab3c489c1539de954a5 100644 (file)
@@ -8,24 +8,13 @@
 
 set -ex
 
-# Create the virtualenv
-virtualenv venv
-. venv/bin/activate
+# the following two methods exist in scripts/build_utils.sh
+pkgs=( "jenkins-job-builder" )
+install_python_packages "pkgs[@]"
 
 # Wipe out JJB's cache if $FORCE is set.
 [ "$FORCE" = true ] && rm -rf "$HOME/.cache/jenkins_jobs/"
 
-# Define and ensure the PIP cache
-PIP_SDIST_INDEX="$HOME/.cache/pip"
-mkdir -p $PIP_SDIST_INDEX
-
-# Install the package by trying with the cache first, otherwise doing a download only, and then
-# trying to install from the cache again.
-if ! venv/bin/pip install --find-links="file://$PIP_SDIST_INDEX" --no-index jenkins-job-builder; then
-    venv/bin/pip install --download-directory="$PIP_SDIST_INDEX" jenkins-job-builder
-    venv/bin/pip install --find-links="file://$PIP_SDIST_INDEX" --no-index jenkins-job-builder
-fi
-
 # workaround for https://issues.jenkins-ci.org/browse/JENKINS-16225
 JENKINS_URL=${JENKINS_URL:-"https://jenkins.ceph.com/"}
 JJB_CONFIG="$HOME/.jenkins_jobs.ini"
@@ -46,11 +35,11 @@ for dir in `find . -maxdepth 1 -path ./.git -prune -o -type d -print`; do
         echo "found definitions directory: $definitions_dir"
 
         # Test the definitions first
-        venv/bin/jenkins-jobs --log_level DEBUG --conf $JJB_CONFIG test $definitions_dir -o /tmp/output
+        $VENV/jenkins-jobs --log_level DEBUG --conf $JJB_CONFIG test $definitions_dir -o /tmp/output
 
         # Update Jenkins with the output if they passed the test phase
         # Note that this needs proper permissions with the right credentials to the
         # correct Jenkins instance.
-        venv/bin/jenkins-jobs --log_level DEBUG --conf $JJB_CONFIG update $definitions_dir
+        $VENV/jenkins-jobs --log_level DEBUG --conf $JJB_CONFIG update $definitions_dir
     fi
 done