summaryrefslogtreecommitdiff
path: root/imagebuild
diff options
context:
space:
mode:
authorDmitry Tantsur <divius.inside@gmail.com>2017-06-05 13:09:06 +0200
committerDmitry Tantsur <divius.inside@gmail.com>2017-06-07 13:45:37 +0200
commit381f5073b5d7b15ac848cdbc8dfbb252ff417aba (patch)
treec1155a5162cad960566d7282bddc005ff76f9179 /imagebuild
parent7dbe9b5bedfe1eca8dd0f0218a186c5b7ebee85d (diff)
downloadironic-python-agent-381f5073b5d7b15ac848cdbc8dfbb252ff417aba.tar.gz
[imagebuild] support requirements referring to /opt/stack/new
Now that ironic-lib builds IPA from source, the IPA building procedure needs to support requirements referring to /opt/stack/new. As upper-constraints are not actually needed in the finalise step, they're no longer used there to avoid dealing with file:/// references. We also allow pre-release packages to be installed by pip. Also install git as it's a build requirement for PBR. Only tinyipa is updated, as it's used in the ironic-lib gate. Change-Id: Ia942cb710eb3fe1ba56c68f91fa893795c9cb651 Closes-Bug: #1695877
Diffstat (limited to 'imagebuild')
-rwxr-xr-ximagebuild/tinyipa/build-tinyipa.sh15
-rw-r--r--imagebuild/tinyipa/build_files/buildreqs.lst1
-rwxr-xr-ximagebuild/tinyipa/finalise-tinyipa.sh4
3 files changed, 17 insertions, 3 deletions
diff --git a/imagebuild/tinyipa/build-tinyipa.sh b/imagebuild/tinyipa/build-tinyipa.sh
index 9ceda434..40e26bb7 100755
--- a/imagebuild/tinyipa/build-tinyipa.sh
+++ b/imagebuild/tinyipa/build-tinyipa.sh
@@ -80,6 +80,8 @@ cp requirements.txt $BUILDDIR/tmp/ipa-requirements.txt
imagebuild/common/generate_upper_constraints.sh upper-constraints.txt
cp upper-constraints.txt $BUILDDIR/tmp/upper-constraints.txt
+echo Using upper-constraints:
+cat upper-constraints.txt
cd $WORKDIR
sudo cp /etc/resolv.conf $BUILDDIR/etc/resolv.conf
@@ -88,6 +90,17 @@ trap "sudo umount $BUILDDIR/proc; sudo umount $BUILDDIR/dev/pts" EXIT
sudo mount --bind /proc $BUILDDIR/proc
sudo mount --bind /dev/pts $BUILDDIR/dev/pts
+if [ -d /opt/stack/new ]; then
+ # Running in CI environment, make checkouts available
+ $CHROOT_CMD mkdir -p /opt/stack/new
+ for project in $(ls /opt/stack/new); do
+ if grep -q "$project" $BUILDDIR/tmp/upper-constraints.txt &&
+ [ -d "/opt/stack/new/$project/.git" ]; then
+ sudo cp -R "/opt/stack/new/$project" $BUILDDIR/opt/stack/new/
+ fi
+ done
+fi
+
$CHROOT_CMD mkdir /etc/sysconfig/tcedir
$CHROOT_CMD chmod a+rwx /etc/sysconfig/tcedir
$CHROOT_CMD touch /etc/sysconfig/tcuser
@@ -107,6 +120,8 @@ $CHROOT_CMD pip wheel -c /tmp/upper-constraints.txt --wheel-dir /tmp/wheels setu
$CHROOT_CMD pip wheel -c /tmp/upper-constraints.txt --wheel-dir /tmp/wheels pip
$CHROOT_CMD pip wheel -c /tmp/upper-constraints.txt --wheel-dir /tmp/wheels -r /tmp/ipa-requirements.txt
$CHROOT_CMD pip wheel -c /tmp/upper-constraints.txt --no-index --pre --wheel-dir /tmp/wheels --find-links=/tmp/localpip --find-links=/tmp/wheels ironic-python-agent
+echo Resulting wheels:
+ls -1 $BUILDDIR/tmp/wheels
# Build tgt
rm -rf $WORKDIR/build_files/tgt.tcz
diff --git a/imagebuild/tinyipa/build_files/buildreqs.lst b/imagebuild/tinyipa/build_files/buildreqs.lst
index 7d863afc..be399f7b 100644
--- a/imagebuild/tinyipa/build_files/buildreqs.lst
+++ b/imagebuild/tinyipa/build_files/buildreqs.lst
@@ -18,3 +18,4 @@ zlib_base-dev.tcz
glib2-dev.tcz
pixman-dev.tcz
binutils.tcz
+git.tcz
diff --git a/imagebuild/tinyipa/finalise-tinyipa.sh b/imagebuild/tinyipa/finalise-tinyipa.sh
index 4d1419d6..9ade923a 100755
--- a/imagebuild/tinyipa/finalise-tinyipa.sh
+++ b/imagebuild/tinyipa/finalise-tinyipa.sh
@@ -143,9 +143,7 @@ $CHROOT_CMD depmod -a `$WORKDIR/build_files/fakeuname -r`
# If flag is set install the python now
if $BUILD_AND_INSTALL_TINYIPA ; then
- cp -a $BUILDDIR/tmp/upper-constraints.txt $FINALDIR/tmp/upper-constraints.txt
- $CHROOT_CMD python /tmp/get-pip.py -c /tmp/upper-constraints.txt --no-wheel --no-index --find-links=file:///tmp/wheelhouse ironic_python_agent
- rm -rf $FINALDIR/tmp/upper-constraints.txt
+ $CHROOT_CMD python /tmp/get-pip.py --no-wheel --no-index --find-links=file:///tmp/wheelhouse --pre ironic_python_agent
rm -rf $FINALDIR/tmp/wheelhouse
rm -rf $FINALDIR/tmp/get-pip.py
fi