ON THIS PAGE
Deploying a New Application AppFog
You can deploy Java web, Java Spring, Ruby on Rails, Python and PHP apps to AppFog PaaS.
- Create a new project from the welcome screen or go to Project > New > Create Project (or go to PaaS > AppFog > Create Application if you have already created one).
- Choose a project type and AppFog as Paas.
- Enter the app name and choose its infrastructure.
- If it’s the first time you deploy an app to AppFog from Codenvy, you will be prompted to enter your AppFog registration email and password.
Successful login will be shown by a confirmation message in the Output panel.
Codenvy will be creating your application and deploying it to AppFog. Once it’s done you will see the app URL in the Output panel. The app is live on AppFog.
Here’s a short video that will guide you through the process of deploying an app to AppFog and updating it.
Updating an Existing AppFog Application
Once the app is successfully deployed to AppFog, it is possible to introduce changes to the code and update the application.
- Edit the project
- Save the files
- Go to Project > PaaS > AppFog
- A new window will open where you can update, stop, start and restart the app, change memory and number of instances etc. So, click Update
A notification will show up in the Output panel. The app is updated on AppFog.
Managing AppFog Applications
You can easily manage your AppFog apps directly from Codenvy.
- Go to PaaS > AppFog > Applications
- In a new window you will find the list of your AppFog apps which you can stop, start, restart and delete
Importing Existing AppFog Application
Currently, there is no 100% hassle free way to import an existing AppFog application to Codenvy (i.e. the one that has not been deployed to AppFog from Codenvy). However, there is a relatively simple procedure of creating a ‘twin app’ from the same source code
- go to your AppFog console, choose the app you want to import to Codenvy and download its source code as zip archive.
Alternatively, you can download app source code using AF command line
- once you have got source code saved locally, push it to GitHub
- clone/import a project from GitHub (See: Cloning repositories)
Once the project is successfully cloned you will need to do some reorganization to be able to run and deploy your application. This is how your project structure will look like after cloning
This is what needs to be done:
- create scr, main and webapp folders (see screenshot below)
- cut and paste META-INF and WEB-INF folders to webapp folder
- index.jsp and sayhello.jsp files remain in the root folder of the project
- make sure you find pom.xml file in META-INF/maven/com.codenvy.your_domain_name/your_app_name/ folder and paste in to the project root folder (like in the screenshot above)
Now the application is ready to be deployed to AppFog (See: Deploying a New Application AppFog)
Since Codenvy uses Maven as a build manager, the projects you clone should also be built with Maven, i.e. contain pom.xml file in the root project folder.