-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ryan Moran
committed
May 20, 2021
1 parent
c1c1632
commit 4f855d6
Showing
7 changed files
with
218 additions
and
27 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"stack": "cflinuxfs3", | ||
"oses": [ | ||
"linux", | ||
"windows" | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu | ||
set -o pipefail | ||
|
||
function util::print::title() { | ||
local blue reset message | ||
blue="\033[0;34m" | ||
reset="\033[0;39m" | ||
message="${1}" | ||
|
||
echo -e "\n${blue}${message}${reset}" >&2 | ||
} | ||
|
||
function util::print::info() { | ||
local message | ||
message="${1}" | ||
|
||
echo -e "${message}" >&2 | ||
} | ||
|
||
function util::print::error() { | ||
local message red reset | ||
message="${1}" | ||
red="\033[0;31m" | ||
reset="\033[0;39m" | ||
|
||
echo -e "${red}${message}${reset}" >&2 | ||
exit 1 | ||
} | ||
|
||
function util::print::success() { | ||
local message green reset | ||
message="${1}" | ||
green="\033[0;32m" | ||
reset="\033[0;39m" | ||
|
||
echo -e "${green}${message}${reset}" >&2 | ||
exitcode="${2:-0}" | ||
exit "${exitcode}" | ||
} | ||
|
||
function util::print::warn() { | ||
local message yellow reset | ||
message="${1}" | ||
yellow="\033[0;33m" | ||
reset="\033[0;39m" | ||
|
||
echo -e "${yellow}${message}${reset}" >&2 | ||
exit 0 | ||
} | ||
|
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 |
---|---|---|
@@ -0,0 +1,114 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -u | ||
set -o pipefail | ||
|
||
# shellcheck source=SCRIPTDIR/print.sh | ||
source "$(dirname "${BASH_SOURCE[0]}")/print.sh" | ||
|
||
function util::tools::path::export() { | ||
local dir | ||
dir="${1}" | ||
|
||
if ! echo "${PATH}" | grep -q "${dir}"; then | ||
PATH="${dir}:$PATH" | ||
export PATH | ||
fi | ||
} | ||
|
||
function util::tools::ginkgo::install() { | ||
local dir | ||
while [[ "${#}" != 0 ]]; do | ||
case "${1}" in | ||
--directory) | ||
dir="${2}" | ||
shift 2 | ||
;; | ||
|
||
*) | ||
util::print::error "unknown argument \"${1}\"" | ||
esac | ||
done | ||
|
||
mkdir -p "${dir}" | ||
util::tools::path::export "${dir}" | ||
|
||
if [[ ! -f "${dir}/ginkgo" ]]; then | ||
util::print::title "Installing ginkgo" | ||
|
||
GOBIN="${dir}" \ | ||
go get \ | ||
-u \ | ||
github.com/onsi/ginkgo/ginkgo | ||
fi | ||
} | ||
|
||
function util::tools::buildpack-packager::install() { | ||
local dir | ||
while [[ "${#}" != 0 ]]; do | ||
case "${1}" in | ||
--directory) | ||
dir="${2}" | ||
shift 2 | ||
;; | ||
|
||
*) | ||
util::print::error "unknown argument \"${1}\"" | ||
esac | ||
done | ||
|
||
mkdir -p "${dir}" | ||
util::tools::path::export "${dir}" | ||
|
||
if [[ ! -f "${dir}/buildpack-packager" ]]; then | ||
util::print::title "Installing buildpack-packager" | ||
|
||
GOBIN="${dir}" \ | ||
go install \ | ||
github.com/cloudfoundry/libbuildpack/packager/buildpack-packager | ||
fi | ||
} | ||
|
||
function util::tools::jq::install() { | ||
local dir | ||
while [[ "${#}" != 0 ]]; do | ||
case "${1}" in | ||
--directory) | ||
dir="${2}" | ||
shift 2 | ||
;; | ||
|
||
*) | ||
util::print::error "unknown argument \"${1}\"" | ||
esac | ||
done | ||
|
||
mkdir -p "${dir}" | ||
util::tools::path::export "${dir}" | ||
|
||
local os | ||
case "$(uname)" in | ||
"Darwin") | ||
os="osx-amd64" | ||
;; | ||
|
||
"Linux") | ||
os="linux64" | ||
;; | ||
|
||
*) | ||
echo "Unknown OS \"$(uname)\"" | ||
exit 1 | ||
esac | ||
|
||
if [[ ! -f "${dir}/jq" ]]; then | ||
util::print::title "Installing jq" | ||
|
||
curl "https://github.com/stedolan/jq/releases/download/jq-1.6/jq-${os}" \ | ||
--silent \ | ||
--location \ | ||
--output "${dir}/jq" | ||
chmod +x "${dir}/jq" | ||
fi | ||
} |
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
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