Permalink
Browse files

Simplify build/test scripts to make easier to run

Unify scripts across all buildpacks

[#151293706]
  • Loading branch information...
dgodd committed Nov 10, 2017
1 parent 5e69c4e commit c00ae9ea5b1f4bd4444acea23a754efefb084341
Showing with 28 additions and 42 deletions.
  1. +2 −2 .envrc
  2. +5 −8 scripts/build.sh
  3. +12 −0 scripts/install_tools.sh
  4. +4 −18 scripts/integration.sh
  5. +5 −14 scripts/unit.sh
View
4 .envrc
@@ -1,3 +1,3 @@
export GOPATH=$PWD:$GOPATH
export GOBIN=$PWD/.bin
export GOPATH=$PWD
export GOBIN=$GOPATH/.bin
export PATH=$GOBIN:$PATH
View
@@ -1,11 +1,8 @@
#!/usr/bin/env bash
set -ex
set -exuo pipefail
ROOTDIR="$( dirname "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" )"
BINDIR=$ROOTDIR/bin
cd "$( dirname "${BASH_SOURCE[0]}" )/.."
source .envrc
export GOPATH=$ROOTDIR
export GOOS=linux
go build -ldflags="-s -w" -o $BINDIR/supply staticfile/supply/cli
go build -ldflags="-s -w" -o $BINDIR/finalize staticfile/finalize/cli
go build -ldflags="-s -w" -o bin/supply staticfile/supply/cli
go build -ldflags="-s -w" -o bin/finalize staticfile/finalize/cli
View
@@ -0,0 +1,12 @@
#!/bin/bash
set -euo pipefail
cd "$( dirname "${BASH_SOURCE[0]}" )/.."
source .envrc
if [ ! -f .bin/ginkgo ]; then
(cd src/*/vendor/github.com/onsi/ginkgo/ginkgo/ && go install)
fi
if [ ! -f .bin/buildpack-packager ]; then
(cd src/*/vendor/github.com/cloudfoundry/libbuildpack/packager/buildpack-packager && go install)
fi
View
@@ -1,28 +1,14 @@
#!/usr/bin/env bash
set -euo pipefail
set -x
unamestr=`uname`
# checks rhe operating system to issue readlink on Linux and
# stat command on Mac OS.
if [[ "$unamestr" == 'Linux' ]]; then
readlinkalias='readlink '
elif [[ "$unamestr" == 'Darwin' ]]; then
readlinkalias='stat '
fi
export ROOT=$(dirname $($readlinkalias -f ${BASH_SOURCE%/*}))
if [ ! -f "$ROOT/.bin/ginkgo" ]; then
(cd "$ROOT/src/staticfile/vendor/github.com/onsi/ginkgo/ginkgo/" && go install)
fi
if [ ! -f "$ROOT/.bin/buildpack-packager" ]; then
(cd "$ROOT/src/staticfile/vendor/github.com/cloudfoundry/libbuildpack/packager/buildpack-packager" && go install)
fi
cd "$( dirname "${BASH_SOURCE[0]}" )/.."
source .envrc
./scripts/install_tools.sh
GINKGO_NODES=${GINKGO_NODES:-3}
GINKGO_ATTEMPTS=${GINKGO_ATTEMPTS:-2}
cd $ROOT/src/staticfile/integration
cd src/*/integration
echo "Run Uncached Buildpack"
ginkgo -r --flakeAttempts=$GINKGO_ATTEMPTS -nodes $GINKGO_NODES --slowSpecThreshold=60 -- --cached=false
View
@@ -1,18 +1,9 @@
#!/usr/bin/env bash
set -euo pipefail
unamestr=`uname`
# checks rhe operating system to issue readlink on Linux and
# stat command on Mac OS.
if [[ "$unamestr" == 'Linux' ]]; then
readlinkalias='readlink '
elif [[ "$unamestr" == 'Darwin' ]]; then
readlinkalias='stat '
fi
export ROOT=`dirname $($readlinkalias -f ${BASH_SOURCE%/*})`
if [ ! -f $ROOT/.bin/ginkgo ]; then
(cd $ROOT/src/staticfile/vendor/github.com/onsi/ginkgo/ginkgo/ && go install)
fi
cd "$( dirname "${BASH_SOURCE[0]}" )/.."
source .envrc
./scripts/install_tools.sh
cd $ROOT/src/staticfile/
ginkgo -r -skipPackage=integration
cd src/*/integration/..
ginkgo -r -skipPackage=brats,integration

0 comments on commit c00ae9e

Please sign in to comment.