Skip to content

Commit 351bfb7

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Fix post and periodic jobs"
2 parents 684412c + ea5a8dd commit 351bfb7

1 file changed

Lines changed: 33 additions & 33 deletions

File tree

tools/tox_install.sh

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,41 @@ CONSTRAINTS_FILE=$1
1515
shift
1616

1717
install_cmd="pip install"
18-
if [ $CONSTRAINTS_FILE != "unconstrained" ]; then
19-
20-
mydir=$(mktemp -dt "$CLIENT_NAME-tox_install-XXXXXXX")
21-
localfile=$mydir/upper-constraints.txt
22-
if [[ $CONSTRAINTS_FILE != http* ]]; then
23-
CONSTRAINTS_FILE=file://$CONSTRAINTS_FILE
24-
fi
25-
curl $CONSTRAINTS_FILE -k -o $localfile
26-
install_cmd="$install_cmd -c$localfile"
27-
28-
if [ $requirements_installed -eq 0 ]; then
29-
echo "ALREADY INSTALLED" > /tmp/tox_install.txt
30-
echo "Requirements already installed; using existing package"
31-
elif [ -x "$ZUUL_CLONER" ]; then
32-
export ZUUL_BRANCH=${ZUUL_BRANCH-$BRANCH}
33-
echo "ZUUL CLONER" > /tmp/tox_install.txt
34-
pushd $mydir
35-
$ZUUL_CLONER --cache-dir \
36-
/opt/git \
37-
--branch $BRANCH_NAME \
38-
git://git.openstack.org \
39-
openstack/requirements
40-
cd openstack/requirements
41-
$install_cmd -e .
42-
popd
43-
else
44-
echo "PIP HARDCODE" > /tmp/tox_install.txt
45-
if [ -z "$REQUIREMENTS_PIP_LOCATION" ]; then
46-
REQUIREMENTS_PIP_LOCATION="git+https://git.openstack.org/openstack/requirements@$BRANCH_NAME#egg=requirements"
47-
fi
48-
$install_cmd -U -e ${REQUIREMENTS_PIP_LOCATION}
18+
mydir=$(mktemp -dt "$CLIENT_NAME-tox_install-XXXXXXX")
19+
localfile=$mydir/upper-constraints.txt
20+
if [[ $CONSTRAINTS_FILE != http* ]]; then
21+
CONSTRAINTS_FILE=file://$CONSTRAINTS_FILE
22+
fi
23+
curl $CONSTRAINTS_FILE -k -o $localfile
24+
install_cmd="$install_cmd -c$localfile"
25+
26+
if [ $requirements_installed -eq 0 ]; then
27+
echo "ALREADY INSTALLED" > /tmp/tox_install.txt
28+
echo "Requirements already installed; using existing package"
29+
elif [ -x "$ZUUL_CLONER" ]; then
30+
# If this is called in a periodic job, these will not be set
31+
echo "ZUUL CLONER" > /tmp/tox_install.txt
32+
pushd $mydir
33+
$ZUUL_CLONER --cache-dir \
34+
/opt/git \
35+
--branch $BRANCH_NAME \
36+
git://git.openstack.org \
37+
openstack/requirements
38+
cd openstack/requirements
39+
$install_cmd -e .
40+
popd
41+
else
42+
echo "PIP HARDCODE" > /tmp/tox_install.txt
43+
if [ -z "$REQUIREMENTS_PIP_LOCATION" ]; then
44+
REQUIREMENTS_PIP_LOCATION="git+https://git.openstack.org/openstack/requirements@$BRANCH_NAME#egg=requirements"
4945
fi
50-
51-
edit-constraints $localfile -- $CLIENT_NAME "-e file://$PWD#egg=$CLIENT_NAME"
46+
$install_cmd -U -e ${REQUIREMENTS_PIP_LOCATION}
5247
fi
5348

49+
# This is the main purpose of the script: Allow local installation of
50+
# the current repo. It is listed in constraints file and thus any
51+
# install will be constrained and we need to unconstrain it.
52+
edit-constraints $localfile -- $CLIENT_NAME "-e file://$PWD#egg=$CLIENT_NAME"
53+
5454
$install_cmd -U $*
5555
exit $?

0 commit comments

Comments
 (0)