Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display ruby and rubygems versions in "pharos version" output #1406

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/drone/ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ package="pharos-cluster-linux-amd64-${version}"
mkdir -p /root/.pharos/build
rubyc --openssl-dir=/etc/ssl -o "$package" -d /root/.pharos/build --make-args=--silent pharos
rm -rf /root/.pharos/build
./"$package" version
./"$package" version -a
2 changes: 1 addition & 1 deletion build/drone/ubuntu_oss.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package="pharos-cluster-linux-amd64-${version}+oss"
mkdir -p /root/.pharos/build
rubyc --openssl-dir=/etc/ssl -o "$package" -d /root/.pharos/build --make-args=--silent pharos
rm -rf /root/.pharos/build
./"$package" version
./"$package" version -a

# ship to github
curl -sL https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2 | tar -xjO > /usr/local/bin/github-release
Expand Down
2 changes: 1 addition & 1 deletion build/travis/macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ chmod +x /usr/local/bin/rubyc
version=${TRAVIS_TAG#"v"}
package="pharos-cluster-darwin-amd64-${version}"
rubyc --openssl-dir=/usr/local/etc/openssl -o "$package" --make-args=--silent pharos
./"$package" version
./"$package" version -a

rm -rf upload/
mkdir -p upload
Expand Down
2 changes: 1 addition & 1 deletion build/travis/macos_oss.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ rm -rf non-oss/
version=${TRAVIS_TAG#"v"}
package="pharos-cluster-darwin-amd64-${version}+oss"
rubyc --openssl-dir=/usr/local/etc/openssl -o "$package" --make-args=--silent pharos
./"$package" version
./"$package" version -a

# ship to github
curl -sL https://github.com/aktau/github-release/releases/download/v0.7.2/darwin-amd64-github-release.tar.bz2 | tar -xjO > /usr/local/bin/github-release
Expand Down
10 changes: 10 additions & 0 deletions lib/pharos/version_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@

module Pharos
class VersionCommand < Pharos::Command
option %w(-a --all), :flag, "include ruby and rubygems versions"

def execute
puts "Kontena Pharos:"
puts " - #{File.basename($PROGRAM_NAME)} version #{Pharos.version}"

if all?
puts "Ruby:"
puts " - #{RUBY_DESCRIPTION} (Ruby, GPLv2, 2-clause BSD)"
puts "Rubygems:"
Gem.loaded_specs.map { |name, spec| " - #{name} #{spec.version} (#{spec.licenses.join(', ')})" }.sort.each { |g| puts g }
end

ClusterManager.new(Pharos::Config.new({})).load

phases.each do |os, phases|
Expand Down