From: Alfredo Deza Date: Wed, 24 Jun 2015 16:20:35 +0000 (-0400) Subject: rename build to setup script X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5d61655f6eb8218da65aeb66beaf61a4e9c41f7e;p=ceph-build.git rename build to setup script Signed-off-by: Alfredo Deza --- diff --git a/ceph-deploy-pull-requests/build/build b/ceph-deploy-pull-requests/build/build deleted file mode 100644 index dd345e4e..00000000 --- a/ceph-deploy-pull-requests/build/build +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -set -ex - -# Create the virtualenv -virtualenv venv -. venv/bin/activate - -# Define and ensure the PIP cache -PIP_SDIST_INDEX="$HOME/.cache/pip" -mkdir -p $PIP_SDIST_INDEX - -# Define and ensure a GIT Ansible cache -REPO_CACHE="$HOME/.cache/git/ceph-build" -mkdir -p $REPO_CACHE - -# Clone the ceph-build repo or pull if it exists -if [ -d "$REPO_CACHE/.git" ]; then - cd "$REPO_CACHE" && git pull - cd - -else - git clone https://github.com/ceph/ceph-build.git "$REPO_CACHE" -fi - -# 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 ansible; then - venv/bin/pip install --download-directory="$PIP_SDIST_INDEX" ansible - venv/bin/pip install --find-links="file://$PIP_SDIST_INDEX" --no-index ansible -fi - -# run ansible to get this current host to meet our requirements, specifying -# a local connection and 'localhost' as the host where to execute -cd "$REPO_CACHE/ceph-deploy-pull-requests/setup/playbooks" -ansible-playbook -i "localhost," -c local setup.yml diff --git a/ceph-deploy-pull-requests/build/setup b/ceph-deploy-pull-requests/build/setup new file mode 100644 index 00000000..dd345e4e --- /dev/null +++ b/ceph-deploy-pull-requests/build/setup @@ -0,0 +1,35 @@ +#!/bin/bash + +set -ex + +# Create the virtualenv +virtualenv venv +. venv/bin/activate + +# Define and ensure the PIP cache +PIP_SDIST_INDEX="$HOME/.cache/pip" +mkdir -p $PIP_SDIST_INDEX + +# Define and ensure a GIT Ansible cache +REPO_CACHE="$HOME/.cache/git/ceph-build" +mkdir -p $REPO_CACHE + +# Clone the ceph-build repo or pull if it exists +if [ -d "$REPO_CACHE/.git" ]; then + cd "$REPO_CACHE" && git pull + cd - +else + git clone https://github.com/ceph/ceph-build.git "$REPO_CACHE" +fi + +# 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 ansible; then + venv/bin/pip install --download-directory="$PIP_SDIST_INDEX" ansible + venv/bin/pip install --find-links="file://$PIP_SDIST_INDEX" --no-index ansible +fi + +# run ansible to get this current host to meet our requirements, specifying +# a local connection and 'localhost' as the host where to execute +cd "$REPO_CACHE/ceph-deploy-pull-requests/setup/playbooks" +ansible-playbook -i "localhost," -c local setup.yml