This section quickly takes you through the most common usage scenarios of WSO2 App Factory. It contain the steps to log in and start managing your application workflow. You can opt to directly go to the User Guide to get detailed information on how to implement the use cases.
Go to App Factory Home Page at https://appfactorypreview.wso2.com.
Click Register to create an account and log in. If you are registered to WSO2 website (www.wso2.com) already, you can use those credentials to log in.
You are directed to the User's Overview page, which lists out all applications managed by you.
Creating an application
To start creating a new application, click Add New Application on the home page.
Fill in the following application details in the form that appears and click Create Application.
- Application Name : HelloWorldDemoApp
- Application Key : Keep the auto-generated key
- Application Type : Select Web Application
- Repository Type : Select Git
- Application creation process takes several seconds. When it is complete, the application automatically appears in the overview page.
- Click on the application's name to open it.
Checking in the source and branching
At the time you create an application, App Factory also creates a trunk repository of the type given by you (e.g., GIT), and associates your credentials with it. The trunk contains a skeleton application that you can deploy and test. First, you must check in your existing source code to this trunk and create a branch from it
Select the Repos & Builds menu on the left panel and copy the URL of the trunk repository using the Copy URL icon associated with it.
Install Git client in your local environment. See http://git-scm.com/downloads/guis.
Take a copy of the trunk repository to your local environment.
- Add the files of your Web application to the same folder that you cloned the trunk to. Choose to replace any existing files such as the pom.xml.
- Change the following elements in the pom.xml file in your local folder:<groupId> : org.wso2.af<artifactId> : change to the existing app key<version> : SNAPSHOT
Add, commit and push your files to the remote repository.
App Factory automatically builds and deploys your application every time a commit happens.
To manage this application through its lifecycle, you must first create a branch from the trunk and version it. The trunk is always in Development stage, which is the first stage of the default lifecycle.
Go back to the Repos & Builds menu, click Create Branch and provide a version number.
Developing the branch
After creating a branch from the trunk, you can open it in your IDE and develop the code. We use WSO2 Developer Studio here as the preferred IDE, because makes the development experience much simpler with integrated App Factory tooling support.
Download and install WSO2 Developer Studio using the instructions in Installing WSO2 Developer Studio.
To open Developer Studio, go to the Eclipse Welcome page and click Open Dashboard. If you are already viewing the workbench, click the Developer Studio menu and choose Open Dashboard.
On the dashboard, click Switch to App Factory perspective.
When prompted, log in to the App Factory instance using your App Factory login information. You can also specify login information by going to the Eclipse Preferences page and expanding Developer Studio > App Factory.
The App Factory perspective opens, displaying your applications in the application list in the upper right corner (click Refresh to update the list).
To list the branches available for the application, right click on the application and select Open.
Then right-click the branch you want to work with, and select Check Out. Once it's done right click again and select import to workspace.
- The application appears in the Project Explorer. You can navigate through the application's artifacts and double-click them to edit them in the Developer Studio editor. For example,
- When you are finished making changes to the code, you can check in the updated files by right-clicking the project in the Project Explorer and choosing Team > Commit.
- Enter your user name and email, click OK, and then enter a commit message and select the files you want to commit.
Building and deploying the branch
After developing the branch and pushing your changes to the repository, you can come back to App Factory portal and build and deploy the branch. It deploys the latest built artifacts of your application to the Jenkins server that is configured by default.
- Click the Repos & Builds menu on the left panel and click Build button associated with the branch to build the branch. For example,
- If the latest revision of the application version is built without failure, a build success notice appears on the same window along with the build ID.
- Click the URL of the Jenkins server at the top of the screen to check details of the build status. Log in to the Jenkins server with the same credentials that you use to log in to App Factory.
- The Jenkins server opens in a separate browser tab as follows:
Using this browser, you can check build status, build history etc.
- Similarly click the Deploy button in the Repositories and Builds page in App Factory after building. It deploys the latest built artifacts of your application to the Jenkins server that is automatically configured for you.
- If the deployment is successful, a deployment success notice appears on the same window along with the new build ID.
Running the application
When an application is successfully built and deployed, you can run and test it in the target environment. Initially, the target environment is Development, which is the first stage of the default life cycle.
In the Repositories and Builds page, click the Test button associated with the application to launch it.
Depending on the application type, the application URL opens in a browser or the
TryIttest client. For example,
Promoting through the lifecycleAfter you are finished development and successfully built, deployed and tested the application, the next step is to promote it to the next stage of the lifecycle. App Factory comes with four default lifecycle stages as Development, Testing, Staging and Production. Default stage transitions are Promote, Demote and Retire. This is configurable.
- The application is now in the Development stage. To promote it to Testing, click the Lifecycle Management tab on the left panel, select the application branch and click Promote.
- Depending on the current lifecycle stage the branch, you get a checklist of items. This is to ensure you cannot promote a branch without meeting set standards.
- Your application is now in Testing stage.
When testing is completed, someone in the QA role can similarly promote the application to Staging where a DevOps person can promote it to Production. At each stage, separate checklist items apply. The defaults are configurable. For more information on taking your application through its life-cycle stages, see Managing Lifecycles.
You have created an application, built a team around it, checked in your code, built, deployed, tested the application and promoted it to production. For detailed information on each of these activities, see User Guide.