Skip to content
This repository has been archived by the owner on Sep 7, 2021. It is now read-only.

Commit

Permalink
Renamed 'ip' command and variable to 'guestip'
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Kuzmin committed Jan 6, 2015
1 parent 0005f3e commit c9153c0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# vagrant-guestip plugin
This plugin allows obtaining an IP address of a guest machine.
It's compatible with machines started remotely, i.e. by vSphere or AWS providers.

## Installation

$ vagrant plugin install vagrant-guestip

## Usage
$ vagrant guestip

$ vagrant ip
## Using with TeamCity
Running the command under JetBrains [TeamCity](https://www.jetbrains.com/teamcity/) build, it creates `VAGRANT_GUESTIP` environment variable which can be referenced by following build scripts.
**Note:** the variable is added by a [service message](https://confluence.jetbrains.com/display/TCD9/Build+Script+Interaction+with+TeamCity). It requires the command and a build script are placed into separate build steps.
2 changes: 1 addition & 1 deletion lib/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def self.synopsis
def execute
with_target_vms(nil, {:single_target=>true}) do |machine|
ip = machine.guest.capability(:read_ip_address)
message = ENV['TEAMCITY_VERSION'] ? "##teamcity[setParameter name='env.VAGRANT_IP' value='#{ip}']" : ip
message = ENV['TEAMCITY_VERSION'] ? "##teamcity[setParameter name='env.VAGRANT_GUESTIP' value='#{ip}']" : ip
@env.ui.info(message)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/vagrant-guestip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module GuestIP
class Plugin < Vagrant.plugin(2)
name 'guestip'

command('ip', primary: false) do
command('guestip', primary: false) do
require_relative 'command'
Command
end
Expand Down
4 changes: 2 additions & 2 deletions vagrant-guestip.gemspec
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Gem::Specification.new do |spec|
spec.name = 'vagrant-guestip'
spec.version = '0.1'
spec.version = '0.2'
spec.authors = ['Michael Kuzmin']
spec.email = ['[email protected]']
spec.summary = 'Vagrant plugin for obtaining IP address of guest machine'
spec.summary = 'Vagrant plugin for obtaining IP address of a guest machine'
spec.homepage = 'https://github.com/mkuzmin/vagrant-guestip'
spec.license = 'MIT'

Expand Down

0 comments on commit c9153c0

Please sign in to comment.