bin/overview in overview-0.0.3.61 vs bin/overview in overview-0.0.4.12
- old
+ new
@@ -1,28 +1,42 @@
#!/usr/bin/env ruby
+#run via terminal e.g. bundle exec ./bin/overview appversion -a
require 'gli'
-require 'overview'
+require 'overview.rb'
include GLI::App
-include Overview
program_desc "Config management tool connecting Over's CI / CD toolchain"
version Overview::VERSION
subcommand_option_handling :normal
arguments :strict
+=begin
desc 'Describe some switch here'
switch [:s,:switch]
+=end
+desc 'Sprint.ly API KEY'
+#default_value 'the default'
+arg_name 'API_KEY'
+flag [:sprintly_api_key]
-desc 'Describe some flag here'
-default_value 'the default'
-arg_name 'The name of the argument'
-flag [:f,:flagname]
+desc 'Sprint.ly USER'
+arg_name 'USER'
+flag [:sprintly_user]
-desc 'Describe deploy here'
+desc 'Github token'
+arg_name 'TOKEN'
+flag [:travis_token]
+
+
+desc 'Github token'
+arg_name 'TOKEN'
+flag [:github_token]
+
+desc 'Mark Sprint.ly tickets as deployed via Github'
arg_name 'Describe arguments to deploy here'
command :deploy do |c|
c.desc 'Describe a switch to deploy'
c.switch :s
@@ -38,22 +52,36 @@
puts "deploy command ran"
end
end
+desc 'Mark Sprint.ly tickets as released via Github Releases'
+arg_name 'Describe arguments to deploy here'
+command :release do |c|
+ c.action do |global_options,options,args|
+ # Your command logic here
+ # If you have any errors, just raise them
+ # raise "that command made no sense"
+
+ puts "release command ran"
+ end
+end
+
+
desc 'Retrieve the changelog for the latest commit'
#arg_name 'audience'
command :changelog do |c|
#c.desc 'Describe a switch to deploy'
#c.switch :s
c.desc "Audience receiving the changelog. Possible options are: alpha; beta; production"
c.default_value 'production'
c.flag :a
c.action do |global_options,options,args|
- puts "alphalog command ran"
+ include Changelog
+ Changelog::Log.new.display
end
end
desc 'Derive app version from Github tag, release and branch, and build from CI server e.g. v2.8.6-pnginitialsize (5462)'
arg_name 'github_token', :input
@@ -62,30 +90,37 @@
c.switch :s
c.desc 'Build number only e.g. 534'
c.switch :b
c.desc 'Version (no build) with branch e.g. 0.1.1-feature'
c.switch :v
- c.desc 'Rubygem compatible version with build appended e.g. 0.1.1.534'
+ c.desc 'Rubygem compatible version with build appended e.g. 0.1.1-feature-534'
c.switch :r
- c.desc 'Github token'
- c.flag :g
+ c.desc 'Google App Engine compatible version with build appended e.g. 0-1-1-feature-534'
+ c.switch :a
c.action do |global_options,options,args|
- ENV['GITHUB_TOKEN'] = options[:g] unless options[:g].nil?
+ include AppVersion
if options[:s]
- puts Overview::AppVersion.new.version(true).to_s
+ puts AppVersion::Version.new.version(true).to_s
elsif options[:b]
- puts Overview::AppVersion.new.build_no.to_s
+ puts AppVersion::Version.new.build_no.to_s
elsif options[:v]
- puts Overview::AppVersion.new.version.to_s
+ puts AppVersion::Version.new.version.to_s
elsif options[:r]
- puts "#{Overview::AppVersion.new.version.to_s}.#{Overview::AppVersion.new.build_no.to_s}"
+ puts "#{AppVersion::Version.new.version.to_s}.#{AppVersion::Version.new.build_no.to_s}"
+ elsif options[:a]
+ puts "#{AppVersion::Version.new.version.to_s}.#{AppVersion::Version.new.build_no.to_s}".gsub('.','-')
else
- puts Overview::AppVersion.new.to_s
+ puts AppVersion::Version.new.to_s
end
end
end
pre do |global,command,options,args|
+ ENV['GITHUB_TOKEN'] = global[:github_token] unless global[:github_token].nil?
+ ENV['TRAVIS_TOKEN'] = global[:travis_token] unless global[:travis_token].nil?
+ ENV['SPRINTLY_USER'] = global[:sprintly_user] unless global[:sprintly_user].nil?
+ ENV['SPRINTLY_API_KEY'] = global[:sprintly_api_key] unless global[:sprintly_api_key].nil?
+
# Pre logic here
# Return true to proceed; false to abort and not call the
# chosen command
# Use skips_pre before a command to skip this block
# on that command only