Skip to content

Instantly share code, notes, and snippets.

@hkraji
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hkraji/9050225 to your computer and use it in GitHub Desktop.
Save hkraji/9050225 to your computer and use it in GitHub Desktop.
DTK Build client
#!/usr/bin/env bash
if [ -z $1 ];
then
client_branch="master"
else
client_branch=$1
fi
if [ -z $2 ];
then
common_branch="master"
else
common_branch=$2
fi
if [ -z $3 ];
then
common_core_branch="master"
else
common_core_branch=$3
fi
echo "Uninstalling gems"
gem cleanup dtk-client
gem uninstall dtk-client -x
gem cleanup dtk-common
gem uninstall dtk-client -x
echo "Building gems"
start_location=`pwd`
if [ -d "$HOME/dtk-common-repo" ]; then
cd "$HOME/dtk-common-repo"
git checkout $common_core_branch -b origin/$common_core_branch --quiet
version=`gem build dtk-common-core.gemspec | grep Version | cut -d':' -f2 | tr -d ' '`
gem install dtk-common-core-$version.gem --no-ri --no-rdoc
fi
if [ -d "$HOME/dtk-common" ]; then
cd "$HOME/dtk-common"
git checkout $common_branch -b origin/$common_branch --quiet
version=`gem build dtk-common.gemspec | grep Version | cut -d':' -f2 | tr -d ' '`
gem install dtk-common-$version.gem --no-ri --no-rdoc
fi
if [ -d "$HOME/dtk-client" ]; then
cd "$HOME/dtk-client"
git checkout $client_branch -b origin/$client_branch --quiet
version=`gem build dtk-client.gemspec | grep Version | cut -d':' -f2 | tr -d ' '`
gem install dtk-client-$version.gem --no-ri --no-rdoc
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment