Fixed the 'cf_cli' bundle. Added new bundles 'bosh_cli" and 'cf_tools'.

This commit is contained in:
Ivan Davidov 2017-12-02 18:53:30 +02:00
parent 7ee38a2e5c
commit e7bed86b9c
9 changed files with 108 additions and 14 deletions

View File

@ -45,7 +45,13 @@ SYSLINUX_SOURCE_URL=http://kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.0
#
# http://github.com/cloudfoundry/cli
#
CLOUD_FOUNDRY_CLI_URL=http://cli.run.pivotal.io/stable?release=linux64-binary&source=github
BOSH_CLI_URL=https://s3.amazonaws.com/bosh-cli-artifacts/bosh-cli-2.0.45-linux-amd64
# You can find the latest Cloud Foundry CLI binary here:
#
# http://github.com/cloudfoundry/cli
#
CLOUD_FOUNDRY_CLI_URL=http://cli.run.pivotal.io/stable?release=linux64-binary
# You can find the latest coreutils source bundles here:
#
@ -230,7 +236,9 @@ OVERLAY_TYPE=folder
# Currently available overlay software:
#
# glibc_full - all core GNU C libraries (useful if other software is included).
# bosh_cli - BOSH CLI (command line interface).
# cf_cli - Cloud Foundry CLI (command line interface).
# cf_tools - all BOSH and CLoud Foundry tools.
# coreutils - set of commonly used GNU executable utilities.
# dhcp - DHCP and DNS functionality.
# dialog - shell scripting for ncurses

View File

@ -27,6 +27,20 @@ Currently available overlay bundles:
This overlay bundle depends on the GLIBC build process.
* bosh_cli - BOSH command line tool. It can be used as landscape manager for
virtual network and server infrastructures in cloud environment,
e.g. AWS, Google Cloud, etc. The most common use case for this
tool is to create and manage Cloud Foundry infrastructures.
* cf_cli - Cloud Foundry command line tool. It can be used to manage all
aspects of already existing Cloud Foundry installation, including
the full software development lifecycle in cloud environment.
* cf_tools - This is metapackage which installs all BOSH and Cloud Foundry
tools. Note that in MLL context these tools are mostly useful
as remote managers for already existing BOSH and Cloud Foundry
cloud infrastructures.
* coreutils - Set of commonly used GNU executable utilities.
* dhcp - DHCP and DNS functionality to connect to the Internet.

View File

@ -0,0 +1,34 @@
#!/bin/sh
set -e
# Grab everything after the '=' character.
DOWNLOAD_URL=`grep -i ^BOSH_CLI_URL= $CONFIG | cut -f2- -d'=' | xargs`
# Read the 'USE_LOCAL_SOURCE' property from '.config'
USE_LOCAL_SOURCE="$(grep -i USE_LOCAL_SOURCE $MAIN_SRC_DIR/.config | cut -f2 -d'=')"
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $MAIN_SRC_DIR/source/overlay/bosh-cli ] ; then
echo "Shell script '$MAIN_SRC_DIR/source/overlay/bosh-cli' is missing and will be downloaded."
USE_LOCAL_SOURCE="false"
fi
cd $MAIN_SRC_DIR/source/overlay
if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then
# Downloading BOSH CLI binary. The '-c' option allows the download to resume.
echo "Downloading BOSH CLI binary from $DOWNLOAD_URL"
wget -O bosh-cli -c $DOWNLOAD_URL
else
echo "Using local BOSH CLI binary '$MAIN_SRC_DIR/source/overlay/bosh-cli'."
fi
# Delete folder with previously prepared BOSH CLI.
echo "Removing BOSH CLI work area. This may take a while."
rm -rf $WORK_DIR/overlay/$BUNDLE_NAME
mkdir $WORK_DIR/overlay/$BUNDLE_NAME
# Copy bosh-cli to folder 'work/overlay/bosh_cli'.
cp bosh-cli $WORK_DIR/overlay/$BUNDLE_NAME
cd $SRC_DIR

View File

@ -0,0 +1,27 @@
#!/bin/sh
set -e
echo "Removing old 'BOSH CLI' artifacts. This may take a while."
rm -rf $DEST_DIR
mkdir -p $DEST_DIR/opt/$BUNDLE_NAME
mkdir -p $DEST_DIR/usr/bin
cd $DEST_DIR
cp $MAIN_SRC_DIR/source/overlay/bosh-cli opt/$BUNDLE_NAME/bosh
chmod +rx opt/$BUNDLE_NAME/bosh
cd $DEST_DIR/usr/bin
ln -s ../../opt/$BUNDLE_NAME/bosh bosh
# With '--remove-destination' all possibly existing soft links in
# '$OVERLAY_ROOTFS' will be overwritten correctly.
cp -r --remove-destination $DEST_DIR/* \
$OVERLAY_ROOTFS
echo "Bundle 'BOSH CLI' has been installed."
cd $SRC_DIR

View File

@ -0,0 +1,10 @@
#!/bin/sh
set -e
. ../../common.sh
./01_get.sh
./02_install.sh
cd $SRC_DIR

View File

@ -2,17 +2,13 @@
set -e
. ../../common.sh
# Grab everything after the '=' character.
#DOWNLOAD_URL=$(grep -i CLOUD_FOUNDRY_CLI_URL $MAIN_SRC_DIR/.config | cut -f2 -d'=')
# TODO - hardcoding for now
DOWNLOAD_URL="http://cli.run.pivotal.io/stable?release=linux64-binary&source=github"
DOWNLOAD_URL=`grep -i ^CLOUD_FOUNDRY_CLI_URL= $CONFIG | cut -f2- -d'=' | xargs`
# Read the 'USE_LOCAL_SOURCE' property from '.config'
USE_LOCAL_SOURCE="$(grep -i USE_LOCAL_SOURCE $MAIN_SRC_DIR/.config | cut -f2 -d'=')"
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $MAIN_SRC_DIR/source/overlay/cf-cli.tgz ] ; then
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $MAIN_SRC_DIR/source/overlay/cf-cli.tgz ] ; then
echo "Shell script $MAIN_SRC_DIR/source/overlay/cf-cli.tgz is missing and will be downloaded."
USE_LOCAL_SOURCE="false"
fi

View File

@ -2,12 +2,10 @@
set -e
. ../../common.sh
echo "Removing old cloud foundry artifacts. This may take a while."
echo "Removing old 'Cloud Foundry CLI' artifacts. This may take a while."
rm -rf $DEST_DIR
mkdir -p $DEST_DIR/opt/$BUNDLE_NAME
mkdir -p $DEST_DIR/bin
mkdir -p $DEST_DIR/usr/bin
cd $WORK_DIR/overlay/$BUNDLE_NAME
@ -19,15 +17,15 @@ chmod +rx cf
cp cf $DEST_DIR/opt/$BUNDLE_NAME/cf
cd $DEST_DIR
cd $DEST_DIR/usr/bin
ln -s ../opt/$BUNDLE_NAME/cf bin/cf
ln -s ../../opt/$BUNDLE_NAME/cf cf
# With '--remove-destination' all possibly existing soft links in
# '$OVERLAY_ROOTFS' will be overwritten correctly.
cp -r --remove-destination $DEST_DIR/* \
$OVERLAY_ROOTFS
echo "Cloud Foundry CLI has been installed."
echo "Bundle 'Cloud Foundry CLI' has been installed."
cd $SRC_DIR

View File

@ -0,0 +1,5 @@
#!/bin/sh
set -e
echo "All BOSH and Cloud Foundry tools have been installed."

View File

@ -0,0 +1,2 @@
bosh_cli
cf_cli