Creating and updating an application

The following commands are used to create, update, and delete your application:

Command

Description

af push [appname]

Creates a new application. See Chapter 4, Creating an Application from Scratch, for more details. There are a number of command-line options you can use along with this command to set default values. Use af help push for more details.

af update [appname]

Uploads a new version of the application code to the AppFog cloud. You can use the --path option to point to the location of the code. See further for an example.

af delete [appname]

Deletes the application from AppFog. The tool will not ask for any confirmation, so using this command will immediately delete your application.

af clone [src-app] [dest-app] [infra]

Creates a copy of an existing application. See further for an example.

af runtimes

Sees which versions of the different runtimes are currently supported. The runtimes include Ruby, Java, PHP, and more.

af frameworks

Sees a list of supported frameworks. Frameworks are applications, such as Sinatra, Rails, Grails, and more.

af infras

Sees a list of supported infrastructures, such as AWS US East and AWS EU West.

In Chapter 4, Creating an Application from Scratch, we showed examples of how to use af push to create an application and the af delete command to delete an application.

To update the new version of the application you use the af update command. There are two ways to update your application. First is from within the application directory, where you can use the af update command directly. If you are in a different directory, you can use the --path option to point to your directory. When using the path attribute, it works best if you use the full path to your application directory. The following are examples of each usage:

$ af update insideaf4
Uploading Application:
  Checking for available resources: OK
  Packing application: OK
  Uploading (1K): OK
Push Status: OK
Stopping Application 'insideaf4': OK
Staging Application 'insideaf4': OK
Starting Application 'insideaf4': OK

$ af update insideaf4 --path /code/insideaf4
Uploading Application:
  Checking for available resources: OK
  Packing application: OK
  Uploading (1K): OK
Push Status: OK
Stopping Application 'insideaf4': OK
Staging Application 'insideaf4': OK
Starting Application 'insideaf4': OK

To make a copy of an existing application, you can use the af clone command. If you do not pass a specific infrastructure to the command, you will be prompted for it. To get a list of available infrastructures, use the af infras command.

$ af clone insideaf4 insideaf5
1: AWS US East - Virginia
2: AWS EU West - Ireland
3: AWS Asia SE - Singapore
4: HP AZ 2 - Las Vegas
Select Infrastructure: 1
Application Deployed URL [insideaf5.aws.af.cm]:
Pulling last pushed source code: OK
Cloning 'insideaf4' to 'insideaf5':
Uploading Application:
  Checking for available resources: OK
  Packing application: OK
  Uploading (1K): OK
Push Status: OK
Staging Application 'insideaf5': OK
Starting Application 'insideaf5': OK
$ af clone insideaf4 insideaf6 aws
Application Deployed URL [insideaf6.aws.af.cm]:
Pulling last pushed source code: OK
Cloning 'insideaf4' to 'insideaf6':
Uploading Application:
  Checking for available resources: OK
  Packing application: OK
  Uploading (1K): OK
Push Status: OK
Staging Application 'insideaf6': OK
Starting Application 'insideaf6': OK
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.74.25