This directory contains Solum sample applications. Below we give brief description of each application
by referring to the application's app file.

1) python_app.yaml

This is a Python application. The name of the application is 'cherrypy'
and it is defined in the app file. The app file defines that this app needs 'python' languagepack.
So in order to build and deploy this app to Solum, you will need to create a 'python' languagepack first. 
You can use following repository to create this languagepack:
https://github.com/rackspace-solum-samples/solum-languagepack-python.git

Use following commands to deploy this app:

solum lp create python https://github.com/rackspace-solum-samples/solum-languagepack-python.git
solum app create --app-file examples/apps/python_app.yaml
solum app deploy cherrypy
solum app show cherrypy

Once the app is READY, you can curl to app_url that is displayed in the output
of the 'app show' command.


2) java_app.yaml

This is a Java application. In the app file, we have set the name for this app
as 'java_app'. The app file defines that this app needs 'java' languagepack.
So to build and deploy this app in Solum, you will need to create a 'java' languagepack.
You can use following repository to create this languagepack:
https://github.com/rackspace-solum-samples/solum-languagepack-java.git

Use following commands to deploy this app:

solum lp create java https://github.com/rackspace-solum-samples/solum-languagepack-java.git
solum app create --app-file examples/apps/java_app.yaml
solum app deploy java_app
solum app show java_app

Once the app is READY, you can curl to app_url that is displayed in the output
of the 'app show' command.


3) nodejs_app.yaml

This is a Nodejs application. In order to use it, you will need to create
a nodejs languagepack in solum. You can use following repository for this purpose.
https://github.com/devdattakulkarni/solum-languagepack-nodejs.git


Use following commands to deploy this app:

solum lp create nodejs https://github.com/devdattakulkarni/solum-languagepack-nodejs.git
solum app create --app-file examples/apps/nodejs_app.yaml
solum app deploy nodejs-express-2
solum app show nodejs-express-2

Once the app is READY, you can curl to app_url that is displayed in the output
of the 'app show' command.


4) Github trigger and reporting

Use the following app file: github-reporting.yaml

Steps:

1) Fork the repository used in above app file in your account. Modify the app file to use this forked repo
2) Generate a Github access token and add it to the app file as repo_token. Then create the app.

   solum app create --app-file github-reporting.yaml --setup-trigger

3) CLI will generate Github webhook and add it to your repository.

4) In order for github webhook to trigger Solum running on your local vm, you will need to expose
   the Solum API to outside world. A tool called ngrok will allow you to do that.
   Download ngrok and run it on the host

   ./ngrok http 9777

5) Go to your github repository and modify webhook to include the "Forwarding" address which is output
   from running the ngrok command above.

6) Create a Pull request for your repo.

7) You will notice that Solum receives the webook and starts executing unittest workflow stage.
   You can run the app show command to check this:

   solum app show cherrypy-github

8) You can also see that the pull request on Github is updated to show the status of executing tests.
