Merge "Add possibility to use local repositories"

This commit is contained in:
Jenkins 2013-12-20 13:34:47 +00:00 committed by Gerrit Code Review
commit a058fc60aa
2 changed files with 41 additions and 10 deletions

View File

@ -7,14 +7,26 @@ NOTE: You should use Ubuntu or Fedora host OS for building images, CentOS as a h
For users:
1. Use your environment (export / setenv) to alter the scripts behavior. Environment variables the script accepts are DIB_HADOOP_VERSION, JAVA_DOWNLOAD_URL, OOZIE_DOWNLOAD_URL, HIVE_VERSION, ubuntu_image_name, fedora_image_name.
1. Use your environment (export / setenv) to alter the scripts behavior. Environment variables the script accepts are 'DIB_HADOOP_VERSION', 'JAVA_DOWNLOAD_URL', 'OOZIE_DOWNLOAD_URL', 'HIVE_VERSION', 'ubuntu_image_name', 'fedora_image_name'.
2. If you want to use your local mirrors, you should specify http urls for Fedora and Ubuntu mirrors using parameters 'FEDORA_MIRROR' and 'UBUNTU_MIRROR' like this:
2. For creating images just clone this repository and run script.
.. sourcecode:: bash
sudo USE_MIRRORS=true FEDORA_MIRROR="url_for_fedora_mirror" UBUNTU_MIRROR="url_for_ubuntu_mirror" bash diskimage-create.sh
sudo bash savanna-image-elements/diskimage-create/diskimage-create.sh
3. If you want to use your local mirrors, you should specify http urls for Fedora and Ubuntu mirrors using parameters 'FEDORA_MIRROR' and 'UBUNTU_MIRROR' like this:
.. sourcecode:: bash
sudo USE_MIRRORS=true FEDORA_MIRROR="url_for_fedora_mirror" UBUNTU_MIRROR="url_for_ubuntu_mirror" bash savanna-image-elements/diskimage-create/diskimage-create.sh
For developers:
1. If you want to add your element to this repository, you should edit this script in your commit (you should export variables for your element and add name of element to variables 'element_sequence').
2. If you want to test your Patch Set to savanna-image-elements or diskimage-builder, you can specify 'SIM_REPO_PATH' or 'DIB_REPO_PATH' (this parameters should be a full path to repositories) and run this script like this:
.. sourcecode:: bash
sudo SIM_REPO_PATH="$(pwd)/savanna-image-elements" DIB_REPO_PATH="$(pwd)/diskimage-builder" bash savanna-image-elements/diskimage-create/diskimage-create.sh

View File

@ -31,24 +31,43 @@ else
fi
fi
base_dir="$(dirname $(readlink -e $0))"
TEMP=$(mktemp -d diskimage-create.XXXXXX)
pushd $TEMP
export DIB_IMAGE_CACHE=$TEMP/.cache-image-create
# Cloning repostiroies
# Working with repositories
# disk-image-builder repo
git clone https://git.openstack.org/openstack/diskimage-builder
git clone https://git.openstack.org/openstack/savanna-image-elements
if [ -z $DIB_REPO_PATH ]; then
git clone https://git.openstack.org/openstack/diskimage-builder
DIB_REPO_PATH="$(pwd)/diskimage-builder"
fi
pushd diskimage-builder
export PATH=$PATH:$DIB_REPO_PATH/bin
pushd $DIB_REPO_PATH
export DIB_COMMIT_ID=`git rev-parse HEAD`
popd
export PATH=$PATH:$PWD/diskimage-builder/bin
export ELEMENTS_PATH=$PWD/diskimage-builder/elements:$PWD/savanna-image-elements/elements
export ELEMENTS_PATH="$DIB_REPO_PATH/elements"
pushd savanna-image-elements
# savanna-image-elements repo
if [ -z $SIM_REPO_PATH ]; then
SIM_REPO_PATH="$(dirname $base_dir)"
if [ $(basename $SIM_REPO_PATH) != "savanna-image-elements" ]; then
echo "Can't find Savanna-image-elements repository. Cloning it."
git clone https://git.openstack.org/openstack/savanna-image-elements
SIM_REPO_PATH="$(pwd)/savanna-image-elements"
fi
fi
ELEMENTS_PATH=$ELEMENTS_PATH:$SIM_REPO_PATH/elements
pushd $SIM_REPO_PATH
export SAVANNA_ELEMENTS_COMMIT_ID=`git rev-parse HEAD`
popd