Files
trove/integration/scripts/files/elements/ubuntu-guest/extra-data.d/15-trove-dep
Amrith Kumar 490492b967 beginning to change trove-integration
This commit changes trove-integration and the artifacts that were
brought over from that repository and brings them into the trove
repository.

The things (specifically) done in this commit are:

1. get rid of .gitreview; this is no longer a repository of its own,
it is a part of the trove repository.

2. Update the readme (README.md)

3. Make the elements work in this directory structure

4. Rename the elements and get rid of the name 'reddwarf', change the
name redstack to trovestack

5. Refactor all scripts and make them reflect the new directory
structure.

Change-Id: Iae67fe231b6c7964ca3f31fc593fc9fa4111d5be
2016-10-10 20:30:05 -04:00

49 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
set -e
set -o xtrace
# CONTEXT: HOST prior to IMAGE BUILD as SCRIPT USER
# PURPOSE: Setup the requirements file for use by 15-reddwarf-dep
source $_LIB/die
BRANCH_OVERRIDE=${BRANCH_OVERRIDE:-default}
ADD_BRANCH=$(basename ${BRANCH_OVERRIDE})
REQUIREMENTS_FILE=${TROVESTACK_SCRIPTS}/files/requirements/ubuntu-requirements-${ADD_BRANCH}.txt
[ -n "$TMP_HOOKS_PATH" ] || die "Temp hook path not set"
[ -e ${REQUIREMENTS_FILE} ] || die "Requirements not found"
[ -n "$HOST_USERNAME" ] || die "HOST_USERNAME not set"
sudo -Hiu ${HOST_USERNAME} dd if=${REQUIREMENTS_FILE} of=${TMP_HOOKS_PATH}/requirements.txt
# Grab the upper constraints file, but don't fail if we can't find it.
# If we are running in the CI environment, $DEST will be set and stackrc
# will use $DEST/requirements as the location for the requirements repo.
# Use that as it will help us chain a job with something that is changing UC.
UC_FILE=upper-constraints.txt
if [ -f "${DEST}/requirements/${UC_FILE}" ]; then
echo "Found ${DEST}/requirements/${UC_FILE}, using that"
sudo -Hiu ${HOST_USERNAME} dd if="${DEST}/requirements/${UC_FILE}" \
of="${TMP_HOOKS_PATH}/${UC_FILE}"
else
UC_DIR=$(pwd)
UC_BRANCH=${BRANCH_OVERRIDE}
if [ "${ADD_BRANCH}" == "default" ]; then
UC_BRANCH=master
fi
set +e
curl -o "${UC_DIR}/${UC_FILE}" \
https://git.openstack.org/cgit/openstack/requirements/plain/${UC_FILE}?h=${UC_BRANCH}
set -e
if [ -f "${UC_DIR}/${UC_FILE}" ]; then
sudo -Hiu ${HOST_USERNAME} dd if="${UC_DIR}/${UC_FILE}" of=${TMP_HOOKS_PATH}/${UC_FILE}
rm -f "${UC_DIR}/${UC_FILE}"
fi
fi