-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also fixes error in Makefile where the sha256sum executable name was assumed. Scripts added to make and upload builds locally using Docker images for each supported platform.
- Loading branch information
Travis B. Hartwell
committed
Jan 4, 2017
1 parent
1d7fe05
commit dee0b4c
Showing
4 changed files
with
168 additions
and
4 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
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,66 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ "$#" -ne 1 ]; then | ||
>&2 echo "Usage $0 OS_NAME" | ||
exit 1 | ||
fi | ||
|
||
REX_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )" | ||
|
||
case $1 in | ||
"centos-7") | ||
ERLANG_TARBALL=https://basholabs.artifactoryonline.com/basholabs/build/centos-7/erlang/OTP_R16B02_basho10/erlang-OTP_R16B02_basho10.tgz | ||
export OS_FAMILY=centos | ||
export OS_VERSION=7 | ||
;; | ||
|
||
"debian-8") | ||
ERLANG_TARBALL=https://basholabs.artifactoryonline.com/basholabs/build/debian-8/erlang/OTP_R16B02_basho10/erlang-OTP_R16B02_basho10.tgz | ||
export OS_FAMILY=debian | ||
export OS_VERSION=8 | ||
;; | ||
|
||
"ubuntu-14.04") | ||
ERLANG_TARBALL=https://basholabs.artifactoryonline.com/basholabs/build/ubuntu-14.04/erlang/OTP_R16B02_basho10/erlang-OTP_R16B02_basho10.tgz | ||
export OS_FAMILY=ubuntu | ||
export OS_VERSION=14.04 | ||
;; | ||
|
||
"osx") | ||
export OS_FAMILY=osx | ||
export OS_VERSION=10.11 | ||
;; | ||
|
||
*) | ||
>&2 echo "Unsupported OS" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
if [ "osx" != "${OS_FAMILY}" ]; then | ||
if [ -z "${ERLANG_TARBALL}" ]; then | ||
>&2 echo "Shouldn't get here, ERLANG_TARBALL variable should be set" | ||
exit 1 | ||
fi | ||
|
||
# Download and install Erlang | ||
mkdir -p /usr/lib/erlang | ||
cd /usr/lib/erlang | ||
curl -O -Ssl "${ERLANG_TARBALL}" | ||
tar xf erlang-OTP_R16B02_basho10.tgz | ||
|
||
# Add Erlang to the PATH | ||
export PATH=$PATH:/usr/lib/erlang/bin | ||
else | ||
# Assumes Erlang is installed via KERL in ~/erlang | ||
. ~/erlang/R16B02/activate | ||
fi | ||
|
||
# Make erlang build | ||
cd "${REX_DIR}" | ||
make tarball | ||
make reltarball | ||
make tarball-standalone | ||
make sync | ||
make relsync | ||
make sync-standalone |
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,53 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Capture the output of all of the commands | ||
OUTPUT_LOG=/tmp/riak_explorer_build.out | ||
OUTPUT_PIPE=/tmp/riak_explorer_build-output.pipe | ||
|
||
if [ ! -e ${OUTPUT_PIPE} ]; then | ||
mkfifo ${OUTPUT_PIPE} | ||
fi | ||
|
||
if [ -e ${OUTPUT_LOG} ]; then | ||
rm ${OUTPUT_LOG} | ||
fi | ||
|
||
exec 3>&1 4>&2 | ||
tee ${OUTPUT_LOG} < ${OUTPUT_PIPE} >&3 & | ||
tpid=$! | ||
exec > ${OUTPUT_PIPE} 2>&1 | ||
|
||
REX_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )" | ||
REX_ADMIN_SCRIPTS_DIR="${REX_DIR}"/admin | ||
|
||
# Make sure the oath token exists | ||
if [ ! -e "${REX_DIR}"/oauth.txt ]; then | ||
>&2 echo "Github OAUTH token required in ${REX_DIR}/oauth.txt" | ||
exit 1 | ||
fi | ||
|
||
declare -a OS_NAMES | ||
OS_NAMES=( centos-7 debian-8 ubuntu-14.04 ) | ||
|
||
# Make sure latest image is pulled | ||
for os in "${OS_NAMES[@]}"; do | ||
docker pull basho/build-essential:"${os}" | grep -E "^Status" | ||
done | ||
|
||
# Run the build in container for each OS | ||
for os in "${OS_NAMES[@]}"; do | ||
docker run --rm -it \ | ||
-v ${REX_DIR}:/riak_explorer \ | ||
basho/build-essential:"${os}" \ | ||
/riak_explorer/admin/build-release-task.sh "${os}" | ||
done | ||
|
||
# Also run the build locally for macOS | ||
if [ "$(uname)" == "Darwin" ]; then | ||
${REX_ADMIN_SCRIPTS_DIR}/build-release-task.sh osx | ||
fi | ||
|
||
exec 1>&3 3>&- 2>&4 4>&- | ||
wait ${tpid} | ||
|
||
rm ${OUTPUT_PIPE} |
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