]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-release-rpm: install chacractl and the .chacractl config file
authorAndrew Schoen <aschoen@redhat.com>
Mon, 2 Nov 2015 20:58:12 +0000 (14:58 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Mon, 2 Nov 2015 20:58:12 +0000 (14:58 -0600)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
ceph-release-rpm/build/build

index 865a9f96eb456dd9de7f1c720d5790620a20c56f..a6c67ddbda54f25707f09a75611ba47c790d03dc 100644 (file)
@@ -130,6 +130,28 @@ gpgkey=https://download.ceph.com/keys/release.asc
 EOF
 # End of ceph.repo file
 
+# Create the virtualenv
+virtualenv $WORKSPACE/venv
+source $WORKSPACE/venv/bin/activate
+
+# 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 ! pip install --find-links="file://$PIP_SDIST_INDEX" --no-index chacractl; then
+    pip install --exists-action=i --download-directory="$PIP_SDIST_INDEX" chacractl
+    pip install --find-links="file://$PIP_SDIST_INDEX" --no-index chacractl
+fi
+
+# create the .chacractl config file
+cat > $HOME/.chacractl << EOF
+url = "$CHACRACTL_URL"
+user = "$CHACRACTL_USER"
+key = "$CHACRACTL_KEY"
+EOF
+
 rpmbuild -ba --define "_topdir ${BUILDAREA}" --define "_unpackaged_files_terminate_build 0" ${BUILDAREA}/SPECS/ceph-release.spec
 if [ $? -eq 0 ] ; then
     mkdir -p $WORKSPACE/dist