Skip to content

Commit

Permalink
Add build, deploy bash script
Browse files Browse the repository at this point in the history
  • Loading branch information
sputnikgugja committed Aug 21, 2016
1 parent 9aa89a2 commit ddd7a97
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
24 changes: 24 additions & 0 deletions build
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

# Load RVM into a shell session *as a function*
# Loading RVM *as a function* is mandatory
# so that we can use 'rvm use <specific version>'
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
# First try to load from a user install
source "$HOME/.rvm/scripts/rvm"
echo "using user install $HOME/.rvm/scripts/rvm"
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
# Then try to load from a root install
source "/usr/local/rvm/scripts/rvm"
echo "using root install /usr/local/rvm/scripts/rvm"
else
echo "ERROR: An RVM installation was not found.\n"
fi

rvm use ruby
gem build rtype-legacy.gemspec
gem build rtype-legacy-java.gemspec
gem build rtype-legacy-native.gemspec

rvm use jruby
gem build rtype-legacy.gemspec
46 changes: 46 additions & 0 deletions deploy
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

help() {
echo "deploy [OPTIONS]"
echo " -h Prints help"
echo " -v ARG Specifies gem version (required)"
exit 0
}

OPTIONS=$( getopt -o v:,h -- "$@" )

[ $? -ne 0 ] && exit 1

set -- $OPTIONS

while true; do
case $1 in
-v )
VERSION=$2
gem push rtype-legacy-${VERSION}.gem
gem push rtype-legacy-${VERSION}-java.gem
gem push rtype-legacy-java-${VERSION}-java.gem
gem push rtype-legacy-native-${VERSION}.gem
shift
;;
-h )
help
;;
-- )
# shift
# break
echo "Option -h or -v required"
exit 1
;;
* )
echo "Unknown option: $1"
exit 1
;;
esac
shift
done

if [ $# -ne 0 ]; then
echo "Unknown option(s): $@"
exit 1
fi

0 comments on commit ddd7a97

Please sign in to comment.