af 0.3.18.11 → 0.3.18.12

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -4,6 +4,20 @@ The AppFog CLI. This is the command line interface to AppFog.com
4
4
 
5
5
  af is based on vmc but will have features specific to the AppFog service as well as having the default target set to AppFog's service
6
6
 
7
+ ## Installation
8
+
9
+ There are two ways to install af. Most users should install the RubyGem.
10
+
11
+ $ sudo gem install af
12
+
13
+ You can also check out the source for development. You will need [Bundler](http://gembundler.com/) to build af.
14
+
15
+ $ git clone https://github.com/appfog/af.git
16
+ $ cd af
17
+ $ bundle install
18
+
19
+ ## Usage
20
+
7
21
  _Copyright 2010-2012, VMware, Inc. Licensed under the
8
22
  MIT license, please see the LICENSE file. All rights reserved._
9
23
 
@@ -102,7 +116,35 @@ MIT license, please see the LICENSE file. All rights reserved._
102
116
  help [command] Get general help or help on a specific command
103
117
  help options Get help on available options
104
118
 
105
- ## Simple Story (for PHP apps)
106
-
107
- af login
108
- af push
119
+ ## Sample Usage (for PHP apps)
120
+
121
+ $ af login developer@example.com
122
+ Attempting login to [https://api.appfog.com]
123
+ Password: *********
124
+ Successfully logged into [https://api.appfog.com]
125
+
126
+ $ af push
127
+ Would you like to deploy from the current directory? [Yn]: Y
128
+ Application Name: myapp
129
+ Detected a PHP Application, is this correct? [Yn]:
130
+ 1: AWS US East - Virginia
131
+ 2: AWS EU West - Ireland
132
+ 3: AWS Asia SE - Singapore
133
+ 4: Rackspace AZ 1 - Dallas
134
+ 5: HP AZ 2 - Las Vegas
135
+ Select Infrastructure: 1
136
+ Application Deployed URL [myapp.aws.af.cm]:
137
+ Memory reservation (128M, 256M, 512M, 1G, 2G) [128M]:
138
+ How many instances? [1]:
139
+ Bind existing services to 'myapp'? [yN]:
140
+ Create services to bind to 'myapp'? [yN]:
141
+ Would you like to save this configuration? [yN]:
142
+ Creating Application: OK
143
+ Uploading Application:
144
+ Checking for available resources: OK
145
+ Processing resources: OK
146
+ Packing application: OK
147
+ Uploading (6K): OK
148
+ Push Status: OK
149
+ Staging Application 'myapp': OK
150
+ Starting Application 'myapp': OK
@@ -463,6 +463,20 @@ module VMC::Cli::Command
463
463
  end
464
464
  end
465
465
 
466
+ def rename(oldname, newname)
467
+ # Check if new app name is taken
468
+ if newname
469
+ err "Application '#{newname}' already exists" if app_exists?(newname)
470
+ else
471
+ raise VMC::Client::AuthError unless client.logged_in?
472
+ end
473
+
474
+ app = client.app_info(oldname)
475
+ app[:name] = newname
476
+ client.update_app(oldname, app)
477
+ display "Successfully updated app name to #{newname}".green
478
+ end
479
+
466
480
  private
467
481
 
468
482
  def app_exists?(appname)
@@ -355,6 +355,10 @@ class VMC::Cli::Runner
355
355
  usage('af env-del <appname> <variable>')
356
356
  set_cmd(:apps, :environment_del, 2)
357
357
 
358
+ when 'rename'
359
+ usage('af rename <curname> <newname>')
360
+ set_cmd(:apps, :rename, 2)
361
+
358
362
  when 'create-service', 'create_service'
359
363
  usage('af create-service [service] [servicename] [appname] [--name servicename] [--bind appname] [--infra infraname]')
360
364
  set_cmd(:services, :create_service) if @args.size == 0
@@ -2,6 +2,6 @@ module VMC
2
2
  module Cli
3
3
  # This version number is used as the RubyGem release version.
4
4
  # The internal VMC version number is VMC::VERSION.
5
- VERSION = '0.3.18.11'
5
+ VERSION = '0.3.18.12'
6
6
  end
7
7
  end
@@ -382,8 +382,13 @@ class VMC::Client
382
382
  end
383
383
 
384
384
  def default_base
385
- return "vcap.me" if @target =~ /https?:\/\/api.vcap.me/
386
- "aws.af.cm"
385
+ # remove the protocol, and the first component of the url, which is normally api
386
+ pattern = /https?:\/\/[^.]+\./
387
+ if @target =~ pattern
388
+ @target.sub(pattern,'')
389
+ else
390
+ "aws.af.cm"
391
+ end
387
392
  end
388
393
 
389
394
  def infra_valid?(name)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: af
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.18.11
4
+ version: 0.3.18.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-06 00:00:00.000000000 Z
12
+ date: 2013-01-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json_pure