Deployment Synchronization with Github
This section describes how to use the existing github repository with the Stratos 2.0 Environment.
Subscribe to Cartridge
Login to Stratos 2.0 using CLI.
$./stratos.sh admin@telecom.org password
Subscribe to the PHP Cartridge.
stratos>subscribe php myphpapp --repoURL <git-repo-url> --username <username> --password <password>
Command Argument DescriptionSyntax Description php
PHP Cartridge myphpapp
Alias name for the PHP application. repoURL
URL of the GIT repository containing the myphpapp.
Example: https://github.com/lakwarus/myphpapp.gitusername
Username for provided GIT account. password
Password for provided GIT account. The
myphpapp
application is now ready to use. You can now add your own domain URL to access your application. For more information see Custom domain mapping.
Custom domain mapping
Example:
Suppose you need to give your own domain “myphp.com” to access the application at http://myphpapp.php.stratos.com:8280
You do not have to provide own domain information at the time of subscription. It is only after subscription that you can add the domain mapping using CLI tool.
To add domain mapping use the command below:
stratos>add-domain-mapping as myphp.com
The output displayed will be that of the Stratos domain that you had at the time of subscription.
Add following entry to the
/etc/hosts
file for testing purposes, if you do not wish to register a CNAME now.
192.168.92.10 myphp.com
You have successfully registered your own domain with Stratos2. To access the application use the following URL.
http://myphp.com:8082
- Upload your applications to your own github repo at the following location:
https://github.com/lakwarus/myphpapp.git
Now inform Stratos2 about your applications. For more information see Setting a service hook at Github.
Setting a service hook at Github
Follow the steps mentioned below to set a service hook at the GitHub in order to inform Stratos2 ADC about the applications deployed:
- Go to the the GitHub website.
https://github.com/lakwarus/myphpapp.git - Select repository.
- Click Goto Settings.
- Click Service Hooks.
The list of available service hooks will appear. - Click the WebHook URLs option.
- Add ADC Notification Service in the URL textbox.
Example: https://stratos-controller-host:9445/repo_notification - Click Update Settings.