Skip to content

Commit

Permalink
Fix all warning messages in the package script
Browse files Browse the repository at this point in the history
  • Loading branch information
stonezdj committed Dec 26, 2023
1 parent 4bdfb26 commit 2f69ba7
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 30 deletions.
4 changes: 3 additions & 1 deletion packages/busybox/packaging
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

set -e

cp -a busybox/*.tar ${BOSH_INSTALL_TARGET}
cp -a busybox/*.tar "${BOSH_INSTALL_TARGET}"
8 changes: 5 additions & 3 deletions packages/docker-compose/packaging
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash

set -e # exit immediately if a simple command exits with a non-zero status
set -u # report the usage of uninitialized variables

mkdir -p ${BOSH_INSTALL_TARGET}/bin
cp ${BOSH_COMPILE_TARGET}/docker/docker-compose-Linux-x86_64 ${BOSH_INSTALL_TARGET}/bin/docker-compose
chmod +x ${BOSH_INSTALL_TARGET}/bin/docker-compose
mkdir -p "${BOSH_INSTALL_TARGET}/bin"
cp "${BOSH_COMPILE_TARGET}/docker/docker-compose-Linux-x86_64" "${BOSH_INSTALL_TARGET}/bin/docker-compose"
chmod +x "${BOSH_INSTALL_TARGET}/bin/docker-compose"
10 changes: 6 additions & 4 deletions packages/docker/packaging
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#!/usr/bin/env bash

set -e # exit immediately if a simple command exits with a non-zero status
set -u # report the usage of uninitialized variables

# Extract docker package
echo "Extracting docker ..."
if ! tar -xzvf ${BOSH_COMPILE_TARGET}/docker/docker.tgz ; then
if ! tar -xzvf "${BOSH_COMPILE_TARGET}/docker/docker.tgz" ; then
echo "Failed to extract docker tarball"
exit 1
fi

echo "Copying docker binaries..."
mkdir -p ${BOSH_INSTALL_TARGET}/bin
cp docker/* ${BOSH_INSTALL_TARGET}/bin
chmod +x ${BOSH_INSTALL_TARGET}/bin/*
mkdir -p "${BOSH_INSTALL_TARGET}/bin"
cp docker/* "${BOSH_INSTALL_TARGET}/bin"
chmod +x "${BOSH_INSTALL_TARGET}/bin/"*
12 changes: 7 additions & 5 deletions packages/harbor-app/packaging
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
#!/usr/bin/env bash

set -e # exit immediately if a simple command exits with a non-zero status
set -u # report the usage of uninitialized variables

source /var/vcap/packages/harbor-common/common.sh

#Extract harbor package to the destination folder
echo "Extracting Harbor ${HARBOR_FULL_VERSION}..."
file=`ls ${BOSH_COMPILE_TARGET}/harbor/harbor-offline-installer-*.tgz`
if ! tar -xzvf $file --strip 1 -C ${BOSH_INSTALL_TARGET} ; then
file=$(ls "${BOSH_COMPILE_TARGET}/harbor/"harbor-offline-installer-*.tgz)
if ! tar -xzvf "${file}" --strip 1 -C "${BOSH_INSTALL_TARGET}" ; then
echo "Failed to extract Harbor ${HARBOR_FULL_VERSION} tarball"
exit 1
fi

chmod +x ${BOSH_INSTALL_TARGET}/*.sh
chmod +x ${BOSH_INSTALL_TARGET}/prepare
chmod +x "${BOSH_INSTALL_TARGET}/"*.sh
chmod +x "${BOSH_INSTALL_TARGET}/prepare"

#Unzip the harbor images tgz file to a tar file,
#then docker loading images in 'ctl start' could be faster.
gunzip ${BOSH_INSTALL_TARGET}/harbor*.tar.gz
gunzip "${BOSH_INSTALL_TARGET}/"harbor*.tar.gz
8 changes: 5 additions & 3 deletions packages/harbor-common/packaging
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

set -e

cp -a harbor-common/* ${BOSH_INSTALL_TARGET}
chmod +x ${BOSH_INSTALL_TARGET}/*.sh
chmod +x ${BOSH_INSTALL_TARGET}/config-utils
cp -a harbor-common/* "${BOSH_INSTALL_TARGET}"
chmod +x "${BOSH_INSTALL_TARGET}/"*.sh
chmod +x "${BOSH_INSTALL_TARGET}/config-utils"
6 changes: 4 additions & 2 deletions packages/nfs-common/packaging
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/usr/bin/env bash

set -e # exit immediately if a simple command exits with a non-zero status
set -u # report the usage of uninitialized variables

echo "Extracting nfs-common ..."
if ! tar -xzvf ${BOSH_COMPILE_TARGET}/nfs-common/nfs-common.tgz -C ${BOSH_INSTALL_TARGET} ; then
if ! tar -xzvf "${BOSH_COMPILE_TARGET}/nfs-common/nfs-common.tgz" -C "${BOSH_INSTALL_TARGET}" ; then
echo "Failed to extract nfs-common tarball"
exit 1
fi

chmod +x ${BOSH_INSTALL_TARGET}/*.sh
chmod +x "${BOSH_INSTALL_TARGET}/"*.sh
10 changes: 6 additions & 4 deletions packages/python/packaging
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/usr/bin/env bash

set -e

# wget https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz
tar xzvf ${BOSH_COMPILE_TARGET}/python/Python-2.7.15.tgz
mkdir -p ${BOSH_INSTALL_TARGET}/python2.7
pushd ${BOSH_COMPILE_TARGET}/Python-2.7.*
./configure --prefix=${BOSH_INSTALL_TARGET}/python2.7
tar xzvf "${BOSH_COMPILE_TARGET}/python/Python-2.7.15.tgz"
mkdir -p "${BOSH_INSTALL_TARGET}/python2.7"
pushd "${BOSH_COMPILE_TARGET}/"Python-2.7.*
./configure --prefix="${BOSH_INSTALL_TARGET}/python2.7"
make
make install
popd
8 changes: 4 additions & 4 deletions packages/smoke-test/packaging
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
#!/usr/bin/env bash

set -e -u

mkdir -p ${BOSH_INSTALL_TARGET}/bin
cp ${BOSH_COMPILE_TARGET}/smoke-test/smoke-test ${BOSH_INSTALL_TARGET}/bin
chmod 755 ${BOSH_INSTALL_TARGET}/bin/smoke-test
mkdir -p "${BOSH_INSTALL_TARGET}/bin"
cp "${BOSH_COMPILE_TARGET}/smoke-test/smoke-test" "${BOSH_INSTALL_TARGET}/bin"
chmod 755 "${BOSH_INSTALL_TARGET}/bin/smoke-test"
6 changes: 4 additions & 2 deletions packages/uaa/packaging
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash

set -e

cp -a uaa/* ${BOSH_INSTALL_TARGET}
chmod +x ${BOSH_INSTALL_TARGET}/*.sh
cp -a uaa/* "${BOSH_INSTALL_TARGET}"
chmod +x "${BOSH_INSTALL_TARGET}/"*.sh
6 changes: 4 additions & 2 deletions packages/wavefront/packaging
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/usr/bin/env bash

set -e # exit immediately if a simple command exits with a non-zero status
set -u # report the usage of uninitialized variables

# copy bundle to boash install target
cp ${BOSH_COMPILE_TARGET}/wavefront/harbor-wavefront-bundle.tgz ${BOSH_INSTALL_TARGET}
cp "${BOSH_COMPILE_TARGET}/wavefront/harbor-wavefront-bundle.tgz" "${BOSH_INSTALL_TARGET}"

# Unzip the harbor images tgz file to a tar file,
# then docker loading images in 'ctl start' could be faster.
gunzip ${BOSH_INSTALL_TARGET}/harbor-wavefront-bundle.tgz
gunzip "${BOSH_INSTALL_TARGET}/harbor-wavefront-bundle.tgz"

0 comments on commit 2f69ba7

Please sign in to comment.