diff --git a/README.md b/README.md index 9fc2810..435e5d4 100644 --- a/README.md +++ b/README.md @@ -3,34 +3,76 @@ Traveling BOSH CLI This project packages the BOSH CLI (with plugins) into self-contained packages that can be downloaded and used by anyone without requiring Ruby and native extensions. -Download --------- +Simple installation +------------------- + +Coming soon. + +Step-by-step installation +------------------------- To download the latest release https://github.com/cloudfoundry-community/traveling-bosh/releases +For example: + +``` +rm -rf tar xfz bosh_cli*.tar.gz +wget https://github.com/cloudfoundry-community/traveling-bosh/releases/download/v1.2788.0/bosh_cli-1.2788.0-linux-x86_64.tar.gz +tar xfz bosh_cli*.tar.gz +rm bosh_cli*.tar.gz +``` + +To check that its runnable: + +``` +./bosh_cli-*/bosh +``` + +You could now create a symlink: + +``` +rm -f bosh_cli +ln -s $PWD/$(ls -d bosh_cli* | head -n1) bosh_cli +``` + +Check that its runnable via the symlink: + +To check that its runnable: + +``` +./bosh_cli/bosh +``` + +Finally, add the `bosh_cli` path into your `$PATH`: + +``` +export PATH=/path/to/bosh_cli:$PATH +``` + Background ---------- This project uses http://phusion.github.io/traveling-ruby/ -Create releases ---------------- +Create & publish releases +------------------------- Anyone in the @cloudfoundry-community can create new releases whenever new BOSH CLI versions are released. This section contains the instructions. You are required to use Ruby 2.1 to create releases as this is what traveling-ruby uses. +You will also need to install https://github.com/aktau/github-release to share the releases on Github. + The release version number is directly taken from the BOSH CLI to be packaged. First, upgrade to latest BOSH CLI. ``` bundle update -rake package:bundle_install ``` -To create the new release: +To create the new release, create new commit & git tag, and upload the packages: ``` -rake package +rake release ``` This will create three packages: diff --git a/Rakefile b/Rakefile index 3be48bc..eeaed10 100644 --- a/Rakefile +++ b/Rakefile @@ -4,19 +4,54 @@ require 'bundler/setup' PACKAGE_NAME = "bosh_cli" INTERNAL_BIN = "bosh" +RELEASE_NAME = "Self-contained BOSH CLI" +RELEASE_DESCRIPTION = "It is now easier than ever to install and use BOSH CLI. Download, unpack, and use `./bosh` script." + # http://traveling-ruby.s3-us-west-2.amazonaws.com/list.html TRAVELING_RUBY_VERSION = "20141209-2.1.5" NOKOGIRI_VERSION = "1.6.5" # Must match Gemfile SQLITE3_VERSION = "1.3.9" # Must match Gemfile -MYSQL2_VERSION = "0.3.17" # Must match Gemfile -PG_VERSION = "0.17.1" # Must match Gemfile NATIVE_GEMS = {"nokogiri" => NOKOGIRI_VERSION} +# MYSQL2_VERSION = "0.3.17" # Must match Gemfile +# PG_VERSION = "0.17.1" # Must match Gemfile # , "sqlite3" => SQLITE3_VERSION, # "mysql2" => MYSQL2_VERSION, "pg" => PG_VERSION} desc "Package your app" task :package => ['package:linux:x86', 'package:linux:x86_64', 'package:osx'] +desc "Create a release on github and upload" +task :create_release do + tag = "v#{bosh_cli_version}" + sh "git commit -a -m 'Releasing #{tag}'" + sh "git tag #{tag}" + sh "git push origin master" + sh "git push --tag" + sh "github-release release \ + --user cloudfoundry-community --repo traveling-bosh --tag #{tag} \ + --name '#{RELEASE_NAME} #{tag}' \ + --description '#{RELEASE_DESCRIPTION}'" +end + +desc "Upload files to github release" +task :upload_files do + tag = "v#{bosh_cli_version}" + + files = Dir["*#{bosh_cli_version}*.tar.gz"] + if files.size == 0 + $stderr.puts "Run `rake package` to create packages first" + exit 1 + end + files.each do |file| + sh "github-release upload \ + --user cloudfoundry-community --repo traveling-bosh --tag #{tag} \ + --name #{file} --file #{file}" + end +end + +desc "Package and upload" +task :release => ['package', 'create_release', 'upload_files'] + namespace :package do namespace :linux do desc "Package your app for Linux x86" diff --git a/packaging/wrapper.sh b/packaging/wrapper.sh index 53f41ef..234cb83 100755 --- a/packaging/wrapper.sh +++ b/packaging/wrapper.sh @@ -10,4 +10,4 @@ export BUNDLE_GEMFILE="$SELFDIR/lib/vendor/Gemfile" unset BUNDLE_IGNORE_CONFIG # Run the actual app using the bundled Ruby interpreter, with Bundler activated. -exec "$SELFDIR/lib/ruby/bin/ruby" -rbundler/setup lib/vendor/ruby/2.1.0/bin/bosh $@ +exec "$SELFDIR/lib/ruby/bin/ruby" -rbundler/setup $SELFDIR/lib/vendor/ruby/2.1.0/bin/bosh $@