solum/examples/apps
shangxiaobj 8be06f4dfc Fix typos and replace http with https for doc links
1) Fix typos in solum
2) Use https instead of http for docs links according to OpenStack document migration

Change-Id: I6dcda5c1e58f104c11d66607759be6d3dd94bdc8
2017-08-09 23:25:10 -07:00
..
README Fix typos and replace http with https for doc links 2017-08-09 23:25:10 -07:00
cherrypy.yaml Fixing cherrypy example app 2016-03-14 11:59:10 -05:00
docker_registry.yaml Migrate sample 'plan' files to 'app' files 2015-12-09 09:44:02 -06:00
github-reporting.yaml Github webhook handling 2016-06-12 23:12:35 -05:00
java_app.yaml Added Java example app 2016-03-16 21:36:50 +00:00
mysql.yaml Migrate sample 'plan' files to 'app' files 2015-12-09 09:44:02 -06:00
nodejs_app.yaml Updating examples README.add nodejs part. 2016-04-27 14:46:13 -04:00
python_app.yaml Updating example apps 2016-03-14 13:48:02 -05:00
solum-pep8.yaml Changing example for mysql, solum-pep8 2015-11-24 16:31:00 -06:00

README

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.