-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
4 changed files
with
24 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,25 @@ | ||
#!/bin/bash | ||
|
||
set -e # exit immediately if a simple command exits with a non-zero status | ||
set -u # report the usage of uninitialized variables | ||
|
||
# Set package dependencies directory | ||
# Available variables | ||
# $BOSH_COMPILE_TARGET - where this package & spec'd source files are available | ||
# $BOSH_INSTALL_TARGET - where you copy/install files to be included in package | ||
|
||
export HOME=${HOME:-/tmp/home} | ||
PACKAGES_DIR=${BOSH_PACKAGES_DIR:-/var/vcap/packages} | ||
|
||
# Set Golang dependency | ||
PLATFORM=`uname | tr '[:upper:]' '[:lower:]'` | ||
|
||
if [ $PLATFORM = "linux" ]; then | ||
export GOROOT=$(cd "${PACKAGES_DIR}/golang" && pwd -P) | ||
export PATH=${GOROOT}/bin:${PATH} | ||
fi | ||
export GOROOT=$(cd "${PACKAGES_DIR}/golang" && pwd -P) | ||
ls -alR $GOROOT/bin | ||
export PATH=${GOROOT}/bin:${PATH} | ||
|
||
# Build BOSH Alicloud CPI package | ||
echo " ========================================== " | ||
echo " Source Patch: " $BOSH_COMPILE_TARGET | ||
echo " Installed in: " $BOSH_INSTALL_TARGET | ||
echo " ========================================== " | ||
mkdir -p ${BOSH_INSTALL_TARGET}/bin | ||
|
||
# Build BOSH alicloud CPI package | ||
mkdir -p ${BOSH_COMPILE_TARGET}/go/src | ||
mv ${BOSH_COMPILE_TARGET}/Makefile ${BOSH_COMPILE_TARGET}/go/ | ||
mv ${BOSH_COMPILE_TARGET}/bosh-alicloud-cpi ${BOSH_COMPILE_TARGET}/go/src/ | ||
# mv ${BOSH_COMPILE_TARGET}/github.com ${BOSH_COMPILE_TARGET}/go/src/ | ||
|
||
cd ${BOSH_COMPILE_TARGET}/go/src/bosh-alicloud-cpi | ||
export GOPATH=${BOSH_COMPILE_TARGET}/go | ||
|
||
# Copy BOSH Alicloud CPI package | ||
mkdir -p ${BOSH_INSTALL_TARGET}/bin | ||
|
||
cd ${BOSH_COMPILE_TARGET}/go | ||
make | ||
|
||
## TODO replace with a single command | ||
## EXECUTABLE=bin/alicloud_cpi | ||
## go build -v -a -o ${EXECUTABLE} $(MAINFILE) | ||
|
||
cp ${BOSH_COMPILE_TARGET}/go/bin/alicloud_cpi ${BOSH_INSTALL_TARGET}/bin/ | ||
|
||
go build -o ${BOSH_INSTALL_TARGET}/bin/alicloud_cpi bosh-alicloud-cpi/main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
#!/bin/bash | ||
|
||
set -e # exit immediately if a simple command exits with a non-zero status | ||
set -u # report the usage of uninitialized variables | ||
|
||
# Grab the latest versions that are in the directory | ||
PLATFORM=`uname | tr '[:upper:]' '[:lower:]'` | ||
|
||
export GOLANG_VERSION=1.11.5 | ||
|
||
if [ $PLATFORM = "linux" ]; then | ||
# Set package dependencies directory | ||
export dir=`ls ${BOSH_COMPILE_TARGET}` | ||
tar xzvf ${BOSH_COMPILE_TARGET}/go${GOLANG_VERSION}.linux-amd64.tar.gz | ||
# Extract Go Programming Language package | ||
tar xzvf ${BOSH_COMPILE_TARGET}/golang/go*.${PLATFORM}-amd64.tar.gz | ||
|
||
# Copy Go Programming Language package | ||
mkdir -p ${BOSH_INSTALL_TARGET}/bin | ||
cp -a ${BOSH_COMPILE_TARGET}/go/* ${BOSH_INSTALL_TARGET} | ||
fi | ||
# Copy Go Programming Language package | ||
mkdir -p ${BOSH_INSTALL_TARGET}/bin | ||
cp -R ${BOSH_COMPILE_TARGET}/go/* ${BOSH_INSTALL_TARGET} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters