Skip to content

Commit

Permalink
Merge pull request #710 from basho/refactor/deploy-api-wip
Browse files Browse the repository at this point in the history
Major overhaul of the internals of riak_test
  • Loading branch information
kellymclaughlin committed Dec 15, 2014
2 parents 27b8607 + e11f183 commit 66ab243
Show file tree
Hide file tree
Showing 26 changed files with 2,213 additions and 1,033 deletions.
43 changes: 5 additions & 38 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
.PHONY: deps

APPS = kernel stdlib sasl erts ssl tools os_mon runtime_tools crypto inets \
xmerl webtool eunit syntax_tools compiler hipe mnesia public_key \
observer wx gs
PLT = $(HOME)/.riak-test_dialyzer_plt

all: deps compile
./rebar skip_deps=true escriptize
SMOKE_TEST=1 ./rebar skip_deps=true escriptize

deps:
./rebar get-deps

docs:
./rebar skip_deps=true doc

docsclean:
@rm -rf doc/*.png doc/*.html doc/*.css edoc-info

compile: deps
./rebar compile

Expand All @@ -31,30 +20,8 @@ quickbuild:
./rebar skip_deps=true compile
./rebar escriptize

##################
# Dialyzer targets
##################

# public targets
dialyzer: compile $(PLT)
dialyzer -Wno_return -Wunderspecs -Wunmatched_returns --plt $(PLT) ebin deps/*/ebin | \
egrep -v -f ./dialyzer.ignore-warnings

clean_plt:
@echo
@echo "Are you sure? It takes about 1/2 hour to re-build."
@echo Deleting $(PLT) in 5 seconds.
@echo
sleep 5
rm $(PLT)

# internal targets
# build plt file. assumes 'compile' was already run, e.g. from 'dialyzer' target
$(PLT):
@echo
@echo "Building dialyzer's plt file. This can take 1/2 hour."
@echo " Because it wasn't here:" $(PLT)
@echo " Consider using R15B03 or later for 100x faster build time!"
@echo
@sleep 1
dialyzer --build_plt --output_plt $(PLT) --apps $(APPS)
DIALYZER_APPS = kernel stdlib sasl erts ssl tools os_mon runtime_tools crypto inets \
xmerl webtool eunit syntax_tools compiler hipe mnesia public_key \
observer wx gs

include tools.mk
29 changes: 15 additions & 14 deletions bin/rtdev-current.sh
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
#!/usr/bin/env bash

# bail out if things go south
# just bail out if things go south
set -e

: ${RT_DEST_DIR:="$HOME/rt/riak"}

echo "Making $(pwd) the current release:"
echo "Making $(pwd) a tagged release:"
cwd=$(pwd)
echo -n " - Determining version: "
if [ -f $cwd/dependency_manifest.git ]; then
VERSION=`cat $cwd/dependency_manifest.git | awk '/^-/ { print $NF }'`
else
VERSION="$(git describe --tags)-$(git branch | awk '/\*/ {print $2}')"
VERSION=`git describe --tags | awk '{sub(/riak-/,"",$0);print}'`
fi
echo $VERSION
cd $RT_DEST_DIR
echo " - Resetting existing $RT_DEST_DIR"
git reset HEAD --hard > /dev/null
git clean -fd > /dev/null
echo " - Removing and recreating $RT_DEST_DIR/current"
rm -rf $RT_DEST_DIR/current
mkdir $RT_DEST_DIR/current
git reset HEAD --hard > /dev/null 2>&1
git clean -fd > /dev/null 2>&1
echo " - Removing and recreating $RT_DEST_DIR/$VERSION"
rm -rf $RT_DEST_DIR/$VERSION
mkdir $RT_DEST_DIR/$VERSION
cd $cwd
echo " - Copying devrel to $RT_DEST_DIR/current"
cp -p -P -R dev $RT_DEST_DIR/current
echo " - Writing $RT_DEST_DIR/current/VERSION"
echo -n $VERSION > $RT_DEST_DIR/current/VERSION
echo " - Copying devrel to $RT_DEST_DIR/$VERSION"
cd dev
for i in `ls`; do cp -p -P -R $i $RT_DEST_DIR/$VERSION/; done
echo " - Writing $RT_DEST_DIR/$VERSION/VERSION"
echo -n $VERSION > $RT_DEST_DIR/$VERSION/VERSION
cd $RT_DEST_DIR
echo " - Reinitializing git state"
git add .
git commit -a -m "riak_test init" --amend > /dev/null
git add -f .
git commit -a -m "riak_test init" --amend > /dev/null 2>&1
56 changes: 56 additions & 0 deletions bin/rtdev-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/env bash

# just bail out if things go south
set -e

: ${RT_DEST_DIR:="$HOME/rt/riak"}

cwd=$(pwd)
echo -n " - Determining version: "
if [ -z "${VERSION+xxx}" ] || ([ -z "$VERSION" ] && [ "${VERSION+xxx}" = "xxx" ]); then
if [ -f $cwd/dependency_manifest.git ]; then
VERSION=`cat $cwd/dependency_manifest.git | awk '/^-/ { print $NF }'`
else
echo "Making $(pwd) a tagged release:"
VERSION=`git describe --tags | awk '{sub(/riak-/,"",$0);print}'`
fi
fi
echo $VERSION
if [ ! -d $RT_DEST_DIR ]; then
mkdir $RT_DEST_DIR
fi
cd $RT_DEST_DIR
if [ -d ".git" ]; then
echo " - Resetting existing $RT_DEST_DIR"
git reset HEAD --hard > /dev/null 2>&1
git clean -fd > /dev/null 2>&1
fi
echo " - Removing and recreating $RT_DEST_DIR/$VERSION"
rm -rf $RT_DEST_DIR/$VERSION
mkdir $RT_DEST_DIR/$VERSION
cd $cwd
echo " - Copying devrel to $RT_DEST_DIR/$VERSION"
if [ ! -d "dev" ]; then
echo "You need to run \"make devrel\" or \"make stagedevrel\" first"
exit 1
fi
cd dev
for i in `ls`; do cp -p -P -R $i $RT_DEST_DIR/$VERSION/; done
echo " - Writing $RT_DEST_DIR/$VERSION/VERSION"
echo -n $VERSION > $RT_DEST_DIR/$VERSION/VERSION
cd $RT_DEST_DIR
if [ -d ".git" ]; then
echo " - Reinitializing git state"
git add -f .
git commit -a -m "riak_test init" --amend > /dev/null 2>&1
else
git init

## Some versions of git and/or OS require these fields
git config user.name "Riak Test"
git config user.email "[email protected]"

git add .
git commit -a -m "riak_test init" > /dev/null
echo " - Successfully completed initial git commit of $RT_DEST_DIR"
fi
6 changes: 3 additions & 3 deletions bin/rtdev-setup-releases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ echo " - Creating $RT_DEST_DIR"
rm -rf $RT_DEST_DIR
mkdir -p $RT_DEST_DIR

count=$(ls */dev 2> /dev/null | wc -l)
count=$(ls * 2> /dev/null | wc -l)
if [ "$count" -ne "0" ]
then
for rel in */dev; do
for rel in *; do
vsn=$(dirname "$rel")
echo " - Initializing $RT_DEST_DIR/$vsn"
mkdir -p "$RT_DEST_DIR/$vsn"
Expand All @@ -34,7 +34,7 @@ else
fi

cd $RT_DEST_DIR
git init
git init

## Some versions of git and/or OS require these fields
git config user.name "Riak Test"
Expand Down
Binary file modified rebar
Binary file not shown.
3 changes: 2 additions & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
{riakc, ".*", {git, "git://github.com/basho/riak-erlang-client", {branch, "master"}}},
{riakhttpc, ".*", {git, "git://github.com/basho/riak-erlang-http-client", {branch, "master"}}},
{kvc, "1.3.0", {git, "https://github.com/etrepum/kvc", {tag, "v1.3.0"}}},
{druuid, ".*", {git, "git://github.com/kellymclaughlin/druuid.git", {tag, "0.2"}}}
{druuid, ".*", {git, "git://github.com/kellymclaughlin/druuid.git", {tag, "0.2"}}},
{riak_cli, ".*", {git, "[email protected]:basho/riak_cli", {branch, "master"}}}
]}.

{escript_incl_apps, [goldrush, lager, getopt, riakhttpc, riakc, ibrowse, mochiweb, kvc]}.
Expand Down
Loading

0 comments on commit 66ab243

Please sign in to comment.