Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
11.2. Creating an Application
Prerequisites:
rhc app create
command and using the command options to supply the required information, such as the type of web framework to be used with the new application. Note that if multiple versions are available for the specified web framework cartridge, you are prompted to specify the version number to use for the new application.
Option | Description |
---|---|
-n, --namespace [NAME] | Domain where you wish to create the application. |
-g, --gear-size [SIZE] | Gear size determines how much memory and CPU a cartridge consumes. |
-s, --scaling | Creates a scalable application. |
--from-code [URL] | URL to a Git repository that becomes the initial contents of the application. |
-a, --app [NAME] | Name for the application to be created. |
--enable-jenkins [NAME] | Enables Jenkins continuous integration, and creates a Jenkins application if one does not already exist. The default name is 'jenkins' if a name is not specified. |
--region [NAME] | Specifies the region in which the application will be created. |
Create a non-scalable application in the default domain with the following command:
rhc app create App_Name Cart_Name
$ rhc app create App_Name Cart_Namerhc app create App_Name Cart_Namerhc app create App_Name Cart_Namerhc app create App_Name Cart_Name
Example 11.1. Creating a Non-Scalable Application
Create a scalable application by adding the -s
parameter to the command:
rhc app create App_Name Cart_Name -s
$ rhc app create App_Name Cart_Name -srhc app create App_Name Cart_Name -srhc app create App_Name Cart_Name -srhc app create App_Name Cart_Name -srhc app create App_Name Cart_Name -s
Example 11.2. Creating a Scalable Application
rhc app create racer php-5.4 -s
$ rhc app create racer php-5.4 -s
Note
Replace the web framework type with the URL of the manifest for the hosted cartridge to create an application from a downloadable cartridge:
rhc app create App_Name https://www.example.com/manifest.yml
$ rhc app create App_Name https://www.example.com/manifest.yml rhc app create App_Name https://www.example.com/manifest.yml rhc app create App_Name https://www.example.com/manifest.yml
As described in Section 5.2.1, “Creating a Domain”, each domain supports multiple applications. Therefore, if there are multiple domains associated with an account, you must specify in which domain to create the new application with the -n
option:
rhc app create App_Name Cart_Name -n Domain_Name
$ rhc app create App_Name Cart_Name -n Domain_Namerhc app create App_Name Cart_Name -n Domain_Namerhc app create App_Name Cart_Name -n Domain_Namerhc app create App_Name Cart_Name -n Domain_Namerhc app create App_Name Cart_Name -n Domain_Namerhc app create App_Name Cart_Name -n Domain_Name
- http://app1-domain.example.com
- http://app2-domain.example.com
Create an application and enable Jenkins continuous integration:
rhc app create App_Name Cart_Name --enable-jenkins Jenkins_App_Name
$ rhc app create App_Name Cart_Name --enable-jenkins Jenkins_App_Namerhc app create App_Name Cart_Name --enable-jenkins Jenkins_App_Namerhc app create App_Name Cart_Name --enable-jenkins Jenkins_App_Namerhc app create App_Name Cart_Name --enable-jenkins Jenkins_App_Namerhc app create App_Name Cart_Name --enable-jenkins Jenkins_App_Namerhc app create App_Name Cart_Name --enable-jenkins Jenkins_App_Name
Example 11.3. Creating an Application With Jenkins Continuous Integration
Important
OpenShift Enterprise supports grouping nodes into regions and zones. With the release of OpenShift Enterprise 2.2, you can create an application and assign it to a specific region using the --region
option:
rhc app create App_Name Cart_Name --gear-size Gear_Size --region Region_Name
$ rhc app create App_Name Cart_Name --gear-size Gear_Size --region Region_Name$ rhc app create App_Name Cart_Name --gear-size Gear_Size --region Region_Name$ rhc app create App_Name Cart_Name --gear-size Gear_Size --region Region_Name$ rhc app create App_Name Cart_Name --gear-size Gear_Size --region Region_Name$ rhc app create App_Name Cart_Name --gear-size Gear_Size --region Region_Name$ rhc app create App_Name Cart_Name --gear-size Gear_Size --region Region_Name$ rhc app create App_Name Cart_Name --gear-size Gear_Size --region Region_Name$ rhc app create App_Name Cart_Name --gear-size Gear_Size --region Region_Name
Example 11.4. Creating a Scalable Application into a Specific Region
rhc app create racer php-5.4 --gear-size medium --region eu-west-1a --scaling
$ rhc app create racer php-5.4 --gear-size medium --region eu-west-1a --scaling
To create an application using code from a Git repository, specify the URL:
rhc app create --from-code URL
$ rhc app create --from-code URLrhc app create --from-code URL
For build or other testing purposes, create an application of no specific type with the DIY cartridge:
rhc app create App_Name diy
$ rhc app create App_Name diyrhc app create App_Name diyrhc app create App_Name diy
git push
and a .openshift/action_hooks/
.
Note
git push
command the application is automatically deployed and visible to customers.