Add generation of bareon ssh-key

Functional test prepare bareon images. They need to insert an ssh-key
into this image. Till now pregenerated key was used. To decrease a
number of external resources (key was downloaded via http) switch to
generated ssh-key.

Change-Id: I880b60bd2bafc1b88d716a1a245abad5794aff0a
This commit is contained in:
Dmitry Bogun 2016-12-20 15:50:31 +02:00 committed by Andrii Ostapenko
parent caf4931faf
commit c1711febfc
2 changed files with 12 additions and 9 deletions

View File

@ -31,23 +31,27 @@ rm -rf $BUILD_DIR
mkdir $BUILD_DIR
cd $BUILD_DIR
# NOTE(lobur): temp workaround while we don't build the key along with the image
wget $FUEL_KEY -O fuel_key
chmod 0600 fuel_key
git clone -b $DIB_BRANCH $DIB_SRC
git clone -b $DIB_UTILS_BRANCH $DIB_UTILS_SRC
git clone -b $DIB_ELEMENTS_BRANCH $DIB_ELEMENTS_SRC
ssh-keygen -N '' -f bareon_key
cp -f bareon_key.pub "$BUILD_DIR/bareon-image-elements/centos-bareon/install.d/files.ironic/root/.ssh/authorized_keys"
# Apply changes from https://review.openstack.org/319909
# The problem is still actual for CentOS (https://bugs.launchpad.net/diskimage-builder/+bug/1650582)
sed -i -e 's%mv \(/usr/lib/locale/locale-archive\)%cp \1%' diskimage-builder/elements/yum-minimal/pre-install.d/03-yum-cleanup
export PATH=$BUILD_DIR/diskimage-builder/bin:$BUILD_DIR/dib-utils/bin:$PATH
export BAREON_SRC=file://$BAREON_PATH
export BAREON_BRANCH=$(cd $BAREON_PATH && git rev-parse --abbrev-ref HEAD) # Use current branch
export ELEMENTS_PATH=$BUILD_DIR/bareon-image-elements
export ELEMENTS_PATH="$BUILD_DIR/bareon-image-elements"
export DIB_OFFLINE=1
export DIB_DEBUG_TRACE=1
export DIB_DATA_ROOT="$BUILD_DIR"
disk-image-create -n -t raw -o cent-min centos-minimal centos-bareon
@ -57,4 +61,4 @@ mv cent-min.vmlinuz vmlinuz
echo "================== DONE Rebuilding deploy images =================="
set +e
set +e

View File

@ -16,6 +16,8 @@
# A default environment used for image build/sync.
export BUILD_DIR=/tmp/rft_image_build
export DIB_SRC=https://github.com/openstack/diskimage-builder.git
export DIB_BRANCH=master
@ -25,8 +27,5 @@ export DIB_UTILS_BRANCH=master
export DIB_ELEMENTS_SRC=https://github.com/openstack/bareon-image-elements.git
export DIB_ELEMENTS_BRANCH=master
export FUEL_KEY=https://raw.githubusercontent.com/stackforge/fuel-main/master/bootstrap/ssh/id_rsa
export BUILD_DIR=/tmp/rft_image_build
export GOLDEN_IMAGE_DIR=/tmp/rft_golden_images/
export GOLDEN_IMAGE_SRC=http://images.fuel-infra.org/rft_golden_images/