diff --git a/Add-on Documentation/Big Data & Analytics/DBInsights.md b/Add-on Documentation/Big Data & Analytics/DBInsights.md deleted file mode 100644 index 3b55c90..0000000 --- a/Add-on Documentation/Big Data & Analytics/DBInsights.md +++ /dev/null @@ -1,50 +0,0 @@ -# DBInsights - -DbInsights provides you with business intelligence insights and database analytics with minimum efforts on your part. - -## Adding DBInsights - -The DBInsights Add-on can be added to every deployment with: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add dbinsights.PLAN -~~~ - -When added, DBInsights automatically creates a new user account with your email adress. You can access the insights for the database within the [web console](https://www.cloudcontrol.com/console) (go to the specific deployment and click the link "dbinsights.OPTION"). - -## Upgrade DBInsights - -Upgrading to another version of DBInsights is easily done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade dbinsights.OPTION_OLD dbinsights.OPTION_NEW -~~~ - -## Downgrade DBInsights - -Downgrading to another version of DBInsights is easily done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade dbinsights.OPTION_OLD dbinsights.OPTION_NEW -~~~ - -## Removing DBInsights - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove dbinsights.OPTION -~~~ - -## Internal access credentials - -It's recommended to the read database credentials from the creds.json file. The location of the file is available in the `CRED_FILE` environment variable. Reading the credentials from the creds.json file ensures your app is always using the correct credentials. For detailed instructions on how to use the creds.json file please refer to the section about [Add-on Credentials](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons) in the general documentation. - -The JSON file has the following structure: - -~~~ -{ - "DBINSIGHTS":{ - "DBINSIGHTS_URL":"https://dbinsights.com/accounts/youraccount", - } -} -~~~ - diff --git a/Add-on Documentation/Big Data & Analytics/IndexDepot.md b/Add-on Documentation/Big Data & Analytics/IndexDepot.md deleted file mode 100644 index da390b4..0000000 --- a/Add-on Documentation/Big Data & Analytics/IndexDepot.md +++ /dev/null @@ -1,150 +0,0 @@ -# IndexDepot - -IndexDepot furnishes search solutions for numerous applications based on the latest technologies. Benefit from the advantages of the Apache Solr and ElasticSearch search server in the cloud. - -## Adding IndexDepot - -The IndexDepot Add-on can be added to every deployment with: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add indexdepot.OPTION -~~~ -When added, Indexdepot automatically creates a new user account with a default search index. You can manage your IndexDepot Add-on easily within the web console (go to the specific deployment and click the link "Login" next to "indexdepot.OPTION"). - -## Internal access credentials - -It's recommended to the read database credentials from the creds.json file. The location of the file is available in the `CRED_FILE` environment variable. Reading the credentials from the creds.json file ensures your app is always using the correct credentials. For detailed instructions on how to use the creds.json file please refer to the section about [Add-on Credentials](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons) in the general documentation. - -The JSON file has the following structure: - -~~~ -{ - "INDEXDEPOT":{ - "INDEXDEPOT_URL:"https://USERNAME:PASSWORD@www.indexdepot.com/solr/INDEX_ID/,-%20%20%7D-%7D-~~~--##%20Upgrade%20IndexDepot--Upgrading%20to%20another%20version%20of%20IndexDepot%20is%20easily%20done:--~~~-$%20cctrlapp%20APP_NAME/DEP_NAME%20addon.upgrade%20indexdepot.OPTION_OLD%20indexdepot.OPTION_NEW%20-~~~--##%20Downgrade%20IndexDepot--Downgrading%20to%20another%20version%20of%20IndexDepot%20is%20easily%20done:--~~~-$%20cctrlapp%20APP_NAME/DEP_NAME%20addon.downgrade%20indexdepot.OPTION_OLD%20indexdepot.OPTION_NEW%20-~~~--##%20Removing%20IndexDepot--~~~-$%20cctrlapp%20APP_NAME/DEP_NAME%20addon.remove%20indexdepot.OPTION-~~~--##%20IndexDepot%20Apache%20Solr%20Code%20Example--Here%20is%20an%20example%20on%20how%20to%20use%20an%20IndexDepot%20Apache%20Solr%20search%20index%20with%20PHP.%20The%20example%20uses%20the%20Zend%20HTTP%20client.%20There%20is%20another%20library%20[solr-php-client](http://code.google.com/p/solr-php-client/),%20but%20it%20didn't support SSL and HTTP authentication for secured search indexes. If you like to use [solr-php- client](http://code.google.com/p/solr-php-client/) for secured indexes, please contact [support@indexdepot.com](http://support@indexdepot.com/) for further information. - -## Step 1: Loading Data into Apache Solr - -Before indexing some sample data into Apache Solr make sure to configure new fields in schema.xml. When the add-on is added to your deployment, IndexDepot automatically creates a new user account and Solr search index in an Amazon EC2 cloud. You can manage your search index easily from the [web console](https://www.cloudcontrol.com/console) by clicking the IndexDepot add-on entry on your app's deployment page, and you gain immediate access to IndexDepot control panel. Then you can configure new fields for indexing by clicking on *Edit configuration files*. Add a new field name to schema.xml. - -~~~ - - - - -~~~ - -Don\92t forget to reload your search index in the control panel after adding the new field. - -## Step 2: Installing Zend - -Let's use the Zend Framework to index and search our first documents. This example assumes that you've downloaded and extracted it to the vendor folder inside the main directory of the cloudControl tutorial app - so you should get similar output if you use *nix: - -~~~ -$ cd ~/cctrl_tutorial_app/ $ ~/cctrl_tutorial_app: ls vendor/Zend/ Acl Crypt Form Log.php Pdf Test -~~~ - -To make the Zend Framework usable, we need to add the vendor folder to the PHP include path of our application: - -~~~ - -~~~ - -## Step 3: Getting access to IndexDepot Apache Solr credentials - -When you install the add-on, IndexDepot populates your app environment with the access credentials. Here's how you access them from the source code: - -~~~ - -~~~ - -## Step 4: Index documents - -~~~ - - -1 -cloudControl - - -2 -IndexDepot - - -EOD; -$solrHttpClient->setUri($creds['INDEXDEPOT']['INDEXDEPOT_URL'] . 'update'); -$solrHttpClient->setParameterPost(array('commit' => 'true')) -->setRawData($xml) -->setEncType('text/xml'); -$response = $solrHttpClient->request('POST'); -?> -~~~ - -## Step 5: Search documents - -~~~ -setUri($creds['INDEXDEPOT']['INDEXDEPOT_URL'] . 'select'); -$solrHttpClient->setParameter(array('q' => 'IndexDepot')); -$response = $solrHttpClient->request('GET'); -?> -~~~ - -## Step 6: Delete documents - -~~~ -*:*'; -$solrHttpClient->setUri($creds['INDEXDEPOT']['INDEXDEPOT_URL'] . 'update'); -$solrHttpClient->setParameterPost(array('commit' => 'true')) -->setRawData($xml) -->setEncType('text/xml'); -$response = $solrHttpClient->request('POST'); -?> -~~~ - -Read more on indexing and search in [Solr documentation](http://wiki.apache.org/solr/) and [Solr Tutorial](http://lucene.apache.org/solr/api/doc-files/tutorial.html). - diff --git a/Add-on Documentation/Data Processing/CloudAMQP.md b/Add-on Documentation/Data Processing/CloudAMQP.md deleted file mode 100644 index 7cede1d..0000000 --- a/Add-on Documentation/Data Processing/CloudAMQP.md +++ /dev/null @@ -1,45 +0,0 @@ -# CloudAMQP (Beta) - -CloudAMQP is a hosted RabbitMQ service, with high availability and blazing performance. - -## Adding or removing the CloudAMQP Add-on - -The Add-on comes in different sizes and prices. It can be added by executing the command addon.add: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add cloudamqp.OPTION -~~~ -".option" represents the plan size, e.g. cloudamqp.lemur - -## Upgrade the CloudAMQP Add-on - -Upgrading to another option can easily be done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade cloudamqp.OPTION_OLD cloudamqp.OPTION_NEW -~~~ - -## Downgrade the CloudAMQP Add-on - -Downgrading to another option can easily be done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade cloudamqp.OPTION_OLD cloudamqp.OPTION_NEW -~~~ - -## Removing the CloudAMQP Add-on - -Similarily, an Add-on can also be removed from the deployment easily. The costs only apply for the time the Add-on was active: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove cloudamqp.OPTION -~~~ - -## Add-on credentials - -It's recommended to read database credentials from the creds.json file. The location of the file is available in the `CRED_FILE` environment variable. Reading the credentials from the creds.json file ensures your app is always using the correct credentials. For detailed instructions on how to use the creds.json file please refer to the section about [Add-on Credentials](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons) in the general documentation. - -## PHP AMQP Example Application - -For further information on how to use CloudAMQP in your PHP app, please refer to their documentation on [Github](https://github.com/cloudamqp/php-amqp-example). - diff --git a/Add-on Documentation/Data Processing/Cloudinary.md b/Add-on Documentation/Data Processing/Cloudinary.md deleted file mode 100644 index 26927ec..0000000 --- a/Add-on Documentation/Data Processing/Cloudinary.md +++ /dev/null @@ -1,45 +0,0 @@ -# Cloudinary (Beta) - -Cloudinary is a cloud service that offers a solution to an applications's entire image management pipeline. - -## Adding or removing the Cloudinary Add-on - -The Add-on comes in different sizes and prices. It can be added by executing the command addon.add: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add cloudinary.OPTION -~~~ -*.option* represents the plan size, e.g. cloudinary.test - - -## Upgrade the Cloudinary Add-on - -Upgrading to another option can easily be done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade cloudinary.OPTION_OLD cloudinary.OPTION_NEW -~~~ - -##Downgrade the Cloudinary Add-on - -Downgrading to another option can easily be done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade cloudinary.OPTION_OLD cloudinary.OPTION_NEW -~~~ - -## Removing the Cloudinary Add-on - -Similarily, an Add-on can also be removed from the deployment easily. The costs only apply for the time the Add-on was active: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove cloudinary.OPTION -~~~ - -## Add-on credentials - -Internal access credentials - -It's recommended to the read database credentials from the creds.json file. The location of the file is available in the `CRED_FILE` environment variable. Reading the credentials from the creds.json file ensures your app is always using the correct credentials. For detailed instructions on how to use the creds.json file please refer to the section about [Add-on Credentials](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons) in the general documentation. - -For more detailed information please refer to the [documentation on Cloudinary](http://cloudinary.com/documentation/cloudcontrol_integration). \ No newline at end of file diff --git a/Add-on Documentation/Data Processing/Found Elasticsearch.md b/Add-on Documentation/Data Processing/Found Elasticsearch.md deleted file mode 100644 index 5c92623..0000000 --- a/Add-on Documentation/Data Processing/Found Elasticsearch.md +++ /dev/null @@ -1,261 +0,0 @@ -# Found Elasticsearch - -[Elasticsearch](http://www.elasticsearch.org) is an open source, distributed, REST-ful search engine. In addition to being an excellent search engine, it is also great for analytics, storing logs, etc. — a general "NoSQL" store. - -[Found Elasticsearch](http://www.found.no/) provides dedicated clusters with reserved memory and storage, ensuring predictable performance. You can easily scale your search cluster up or down using the web console, with no downtime. We provide replication and automatic failover for production and mission critical environments, protecting your cluster against unplanned downtime. - -## Installing the add-on - -To use Found Elasticsearch on cloudControl, install the add-on using the `cctrlapp` command: - - $ cctrlapp APP_NAME/DEP_NAME addon.add foundelasticsearch.option - -Replace `option` with a valid plan name, such as `dachs`. A list of all plans available can be found [here](https://www.cloudcontrol.com/add-ons/foundelasticsearch). - -Once Found Elasticsearch has been added, a `FOUNDELASTICSEARCH_URL` setting will be available in the app configuration and will contain the canonical URL used to access the newly provisioned cluster. - -### Specifying version and plugins - -We provide many Elasticsearch versions and plugins. - -After the addon has been added, version upgrades and plugin changes can be done through the add-on dashboard. - -### Supported versions and plugins - -* 0.19.12: analysis-icu, analysis-smartcn, analysis-stempel, analysis-phonetic, analysis-morphology, river-couchdb, river-jdbc, river-rabbitmq, rssriver -* 0.20.4 to 0.20.6: analysis-icu, analysis-morphology, analysis-smartcn, analysis-stempel, analysis-phonetic, river-couchdb, river-jdbc, river-rabbitmq, rssriver -* 0.90.0 to 0.90.5: analysis-icu, analysis-morphology, analysis-smartcn, analysis-stempel, analysis-phonetic, inquisitor, mapper-attachments, river-couchdb, river-jdbc, river-rabbit - -New versions are made available for provisioning soon after they're released. - -Contact [support@found.no](mailto:support@found.no) if you want the ["attachments"-plugin](http://www.elasticsearch.org/guide/reference/mapping/attachment-type/) enabled. - -## Accessing the add-on dashboard - -The Found Elasticsearch dashboard allows you to manage the cluster, like upgrading versions, enabling plugins, editing the access control lists (ACLs), and viewing the logs emitted from the nodes. - -![Found Elasticsearch Dashboard](https://s3.amazonaws.com/heroku.devcenter/heroku_assets/images/167-original.jpg "Found Elasticsearch Dashboard") - -You can access the dashboard through the [cloudControl console](https://www.cloudcontrol.com/console/). - -## Access control - -With the default configuration, since not all Elasticsearch clients support basic authentication, **anyone knowing the cluster-ID has full access to your cluster**. - -We highly recommend using the access control feature to at least require authentication. Authentication uses HTTP Basic-authentication. Most, but not all, HTTP- and Elasticsearch-libraries support this. - -You can limit access based on path, source IP, method, username/password and whether SSL is used. The access control-section of the dashboard has annotated samples to use as templates for your own ACLs. - -## Using the add-on - -In this section, we will briefly go through the indexing, updating, retrieving, searching and deleting documents in an Elasticsearch cluster. We will use [curl](http://curl.haxx.se/) as our client from the command line. - -### Indexing - -To index documents, simply `POST` documents to Elasticsearch: - - $ curl http://.foundcluster.com:9200/my_index/my_type -XPOST -d '{ - "title": "One", "tags": ["ruby"] - }' - {"ok":true,"_index":"my_index","_type":"my_type","_id":"HAJppjLLTROm8i35IJEQWQ","_version":1} - -In the above example, the index `my_index` is created dynamically when the first document is inserted into it. -All documents in Elasticsearch have a `type` and an `id`, which is echoed as `_type` and `_id` in the JSON responses. -If no `id` is specified during indexing, a random `id` is generated. - -#### Bulk indexing - -To achieve the best possible performance, using the Bulk API is highly recommended. So let us index a couple more documents using the bulk API: - - $ curl http://.foundcluster.com:9200/my_index/my_type/_bulk -XPOST -d ' - {"index": {}} - {"title": "Two", "tags": ["ruby", "python"] } - {"index": {}} - {"title": "Three", "tags": ["java"] } - {"index": {}} - {"title": "Four", "tags": ["ruby", "php"] } - ' - -Elasticsearch should then give us output similar to this: - - {"took":10, "items": [ - {"create":{"_index":"my_index","_type":"my_type","_id":"v7ufoXxSSuOTckcyL7hg4Q","_version":1,"ok":true}}, - {"create":{"_index":"my_index","_type":"my_type","_id":"wOzT31EnTPiOw1ICTGX-qA","_version":1,"ok":true}}, - {"create":{"_index":"my_index","_type":"my_type","_id":"_b-kbI1MREmi9SeixFNEVw","_version":1,"ok":true}} - ]} - - -### Updating - -To update an existing document in Elasticsearch, simply `POST` the updated document to `http://.foundcluster.com:9200/my_index/my_type/`, where `` is the `id` of the document. For example, to update the last document indexed above: - - - $ curl http://.foundcluster.com:9200/my_index/my_type/_b-kbI1MREmi9SeixFNEVw -XPOST -d '{ - "title": "Four updated", "tags": ["ruby", "php"] - }' - {"ok":true,"_index":"my_index","_type":"my_type","_id":"_b-kbI1MREmi9SeixFNEVw","_version":2} - - -As you can see, the document is updated and the `_version` counter is automatically incremented. - - -### Retrieving documents - -We can take a look at the data we indexed by simply issuing a `GET` request to the document: - - $ curl http://.foundcluster.com:9200/my_index/my_type/_b-kbI1MREmi9SeixFNEVw - {"exists":true,"_index":"my_index","_type":"my_type","_id":"_b-kbI1MREmi9SeixFNEVw","_version":2,"_source":{"title": "Four updated", "tags": ["ruby", "php"]}} - -If Elasticsearch find the document, it returns a HTTP status code of `200 OK` and sets `exists: true` in the result. Otherwise, a HTTP status code of `404 Not Found` is used and the result will contain `exists: false`. - -### Searching - -Search requests may be sent to the following Elasticsearch endpoints: - -1. `http://.foundcluster.com:9200/_search` -1. `http://.foundcluster.com:9200/{index_name}/_search` -1. `http://.foundcluster.com:9200/{index_name}/{type_name}/_search` - -We can search using a `HTTP GET` or `HTTP POST` requests. To search using a `HTTP GET` request, we use URI parameters to specify our query: - - $ curl http://.foundcluster.com:9200/my_index/my_type/_search?q=title:T* - -A full explanation of allowed parameters is found in the [Elasticsearch URI Request documentation](http://www.elasticsearch.org/guide/reference/api/search/uri-request.html) - -In order to perform more complicated queries, we have to use `HTTP POST` requests to search. In the next example, we create a facet on the `tags` field: - -
Note that we added `?pretty=true` to the request, which makes Elasticsearch return a more human readable JSON response. Due to performance reasons, this is not recommended in production.
- - $ curl http://.foundcluster.com:9200/my_index/my_type/_search?pretty=true -XPOST -d '{ - "query": { - "query_string": {"query": "*"} - }, - "facets": { - "tags": { - "terms": {"field": "tags"} - } - } - }' - -A full explanation of how the request body is structured is found in the [Elasticsearch Request Body documentation](http://www.elasticsearch.org/guide/reference/api/search/request-body.html) - -To execute multiple queries in one request, use the [Multi Search API](http://www.elasticsearch.org/guide/reference/api/multi-search.html). - -### Deleting - -Documents are deleted from Elasticsearch by sending `HTTP DELETE` requests. - -1. Delete a single document: - - $ curl http://.foundcluster.com:9200/{index}/{type}/{id} -XDELETE - -1. Delete all documents of a given type: - - $ curl http://.foundcluster.com:9200/{index}/{type} -XDELETE - -1. Delete a whole index: - - $ curl http://.foundcluster.com:9200/{index} -XDELETE - -1. Delete all documents matching a query: - - For example, to delete all documents whose title starts with `T`: - - $ curl http://.foundcluster.com:9200/{index}/{type}/_query -XDELETE -d '{ - "query_string" : { "query" : "title:T*" } - } - - See [Elasticsearch Delete By Query](http://www.elasticsearch.org/guide/reference/api/delete-by-query.html) for a complete overview of this functionality. - - -## Elasticsearch clients - -Elasticsearch comes with a REST API, which can be used directly via any HTTP client. - -Many higher-level clients have been built on top of this API in various programmling languages. A large list of Elasticsearch clients and integrations are found [here](http://www.elasticsearch.org/guide/appendix/clients.html). - - -## Tire client (Ruby) - -[Tire](http://karmi.github.com/tire/) is a rich and comfortable Ruby API on top of the REST API, with built-in support for Rails. - -### Configuring Tire - - require 'rubygems' - require 'tire' - - Tire::Configuration.url ENV['FOUNDELASTICSEARCH_URL'] - -Remember to update application dependencies with bundler. - - $ bundle install - -### Indexing documents - -We start by indexing a couple of documents: - - Tire.index 'articles' do - delete - create - - store :title => 'One', :tags => ['ruby'] - store :title => 'Two', :tags => ['ruby', 'python'] - store :title => 'Three', :tags => ['java'] - store :title => 'Four', :tags => ['ruby', 'php'] - - refresh - end - - -### Searching - -After indexing the documents, we search for articles that has a title starting with "T": - - s = Tire.search 'articles' do - query do - string 'title:T*' - end - end - - s.results.each do |document| - puts "* #{ document.title } [tags: #{document.tags.join(', ')}]" - end - - # * Two [tags: ruby, python] - - -### ActiveModel integration - -See the [Tire documentation](http://karmi.github.com/tire/) for more examples and in-depth explanations on how to use Tire to integrate with ActiveModel. - -## Removing the add-on - -Found Elasticsearch can be removed via the CLI. This will destroy all associated data and cannot be undone! - - $ cctrlapp APP_NAME/DEP_NAME addon.remove foundelasticsearch.option - - -## Migrating between plans - -Available memory is a very important factor when sizing your Elasticsearch cluster, and replicating across multiple data centers is important for the resilience of production applications. Our plans are differentiated on the available reserved memory and disk quota, as well as on the number of data centers. - -Use the `cctrlapp addon.upgrade` command to migrate to a new plan: - - $ cctrlapp APP_NAME/DEP_NAME addon.upgrade foundelasticsearch.newplan - - -Upgrading to a new plan is done by extending the existing cluster with new nodes and migrating data from the old nodes to the new nodes. When the migration is finished, the old nodes are shut down and removed from the cluster. - -## Support - -Please mail [support@found.no](mailto:support@found.no) if you have any problems. - - -## Additional resources - -Found Elasticsearch exposes the majority of the Elasticsearch REST API, which means that most valid Elasticsearch API requests will work with your provisioned instance. Please refer to the [Elasticsearch guide](http://www.elasticsearch.org/guide/) for more in-depth explanations of all the possibilities. - -* [Foundation – articles on all things Elasticsearch](http://www.found.no/foundation/) -* [Elasticsearch Official Guide](http://www.elasticsearch.org/guide/) -* [Elasticsearch Official Google Groups](http://groups.google.com/forum/#!forum/elasticsearch) -* [Elasticsearch source code on GitHub](https://github.com/elasticsearch/elasticsearch) diff --git a/Add-on Documentation/Data Processing/GroupDocs.md b/Add-on Documentation/Data Processing/GroupDocs.md deleted file mode 100644 index 8f63d9d..0000000 --- a/Add-on Documentation/Data Processing/GroupDocs.md +++ /dev/null @@ -1,39 +0,0 @@ -#GroupDocs - -GroupDocs is a one-stop-shop for your document management requirements. - -## Adding GroupDocs - -GroupDocs can be added by executing the command addon.add: - - $ cctrlapp APP_NAME/DEPLOYMENT addon.add groupdocs.PLAN_NAME - -## Removing GroupDocs - -Similarly, the Add-on can be removed from the deployment easily using addon.remove: - - $ cctrlapp APP_NAME/DEPLOYMENT addon.remove groupdocs.PLAN_NAME - -## Sample GroupDocs app - -If you just want to try GroupDocs out but haven't got any app running yet, you can clone the GroupDocs sample app: - - $ git clone git://github.com/groupdocs/groupdocs-cloudcontrol-examples-for-python.git - -Store the app on Git: - - $ cd groupdocs-cloudcontrol-examples-for-python - $ git init - $ git add . - $ git commit -m "init" - -Create your app on the Python cloudControl stack: - - $ cctrlapp APP_NAME create python - -Push and deploy the code: - - $ cctrlapp APP_NAME push - $ cctrlapp APP_NAME deploy - -This sample app is also running live on cloudControl. To view and try, please open [http://groupdocspython.cloudcontrolapp.com/](http://groupdocspython.cloudcontrolapp.com/). diff --git a/Add-on Documentation/Data Processing/IronMQ.md b/Add-on Documentation/Data Processing/IronMQ.md deleted file mode 100644 index 82a2ada..0000000 --- a/Add-on Documentation/Data Processing/IronMQ.md +++ /dev/null @@ -1,53 +0,0 @@ -# IronMQ - -IronMQ is an elastic message queue for managing data and event flow within cloud applications and between systems. - -## Adding IronMQ - -IronMQ can be added to every deployment with: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add iron_mq.OPTION -~~~ - -## Upgrade IronMQ - -Upgrading to another version of IronMQ is easily done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade iron_mq.OPTION_OLD iron_mq.OPTION_NEW -~~~ - -## Downgrade IronMQ - -Downgrading to another version of IronMQ is easily done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade iron_mq.OPTION_OLD iron_mq.OPTION_NEW -~~~ - -## Removing IronMQ - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove iron_mq.OPTION -~~~ - -## Internal access credentials - -It's recommended to the read database credentials from the creds.json file. The location of the file is available in the `CRED_FILE` environment variable. Reading the credentials from the creds.json file ensures your app is always using the correct credentials. For detailed instructions on how to use the creds.json file please refer to the section about [Add-on Credentials](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons) in the general documentation. - -The JSON file has the following structure: - -~~~ -{ - "IRON_MQ":{ - "IRON_MQ_TOKEN":"13371234ASDFasdffdsaqwetrt12334", - "IRON_MQ_PROJECT_ID":"123345678899900asdf1233" - } -} -~~~ - -## IronMQ Code Examples - -You will find examples on how to use IronMQ within your app at [Github](https://github.com/iron-io/iron_mq_php) with support for Ruby, PHP, Python, and more. - diff --git a/Add-on Documentation/Data Processing/IronWorker.md b/Add-on Documentation/Data Processing/IronWorker.md deleted file mode 100644 index 2b024a5..0000000 --- a/Add-on Documentation/Data Processing/IronWorker.md +++ /dev/null @@ -1,53 +0,0 @@ -# IronWorker - -IronWorker is a fully featured worker system that runs elastically on the cloud. Massive scale computing with no servers. - -## Adding IronWorker - -IronWorker can be added to every deployment with: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add iron_worker.OPTION -~~~ - -## Upgrade IronWorker - -Upgrading to another version of IronWorker is easily done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade iron_worker.OPTION_OLD iron_worker.OPTION_NEW -~~~ - -## Downgrade IronWorker - -Downgrading to another version of IronWorker is easily done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade iron_worker.OPTION_OLD iron_worker.OPTION_NEW -~~~ - -## Removing IronWorker - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove iron_worker.OPTION -~~~ - -## Internal access credentials - -It's recommended to the read database credentials from the creds.json file. The location of the file is available in the `CRED_FILE` environment variable. Reading the credentials from the creds.json file ensures your app is always using the correct credentials. For detailed instructions on how to use the creds.json file please refer to the section about [Add-on Credentials](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons) in the general documentation. - -The JSON file has the following structure: - -~~~ -{ - "IRON_WORKER":{ - "IRON_WORKER_TOKEN":"AsdfASDFSasddffassddfssd", - "IRON_WORKER_PROJECT_ID":"1337asdf1337ASDF1337" - } -} -~~~ - -## IronWorker Code Examples - -You will find examples on how to use IronWorker within your app at [Github](https://github.com/iron-io/iron_worker_examples/tree/master/php) with support for Ruby, PHP, Python, and more. - diff --git a/Add-on Documentation/Data Processing/QuotaGuard.md b/Add-on Documentation/Data Processing/QuotaGuard.md deleted file mode 100644 index 12729db..0000000 --- a/Add-on Documentation/Data Processing/QuotaGuard.md +++ /dev/null @@ -1,107 +0,0 @@ -# QuotaGuard - -QuotaGuard is a proxy service for outgoing API calls. By routing your calls through our distributed proxy network we guarantee that your quotas with any IP limiting services are not shared with other cloudControl users and you get consistent, reliable access to critical third party APIs like Google Maps Geocoding. - -## Adding QuotaGuard - -QuotaGuard can be added to every deployment with: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add quotaguard.OPTION -~~~ - -## Upgrade QuotaGuard - -Upgrading to another version of QuotaGuard is easy and instant: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade quotaguard.OPTION_OLD quotaguard.OPTION_NEW -~~~ - -## Downgrade QuotaGuard - -Downgrading to another version of QuotaGuard is easy and instant: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade quotaguard.OPTION_OLD quotaguard.OPTION_NEW -~~~ - -## Removing QuotaGuard - -Removing QuotaGuard will instantly prevent you from accessing our proxy so use with caution: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove quotaguard.OPTION -~~~ - -## Using QuotaGuard - -QuotaGuard provisioning provides you with a unique login to our proxy service exposed via a QUOTAGUARD_URL environment variable. How you use this depends on how you are accessing your external APIs but most HTTP libraries include a way of specifying a proxy server. For Ruby on Rails applications we recommend accessing the QuotaGuard credentials via the ENV variable. This allows you to easily set your proxy server in an initializer statement. For example with the Ruby Geocoder gem: -~~~ruby -# config/initializers/geocoder.rb -Geocoder.configure( - ... - :http_proxy => ENV['QUOTAGUARD_URL'].sub(/^http:\/\//, ''), - :timeout => 5 -) -~~~ - -Alternatively you can read the QuotaGuard credentials from the creds.json file. The location of the file is available in the `CRED_FILE` environment variable. For detailed instructions on how to use the creds.json file please refer to the section about [Add-on Credentials](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons) in the general documentation. - -The JSON file has the following structure: - -~~~ -{ - "QUOTAGUARD":{ - "QUOTAGUARD_URL":"http://username:password@proxy.quotaguard.com:9292/" - } -} -~~~ -## Monitoring QuotaGuard - -Most of our plans include analytics via our dashboard. Access this by logging in to your cloudControl console and clicking on the QuotaGuard add-on from within one of your deployments. This will take you to our dashboard on QuotaGuard.com where you will be able to see your real-time and historic usage data. - -## QuotaGuard Code Examples -### Using with Rails -Geocoding is the most common usage for QuotaGuard so this tutorial will focus on that use case. - -To add geocoding to your Rails project we recommend the [Ruby Geocoder gem](http://www.rubygeocoder.com/). - -Once you have completed the standard setup of Ruby Geocoder you can use QuotaGuard by adding the following to your geocoder initializer: - -~~~ruby -# config/initializers/geocoder.rb -Geocoder.configure( - ... - :http_proxy => ENV['QUOTAGUARD_URL'].sub(/^http:\/\//, ''), - :timeout => 5 -) -~~~ -_RubyGeoder currently expects no protocol in the URL hence why we have to strip it. This restriction will be removed in an upcoming gem release._ - -### Using with Python/Django -There are many geocoding libraries available for Python but the most used is [geopy](https://github.com/geopy/geopy) which uses [urllib2 environment variables](http://docs.python.org/2.4/lib/urllib2-examples.html) to set a proxy service. - -In your application initialization you should set the `http_proxy` variable to match the `QUOTAGUARD_URL`. - -~~~python -# Assign QuotaGuard to your environment's http_proxy variable -os.environ['http_proxy'] = os.environ['QUOTAGUARD_URL'] -~~~ - -To test in the Python interpreter - -~~~python -import urllib2 -os.environ['http_proxy'] = os.environ['QUOTAGUARD_URL'] -url = 'http://ip.jsontest.com/' -proxy = urllib2.ProxyHandler() -opener = urllib2.build_opener(proxy) -in_ = opener.open(url) -in_.read() -~~~ -## Support -Please email [support@teachmatic.com](mailto:support@teachmatic.com) if you have any problems. - -## Additional Resources -More information may be available on our [documentation page](https://www.quotaguard.com/docs). diff --git a/Add-on Documentation/Data Processing/RabbitMQBigwig.md b/Add-on Documentation/Data Processing/RabbitMQBigwig.md deleted file mode 100644 index 6ef08b4..0000000 --- a/Add-on Documentation/Data Processing/RabbitMQBigwig.md +++ /dev/null @@ -1,192 +0,0 @@ -#RabbitMQ Bigwig - -[RabbitMQ Bigwig](http://www.cloudcontrol.com/add-ons/rabbitmq-bigwig) is an [Add-on](http://www.cloudcontrol.com/add-ons/) for adding an AMQP message broker to your application. - -RabbitMQ provides robust messaging for applications. It is easy to use and supported on all major operating systems and developer platforms. - -Messaging enables software applications to connect and scale. Applications can connect to each other, as components of a larger application, or to user devices and data. Messaging is asynchronous, decoupling applications by separating the sending and receiving of data. - -The RabbitMQ Bigwig add-on is brought to you by LShift. We are a software development company with expertise in VMware's vFabric RabbitMQ and a VMware partner. We were also one of the founding companies behind the original development of RabbitMQ. - -RabbitMQ was built from the ground up to interoperate with other technologies: it is the leading implementation of AMQP, the open standard for business messaging. - -RabbitMQ can carry any type of message and there are many [design patterns](http://www.rabbitmq.com/getstarted.html) you can use to fulfil your use case. - -RabbitMQ Bigwig is accessible via an API and has supported client libraries for Ruby, Java, Python, Clojure, Erlang and C#. - -## Provisioning the add-on - -You can attach RabbitMQ Bigwig to a cloudControl application via the CLI: - -
-You can find a list of all plans available here. -
- - :::term - $ cctrlapp bigwigrailssample/default addon.add rabbitmq_bigwig.pipkin - -Once you have added RabbitMQ Bigwig you will find `RABBITMQ_BIGWIG_TX_URL` and `RABBITMQ_BIGWIG_RX_URL` settings in the app configuration. These contain the canonical URLs used to access the newly provisioned RabbitMQ Bigwig service instance. You will find these settings in your cloudControl console, at `https://www.cloudcontrol.com/console/app//dep//addons`. - -We give you two URLs to ease separating your producers from your consumers. Producers connect to the URL in `RABBITMQ_BIGWIG_TX_URL`, and we shape this connection to provide consistent throughput. Consumers connect to the URL in `RABBITMQ_BIGWIG_RX_URL`. We optimise connections to this URL for the consumer case. This separation of producers and consumers follows [RabbitMQ best practice](http://www.rabbitmq.com/memory.html). You can read more about how and why we shape [here](http://bigwig.lshift.net/message-throughput). - -After installing RabbitMQ Bigwig you should configure the application to fully integrate with the add-on. - -## Using with Rails 3.x - -Two popular AMQP client libraries for Ruby are the `bunny` and `amqp` gems. The `amqp` gem uses the asynchronous [`EventMachine`](http://rubyeventmachine.com/) framework, and so is not a good fit for a Rails application. Thus, use the `bunny` gem. Add it to your `Gemfile`: - - :::ruby - source 'https://rubygems.org/' - - gem 'rails', '3.0.10' - gem 'sqlite3' - gem 'bunny' - - [...] - -After modifying `Gemfile`, run `bundle install` to update `Gemfile.lock`: - - :::term - $ bundle install - Fetching source index for https://rubygems.org/ - Using rake (0.9.2) - [...] - Using rails (3.0.10) - Your bundle is complete! Use `bundle show [gemname]` to see where - a bundled gem is installed. - -For a full example of using Bigwig and the Bunny gem with Rails, please check out our [example rails application](https://github.com/lshift/rabbitmq-service-rails-sample). Once that's checked out, you'll be able to deploy that to cloudControl by running the following shell commands: - - $ git clone https://github.com/lshift/rabbitmq-service-rails-sample.git - ... - $ cd rabbitmq-service-rails-sample - $ cctrlapp bigwigrailssample/default create ruby - $ cctrlapp bigwigrailssample/default addon.add rabbitmq_bigwig.pipkin - $ cctrlapp bigwigrailssample/default open - -The command `cctrlapp bigwigrailssample/default open` should open the sample application in your web-browser. If it can't figure out how to open a browser on your platform, then visiting the URL previously output by `cctrlapp bigwigrailssample/default create ruby` with any browser will work fine. - -## Using with Ruby (more generally) - -The `amqp` gem is especially appropriate when running on a worker dyno, as it supports writing software that reacts to external events. For example, the following example will listen for messages on the `amqpgem.examples.hello_world` queue, and exit 60 seconds after it receives the first message. - - :::ruby - require "rubygems" - require 'amqp' - require "amqp/extensions/rabbitmq" - - EventMachine.run do - connection = AMQP.connect(:host => '127.0.0.1', :port => 5672, :vhost => 'a') - puts "Connecting to AMQP broker. Running #{AMQP::VERSION} version of the gem..." - - channel = AMQP::Channel.new(connection) - channel.queue("amqpgem.examples.hello_world", :auto_delete => true, :nowait => true) do |queue| - exchange = channel.default_exchange - - queue.subscribe do |payload| - puts "Received a message: #{payload}. Disconnecting..." - - EventMachine::Timer.new(60) do - connection.close { - EventMachine.stop { exit } - } - end - end - - exchange.publish "Hello, world!", :routing_key => queue.name - end - end - -### Development environment - -You can install RabbitMQ Bigwig for use in a local development environment. Typically this entails installing RabbitMQ and pointing the `RABBITMQ_BIGWIG_TX_URL` and `RABBITMQ_BIGWIG_RX_URL` URLs to this local service via `export RABBITMQ_BIGWIG_TX_URL=amqp://guest:guest@localhost/ RABBITMQ_BIGWIG_RX_URL=amqp://guest:guest@localhost/`. - -RabbitMQ Bigwig uses version 3.1.5. In order to rule out possible differences in behaviour between RabbitMQ versions, you should install version 3.1.5. - - - - - - - - - - - - - - - - - - - - - - -
If you have...Install with...
Mac OS X
cd /usr/local/
-git checkout 181e445c5701070adb63ac3365c68040f26f6a6a Library/Formula/rabbitmq.rb
-brew install rabbitmq
Windowshttp://www.rabbitmq.com/install-windows.html but use this installer instead: http://www.rabbitmq.com/releases/rabbitmq-server/v3.1.5/rabbitmq-server-3.1.5.exe
Debian-like Linux (Debian, Ubuntu, ...)Run as root:
$ export DEBIAN_FRONTEND=noninteractive
-$ wget http://www.rabbitmq.com/rabbitmq-signing-key-public.asc -O /tmp/rabbitmq-signing-key-public.asc
-$ apt-key add /tmp/rabbitmq-signing-key-public.asc
-$ rm /tmp/rabbitmq-signing-key-public.asc
-$ apt-get -y update # Report any bad checksums
-$ apt-get -y install erlang-nox=1:14.b.4-dfsg-1ubuntu1
-$ wget -O /tmp/package-rmq.deb http://www.rabbitmq.com/releases/rabbitmq-server/v3.1.5/rabbitmq-server_3.1.5-1_all.deb
-$ dpkg -i /tmp/package-rmq.deb
-$ rm /tmp/package-rmq.deb
-Note that Lucid Lynx's latest Erlang version is `1:13.b.3-dfsg-2ubuntu2.1`. -
Other (BSD, Solaris)http://www.rabbitmq.com/releases/rabbitmq-server/v3.1.5/rabbitmq-server-generic-unix-3.1.5.tar.gz
- -While RabbitMQ will run on Erlang version R12 or above, following RabbitMQ's advice on [which Erlang](http://www.rabbitmq.com/which-erlang.html) to use, we strongly suggest using R15 or R16. If you're running a recent Linux distribution (e.g., Ubuntu Oneiric Ocelot or Precise Pangolin), you shouldn't have any trouble here, nor should you encounter problems using the installers for either Windows or Mac OS X. - -## Dashboard - -
-For more information on the features available within the RabbitMQ Bigwig dashboard please see the docs on RabbitMQ's management plugin. -
- -The RabbitMQ Bigwig dashboard allows you to keep close watch over your broker, controlling your exchanges, queues, bindings, users, and so on. - -![RabbitMQ Bigwig Dashboard](https://www.rabbitmq.com/img/management/overview.png "RabbitMQ Bigwig Dashboard") - -You can access the dashboard via the CLI: - - :::term - $ cctrlapp bigwigrailssample/default open - Opening rabbitmq-bigwig for sharp-mountain-4005... [[[FIXME]]] - -or by visiting the [cloudControl apps web interface](https://www.cloudcontrol.com/console) and selecting the application in question. Select RabbitMQ Bigwig from the Add-ons menu. - -## Migrating between plans - -
Application owners should carefully manage the migration timing to ensure proper application function during the migration process.
- -We will publish details on how to migrate between plans with plan details. - -Use the `cctlapp bigwigrailssample/default addons.upgrade` command to migrate to a new plan. - - :::term - $ cctlapp bigwigrailssample/default addons.upgrade rabbitmq_bigwig.speedwell - -## Removing the add-on - -You can remove RabbitMQ Bigwig via the CLI. - -
This will destroy all associated data and cannot be undone!
- - :::term - $ cctlapp bigwigrailssample/default addons.remove rabbitmq_bigwig.pipkin - -Please consume all your messages from your queues before removing the add-on as removal will destroy all data and cannot be undone. Use the web dashboard to confirm. - -## Support - -Please submit all RabbitMQ Bigwig support and runtime issues via one of the [cloudControl Support channels](https://www.cloudcontrol.com/dev-center/support). Any non-support related issues or product feedback is welcome at rabbitmq-bigwig@lshift.net. - -## Additional resources - -Additional resources are available at: - -* [RabbitMQ website](http://www.rabbitmq.com/) -* [Bigwig documentation](http://bigwig.io/) diff --git a/Add-on Documentation/Data Processing/Searchify.md b/Add-on Documentation/Data Processing/Searchify.md deleted file mode 100644 index d42edcc..0000000 --- a/Add-on Documentation/Data Processing/Searchify.md +++ /dev/null @@ -1,44 +0,0 @@ -# Searchify - -Searchify is a hosted search Add-on that provides full-text search to your application, without the hassle of managing your own search infrastructure. Searchify makes it easy to tune your search results ranking using powerful custom scoring functions. And Searchify is fast - most search queries are answered in less than 100 milliseconds. - -Searchify is 100% IndexTank-compatible, and is a drop-in replacement for IndexTank users - -## Adding the Searchify Add-on - -To add the Searchify Add-on use the addon.add command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add searchify.OPTION -~~~ -Replace `searchify.OPTION` with a valid option, e.g. `searchify.small`. - -When added, Searchify automatically creates a new user account with your email adress. You can manage the Add-on within the [web console](https://www.cloudcontrol.com/console) (go to the specific deployment and click the link "searchify.OPTION"). - -## Upgrading the Searchify Add-on - -To upgrade from a smaller to a more powerful plan use the addon.upgrade command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade searchify.OPTION_OLD searchify.OPTION_NEW -~~~ - -## Downgrading the Searchify Add-on - -To downgrade to a smaller plan use the addon.downgrade command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade searchify.OPTION_OLD searchify.OPTION_NEW -~~~ - -## Removing the Searchify Add-on - -The Searchify Add-on can be removed from the deployment by using the addon.remove command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove searchify.OPTION -~~~ - -### Internal Access - -It's recommended to the read database credentials from the creds.json file. The location of the file is available in the `CRED_FILE` environment variable. Reading the credentials from the creds.json file ensures your app is always using the correct credentials. For detailed instructions on how to use the creds.json file please refer to the section about [Add-on Credentials](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons) in the general documentation. diff --git a/Add-on Documentation/Data Processing/Searchly.md b/Add-on Documentation/Data Processing/Searchly.md deleted file mode 100644 index 4c87a65..0000000 --- a/Add-on Documentation/Data Processing/Searchly.md +++ /dev/null @@ -1,319 +0,0 @@ -#Searchly ElasticSearch - -Don't bother with the administrative operations or reliability issues of a search platform. Searchly is a hosted, managed and scalable search as a service powered by ElasticSearch, the final frontier of search engines. - -##Adding the Searchly ElasticSearch Add-on -To add the Searchly ElasticSearch Add-on use the addon.add command. - -``` -$ cctrlapp APP_NAME/DEP_NAME addon.add searchly.OPTION -``` -Replace searchly.OPTION with a valid option, e.g. searchly.micro. - -When added, Searchly ElasticSearch automatically creates a new user account. You can manage the Add-on within the web console (go to the specific deployment and click the link "searchly.OPTION"). - -## Getting Started With ElasticSearch Clients - -### Using Tire with Rails - -[Tire](https://github.com/karmi/tire) is a Ruby client for the ElasticSearch search engine. It provides Ruby-like API for fluent communication with the ElasticSearch server and blends with ActiveModel class for convenient usage in Rails applications. -It allows to delete and create indices, define mapping for them, supports the bulk API, and presents an easy-to-use DSL for constructing your queries. -It has full ActiveRecord/ActiveModel compatibility, allowing you to index your models (incrementally upon saving, or in bulk), searching and paginating the results. - -#### Configuration - -Ruby on Rails applications will need to add the following entry into their `Gemfile`. - -```ruby -gem 'tire' -``` -Update application dependencies with bundler. -```shell -$ bundle install -``` -Configure Tire in `configure/application.rb` or `configure/environment/production.rb` - -```ruby -Tire.configure do - url ENV['SEARCHLY_URL'] -end -``` - -#### Search - -Make your model searchable: - -```ruby -class Document < ActiveRecord::Base - include Tire::Model::Search - include Tire::Model::Callbacks -end -``` - -When you now save a record: - -```ruby -Document.create :name => "Cost", - :text => "Cost is claimed to be reduced and in a public cloud delivery model capital expenditure is converted." -```` - -The included callbacks automatically add the document to a `documents` index, making the record searchable: - -```ruby -@documents = Document.search 'Cost' -``` - -Tire has very detailed documentation at it's [github page](https://github.com/karmi/tire). - -### Using Jest with Java - -[Jest](https://github.com/searchbox-io/Jest) is a Java HTTP Rest client for ElasticSearch.It is actively developed and tested by Searchly. - -#### Configuration - -Ensure you have added Sonatype repository to your pom.xml - - - . - . - - sonatype - Sonatype Groups - https://oss.sonatype.org/content/groups/public/ - - . - . - - - -With Maven add Jest dependency to your pom.xml - - - io.searchbox - jest - 0.0.5 - - -Install Jest via Maven - -```term -$ mvn clean install -``` -#### Configuration - -Create a Jest Client: - -```java -// Configuration -ClientConfig clientConfig = new ClientConfig.Builder("SEARCHLY_URL") -.multiThreaded(true).build(); - -// Construct a new Jest client according to configuration via factory -JestClientFactory factory = new JestClientFactory(); -factory.setClientConfig(clientConfig); -JestClient client = factory.getObject(); -``` - -#### Indexing - -Create an index via Jest with ease; - -```java -client.execute(new CreateIndex.Builder("articles").build()); -``` -Create new document. - -```java -Article source = new Article(); -source.setAuthor("John Ronald Reuel Tolkien"); -source.setContent("The Lord of the Rings is an epic high fantasy novel"); -``` - -Index article to "articles" index with "article" type. - -```java -Index index = new Index.Builder(source).index("articles").type("article").build(); -client.execute(index); -``` - -#### Searching - -Search queries can be either JSON String or ElasticSearch SearchSourceBuilder object -(You need to add ElasticSearch dependency for SearchSourceBuilder). - -```java -String query = "{\n" + - " \"query\": {\n" + - " \"filtered\" : {\n" + - " \"query\" : {\n" + - " \"query_string\" : {\n" + - " \"query\" : \"Lord\"\n" + - " }\n" + - " }\n"+ - " }\n" + - " }\n" + - "}"; - -Search search = (Search) new Search.Builder(query) -// multiple index or types can be added. -.addIndexName("articles") -.addIndexType("article") -.build(); - -List
result = client.getSourceAsObjectList(Article.class); -``` - -Jest has very detailed documentation at it's github [page](https://raw.github.com/searchbox-io/Jest). - -### Using Haystack with Django - -[Haystack](http://haystacksearch.org/) provides modular search for Django. It features a unified, familiar API that allows you to plug in different search backends -without having to modify your code. Currently Haystack 2.0.0-beta can be integrated to SearchBox.io ElasticSearch. - -#### Configuration - -Under the hood Haystack uses [pyelasticsearch](https://github.com/rhec/pyelasticsearch) (A Lightweight ElasticSearch client) to integrate with ElasticSearch. - -Django applications will need to add following entries into their `requirements.txt`; - -```shell -pyelasticsearch==0.2 --e git+https://github.com/toastdriven/django-haystack.git#egg=django_haystack-dev -``` -or install via pip; - -```shell -pip install pyelasticsearch==0.2 -pip install -e git+https://github.com/toastdriven/django-haystack.git@master#egg=django-haystack -``` - -As with most Django applications, you should add Haystack to the INSTALLED_APPS within your `settings.py`. - -```python -INSTALLED_APPS = [ - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.sites', - - # Added. - 'haystack', - - # Then your usual apps... -] -``` - -Add Haystack connection string to integrate with Searchly into `settings.py` and set a default index name. - -```python -import os - -HAYSTACK_CONNECTIONS = { - 'default': { - 'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', - 'URL': os.environ['SEARCHLY_URL'], - 'INDEX_NAME': 'documents', - }, - } -``` - -#### Creating SearchIndexes - -SearchIndex objects are the way Haystack determines what data should be placed in the search index and handles the flow of data in. -You can think of them as being similar to Django Models or Forms in that they are field-based and manipulate/store data. - -To build a SearchIndex, all that’s necessary is to subclass both `indexes.RealTimeSearchIndex` & `indexes.Indexable`, define the fields you want to store data with and define a `get_model` method. We’ll create the following `DocumentIndex` to correspond to our `Document` model. This code generally goes in a `search_indexes.py` file within the app it applies to, though that is not required. This allows Haystack to automatically pick it up. The `DocumentIndex` should look like: - -```python -from haystack import indexes -from myapp.models import DocumentIndex - -class DocumentIndex (indexes.RealTimeSearchIndex, indexes.Indexable): - text = indexes.CharField(document=True, use_template=True) - - def get_model(self): - return Document -``` -Additionally, we’re providing use_template=True on the text field. This allows us to use a data template (rather than error prone concatenation) to build the document the search engine will use in searching. -You’ll need to create a new template inside your `template` directory called `search/indexes/myapp/document_text.txt` and place the following inside: - -```python -{{ object.name }} -{{ object.body }} -``` -Also to integrate Haystack with Django admin, create `search_sites.py` inside your application; - - ```python -import haystack - -haystack.autodiscover() -``` - -#### Setup views - -Add the `SearchView` To Your `URLconf` - -```python -(r'^search/', include('haystack.urls')), -``` -#### Search template sample - -Your search template with default url configuration is should be placed under your `template` directory and called `search/search.html`. - -```python -{% for result in page.object_list %} -

{{ result.object.name }}

-

{{ result.object.body }}

-{% empty %} -

No results found.

-{% endfor %} -``` -#### Searching - -With default url configuration you need to make a get request with parameter named `q` to action `/search`. - -```html -
- -
-``` -The [Haystack home page](http://haystacksearch.org/) is great resource for additional documentation. - - -##Upgrading the Searchly ElasticSearch Add-on -To upgrade from a smaller to a more powerful plan use the addon.upgrade command. - -``` -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade searchly.OPTION_OLD searchly.OPTION_NEW -``` - -##Downgrading the Searchly ElasticSearch Add-on -To downgrade to a smaller plan use the addon.downgrade command. - -``` -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade searchly.OPTION_OLD searchly.OPTION_NEW -``` - -##Removing the Searchly ElasticSearch Add-on -The Searchly ElasticSearch Add-on can be removed from the deployment by using the addon.remove command. - -``` -$ cctrlapp APP_NAME/DEP_NAME addon.remove searchly.OPTION -``` - -## Searchly Dashboard - -You can find usefull information about your indices and access analytics information about your search queries. - -![Dashboard](https://s3.amazonaws.com/searchly-wordpress/assets/dashboard.png) - -##Internal Access -It's recommended to the read database credentials from the creds.json file. The location of the file is available in the CRED_FILE environment variable. Reading the credentials from the creds.json file ensures your app is always using the correct credentials. For detailed instructions on how to use the creds.json file please refer to the section about Add-on Credentials in the general documentation. - -##Searchly ElasticSearch Code Examples -Please ensure to check our [Searchly Github](https://github.com/searchbox-io) account for sample applications with various languages and frameworks. - -##Support -All Searchly support and runtime issues should be submitted via one of the cloudControl Support channels](https://www.cloudcontrol.com/dev-center/support). -Any non-support related issues or product feedback is welcome via email at: support@searchly.com diff --git a/Add-on Documentation/Data Processing/Worker.md b/Add-on Documentation/Data Processing/Worker.md index a4caf1c..6af2921 100644 --- a/Add-on Documentation/Data Processing/Worker.md +++ b/Add-on Documentation/Data Processing/Worker.md @@ -9,23 +9,23 @@ Each worker started via the Worker add-on runs in a seperate isolated container. Before you can start a worker, add the add-on with the addon.add command. ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add worker.single +$ ironcliapp APP_NAME/DEP_NAME addon.add worker.single ~~~ ## Starting a Worker -Workers can be started via the command line client's worker.add command. +Workers can be started via the command line client's worker.add command. -For the Luigi stack (only supporting PHP), use the PHP filename as the `WORKER_NAME`. But for apps on the Pinky stack, first specifiy how to start the worker by adding a new line to your app's `Procfile` and then use that as the `WORKER_NAME`. +To specify how to start a worker add a new line to your app's `Procfile` and then use that as the `WORKER_NAME`. ~~~ -$ cctrlapp APP_NAME/DEP_NAME worker.add WORKER_NAME [WORKER_PARAMS] +$ ironcliapp APP_NAME/DEP_NAME worker.add WORKER_NAME [WORKER_PARAMS] ~~~ Enclose multiple WORKER_PARAMS in double quotes. ~~~ -$ cctrlapp APP_NAME/DEP_NAME worker.add WORKER_NAME "PARAM1 PARAM2 PARAM3" +$ ironcliapp APP_NAME/DEP_NAME worker.add WORKER_NAME "PARAM1 PARAM2 PARAM3" ~~~ ## List Running Workers @@ -33,7 +33,7 @@ $ cctrlapp APP_NAME/DEP_NAME worker.add WORKER_NAME "PARAM1 PARAM2 PARAM3" To get a list of currently running workers use the worker command. ~~~ -$ cctrlapp APP_NAME/DEP_NAME worker +$ ironcliapp APP_NAME/DEP_NAME worker Workers nr. wrk_id 1 WRK_ID @@ -42,7 +42,7 @@ Workers You can also get all the worker details by appending the WRK_ID to the worker command. ~~~ -$ cctrlapp APP_NAME/DEP_NAME worker WRK_ID +$ ironcliapp APP_NAME/DEP_NAME worker WRK_ID Worker wrk_id : WRK_ID command : WORKER_NAME @@ -58,7 +58,7 @@ Workers can be either stopped via the command line client or by exiting the proc To stop a running worker via the command line use the worker.remove command. ~~~ -$ cctrlapp APP_NAME/DEP_NAME worker.remove WRK_ID +$ ironcliapp APP_NAME/DEP_NAME worker.remove WRK_ID ~~~ To get the WRK_ID refer to the listing workers section above. @@ -75,10 +75,10 @@ For more details refer to the [PHP example](#php-worker-example) below. ## Worker log -As already explained in the [Logging section](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#logging) all stdout and stderr output of workers is redirected to the worker log. To see the output in a tail -f like fashion use the log command. +As already explained in the [Logging section](/Platform Documentation.md/#logging) all stdout and stderr output of workers is redirected to the worker log. To see the output in a tail -f like fashion use the log command. ~~~ -$ cctrlapp APP_NAME/DEP_NAME log worker +$ ironcliapp APP_NAME/DEP_NAME log worker [Fri Dec 17 13:39:41 2010] WRK_ID Started Worker (command: 'WORKER_NAME', parameter: 'PARAM1 PARAM2 PARAM3') [Fri Dec 17 13:39:42 2010] WRK_ID Hello PARAM1 PARAM2 PARAM3 [...] @@ -89,7 +89,7 @@ $ cctrlapp APP_NAME/DEP_NAME log worker To remove the Worker add-on use the addon.remove command. ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove worker.single +$ ironcliapp APP_NAME/DEP_NAME addon.remove worker.single ~~~ ## PHP Worker Example @@ -123,8 +123,8 @@ while(true) { Running this worker with the exit code set to 2 would result in the following output and the worker stopping itself. ~~~ -$ cctrlapp APP_NAME/DEP_NAME worker.add WORKER_NAME 2 -$ cctrlapp APP_NAME/DEP_NAME log worker +$ ironcliapp APP_NAME/DEP_NAME worker.add WORKER_NAME 2 +$ ironcliapp APP_NAME/DEP_NAME log worker [Tue Apr 12 09:15:54 2011] WRK_ID Started Worker (command: 'WORKER_NAME', parameter: '2') [Tue Apr 12 09:15:54 2011] WRK_ID step: 1 [Tue Apr 12 09:15:55 2011] WRK_ID step: 2 diff --git a/Add-on Documentation/Data Storage/Cloudant.md b/Add-on Documentation/Data Storage/Cloudant.md deleted file mode 100644 index adbf236..0000000 --- a/Add-on Documentation/Data Storage/Cloudant.md +++ /dev/null @@ -1,57 +0,0 @@ -# Cloudant - -With cloudControl, every deployment can feature a highly available hosted CouchDB provided by [Cloudant](https://cloudant.com/). - -## Adding or removing the Cloudant Add-on - -The database comes in different sizes and prices. It can be added by executing the command addon.add: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add cloudant.OPTION -~~~ -*.option* represents the plan size, e.g. cloudant.basic - - -## Upgrade the Cloudant Add-on - -Upgrading to another option can easily be done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade cloudant.OPTION_OLD cloudant.OPTION_NEW -~~~ - -##Downgrade the Cloudant Add-on - -Downgrading to another option can easily be done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade cloudant.OPTION_OLD cloudant.OPTION_NEW -~~~ - -##Removing the Cloudant add-on - -Similarily, an add-on can also be removed from the deployment easily. The costs only apply for the time the add-on was active: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove cloudant.OPTION -~~~ -#Database credentials - -##Internal access credentials - -It's recommended to the read database credentials from the creds.json file. The location of the file is available in the `CRED_FILE` environment variable. Reading the credentials from the creds.json file ensures your app is always using the correct credentials. For detailed instructions on how to use the creds.json file please refer to the section about [Add-on Credentials](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons) in the general documentation. - -The JSON file has the following structure: - -~~~ -{ - "CLOUDANT":{ - "CLOUDANT_DATABASE":"depx11xxx22", - "CLOUDANT_PASSWORD":"asdfasdfasdf", - "CLOUDANT_PORT":"3306", - "CLOUDANT_HOSTNAME":"cloudantdb.asdf.eu-1.rds.amazonaws.com", - "CLOUDANT_USERNAME":"depx11xxx22" - } -} -~~~ - diff --git a/Add-on Documentation/Data Storage/ElephantSQL.md b/Add-on Documentation/Data Storage/ElephantSQL.md deleted file mode 100644 index 8aeb94d..0000000 --- a/Add-on Documentation/Data Storage/ElephantSQL.md +++ /dev/null @@ -1,51 +0,0 @@ -# ElephantSQL: PostgreSQL as a Service - -The most advanced open-source database, hosted in the cloud. - -As a full-featured, open-source relational DBMS (RDBMS), PostgreSQL boasts many characteristics designed to support high-transaction, mission-critical applications. - -## Adding the ElephantSQL Add-on - -To add the ElephantSQL Add-on use the addon.add command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add elephantsql.OPTION -~~~ -Replace `elephantsql.OPTION` with a valid option, e.g. `elephantsql.turtle`. - -When added, ElephantSQL automatically creates a new user account with your email adress. You can manage the Add-on within the [web console](https://www.cloudcontrol.com/console) (go to the specific deployment and click the link "elephantsql.OPTION"). - -## Upgrading the ElephantSQL Add-on - -To upgrade from a smaller to a more powerful plan use the addon.upgrade command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade elephantsql.OPTION_OLD elephantsql.OPTION_NEW -~~~ - -Please note: Upgrading works only between shared plans or between dedicated -plans. To upgrade from a shared to a dedicated plan, you would need to export -your data from the shared plan first and reimport it to the dedicated plan -later. - -## Downgrading the ElephantSQL Add-on - -To downgrade to a smaller plan use the addon.downgrade command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade elephantsql.OPTION_OLD elephantsql.OPTION_NEW -~~~ - -## Removing the ElephantSQL Add-on - -The ElephantSQL Add-on can be removed from the deployment by using the addon.remove command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove elephantsql.OPTION -~~~ - -### Internal Access - -It's recommended to the read database credentials from the creds.json file. The location of the file is available in the `CRED_FILE` environment variable. Reading the credentials from the creds.json file ensures your app is always using the correct credentials. For detailed instructions on how to use the creds.json file please refer to the section about [Add-on Credentials](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons) in the general documentation. - -You can also find a ready-to-deploy example application on [Github](https://github.com/ElephantSQL/ruby-postgresql-example.git). diff --git a/Add-on Documentation/Data Storage/Flying Sphinx.md b/Add-on Documentation/Data Storage/Flying Sphinx.md deleted file mode 100644 index 19fe87a..0000000 --- a/Add-on Documentation/Data Storage/Flying Sphinx.md +++ /dev/null @@ -1,42 +0,0 @@ -# Flying Sphinx (Alpha) - -Flying Sphinx is an Add-on for cloudControl which lets you use Thinking Sphinx (and thus, Sphinx) for all your search needs. - -## Adding or removing the Flying Sphinx Add-on - -The Add-on comes in different sizes and prices. It can be added by executing the command addon.add: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add flying_sphinx.OPTION -~~~ -".option" represents the plan size, e.g. flying_sphinx.wooden - -## Upgrade the Flying Sphinx Add-on - -Upgrading to another option can easily be done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade flying_sphinx.OPTION_OLD flying_sphinx.OPTION_NEW -~~~ -## Downgrade the Flying Sphinx Add-on - -Downgrading to another option can easily be done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade flying_sphinx.OPTION_OLD flying_sphinx.OPTION_NEW -~~~ - -## Removing the Flying Sphinx Add-on - -Similarily, an Add-on can also be removed from the deployment easily. The costs only apply for the time the Add-on was active: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove flying_sphinx.OPTION -~~~ - -# Add-on Credentials - -## Internal access credentials - -It's recommended to the read database credentials from the creds.json file. The location of the file is available in the `CRED_FILE` environment variable. Reading the credentials from the creds.json file ensures your app is always using the correct credentials. For detailed instructions on how to use the creds.json file please refer to the section about [Add-on Credentials](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons) in the general documentation. - diff --git a/Add-on Documentation/Data Storage/MemCachier.md b/Add-on Documentation/Data Storage/MemCachier.md deleted file mode 100644 index e0c75ff..0000000 --- a/Add-on Documentation/Data Storage/MemCachier.md +++ /dev/null @@ -1,404 +0,0 @@ -# MemCachier Add-on - -[MemCachier](http://www.memcachier.com) is an implementation of the [Memcached](http://memcached.org) in-memory key/value store used for caching data. It is a key technology in modern web applications for scaling and reducing server loads. The MemCachier Add-on manages and scales clusters of Memcached servers so you can focus on your app. Tell us how much memory you need and get started for free instantly. Add capacity later as you need it. - -The information below will quickly get you up and running with the MemCachier Add-on for cloudControl. For information on the benefits of MemCachier and how it works, please refer to the more extensive [User Guide](http://www.memcachier.com/documentation/memcache-user-guide/). - -Getting started ------ - -Start by installing the Add-on: - - $ cctrlapp APP_NAME/DEP_NAME addon.add memcachier.dev - -You can start with more memory if you know you'll need it: - - $ cctrlapp APP_NAME/DEP_NAME addon.add memcachier.100mb - $ cctrlapp APP_NAME/DEP_NAME addon.add memcachier.250mb - ... etc ... - -Next, setup your app to start using the cache. We have documentation for the following languages and frameworks: - - * [Ruby](#ruby) - * [Rails](#rails) - * [Python](#python) - * [PHP](#php) - * [Java](#java) - -Your credentials may take up to three (3) minutes to be synced to our servers. You may see authentication errors if you start using the cache immediately. - -Ruby ------- - -Start by adding the [memcachier](https://github.com/memcachier/memcachier-gem) and [dalli](http://github.com/mperham/dalli) gems to your Gemfile. - -~~~ruby -gem 'memcachier' -gem 'dalli' -~~~ - -Then bundle install: - -~~~ -$ bundle install -~~~ - -`Dalli` is a Ruby Memcached client, and the `memcachier` gem modifies the environment (`ENV`) such that the environment variables set by MemCachier will work with Dalli. Once these gems are installed you can start writing code. The following is a basic example using Dalli. - -~~~ruby -require 'sinatra' -require 'dalli' -require 'json' -require 'memcachier' - -def getVisits() - - config = { - :srv => ENV["MEMCACHIER_SERVERS"], - :usr => ENV["MEMCACHIER_USERNAME"], - :pwd => ENV["MEMCACHIER_PASSWORD"] - } - - cache=Dalli::Client.new(config[:srv],{:username => config[:usr],:password => config[:pwd]}) - - count=cache.get(request.ip) - if count.nil? - count=0 - end - - count+=1 - cache.set(request.ip,count) - - return count -end - -get '/' do - count=getVisits - ""+ - ""+ - "Ruby Memcachier example"+ - ""+ - "

Hello #{request.ip}

"+ - "This is visit #{count}"+ - ""+ - "" -end -~~~ - -Rails ------ - -Start by adding the [memcachier](https://github.com/memcachier/memcachier-gem) and [dalli](http://github.com/mperham/dalli) gems to your Gemfile. We’ve built a small Rails example here: [MemCachier Rails Sample App](https://github.com/memcachier/memcachier-gis). - -~~~ruby -gem 'memcachier' -gem 'dalli' -~~~ - -Then bundle install: - -~~~term -$ bundle install -~~~ - -`Dalli` is a Ruby Memcached client, and the `memcachier` gem modifies the environment (`ENV`) such that the environment variables set by MemCachier will work with Dalli. Once these gems are installed you'll want to configure the Rails cache_store appropriately. Modify `config/environments/production.rb` with the following: - -~~~ruby -config.cache_store = :dalli_store -~~~ - -In your development environment, Rails.cache defaults to a simple in-memory store and so it doesn't require a running Memcached. - -From here you can use the following code examples to use the cache in your Rails app: - -~~~ruby -Rails.cache.write("foo", "bar") -puts Rails.cache.read("foo") -~~~ - -Without the `memcachier` gem, you’ll need to pass the proper credentials to Dalli in `config/environments/production.rb`: - -~~~ruby -config.cache_store = :dalli_store, ENV["MEMCACHIER_SERVERS"], - {:username => ENV["MEMCACHIER_USERNAME"], - :password => ENV["MEMCACHIER_PASSWORD"]} -~~~ - -Python ------ - -You can use many Memcached clients for python. In this example we are gonig to use `Python-Binary-Memcached` client with built in SASL support. Run the following commands on your local machine: - -~~~ -$ pip install python-binary-memcached -$ pip freeze > requirements.txt -~~~ - -Make sure your `requirements.txt` file contains this requirement (note that your versions may differ than what’s below): - -~~~ -python-binary-memcached==0.14 -~~~ - -Then you can put this code in you server.py and start caching: - -~~~python -import os -import cgi -import json -import bmemcached -from flask import Flask -from flask import request -from random import randint - -app = Flask(__name__) - -@app.route('/') -def hello(): - count=1 - try: - cred_file = open(os.environ["CRED_FILE"]) - data = json.load(cred_file) - creds = data['MEMCACHIER'] - config = { - 'srv': str(creds['MEMCACHIER_SERVERS']).split(','), - 'usr': str(creds['MEMCACHIER_USERNAME']), - 'pwd': str(creds['MEMCACHIER_PASSWORD']) - } - except IOError: - print 'Could not open file' - - client=bmemcached.Client(config['srv'], config['usr'], config['pwd']) - ipaddr=str(request.headers['X-Forwarded-For']) - if client.get(ipaddr) is not None: - count=int(client.get(ipaddr))+1 - client.set(ipaddr, str(count)) - - return "\n\ - \n\ - Python Memcachier example\n\ - \n\ -

Hello " + ipaddr + "

\n\ - This is visit " + str(count) +"\n\ - \n\ - " - -if __name__ == '__main__': - port = int(os.environ.get('PORT', 5000)) - app.run(host='0.0.0.0', port=port) -~~~ - -PHP ------- - -Memcached provided by MemCachier can be used like this: - -~~~php - array_map(function($x) {return explode(":", $x);}, explode(",", $creds['MEMCACHIER']['MEMCACHIER_SERVERS'])), - 'USERNAME' => $creds['MEMCACHIER']['MEMCACHIER_USERNAME'], - 'PASSWORD' => $creds['MEMCACHIER']['MEMCACHIER_PASSWORD'], - ); - $m = new Memcached(); - $m->setOption(Memcached::OPT_BINARY_PROTOCOL, 1); - $m->setSaslAuthData($config['USERNAME'], $config['PASSWORD']); - $m->addServers($config['SERVERS']); - - $current_count = (int)$m->get('count') + 1; - $m->set('count', $current_count); -?> - - - Memcachier Example - - -

Hello !

-

This is visit number .

- - -~~~ - -More information on how to use php-memcached can be found on [php.net](http://php.net/manual/en/book.memcached.php). The php-memcached extension is part of the cloudControl stacks. - -Java ----- - -In this short example we will show you how to integrate your Java application with Memcachier Add-on. We will use `spymemcached` library with SASL authentication support. To use it in your project, just specify additional dependency in your `pom.xml` file: - -~~~xml -... - - com.google.code.simple-spring-memcached - spymemcached - 2.8.4 - -... -~~~ - -#####Create Memcached SASL connection: - -~~~java -package com.cloudcontrolled.sample.spring.memcachier; - -import java.io.IOException; -import java.net.InetSocketAddress; -import java.util.ArrayList; -import java.util.List; - -import javax.security.auth.callback.CallbackHandler; - -import net.spy.memcached.ConnectionFactory; -import net.spy.memcached.ConnectionFactoryBuilder; -import net.spy.memcached.MemcachedClient; -import net.spy.memcached.auth.AuthDescriptor; -import net.spy.memcached.auth.PlainCallbackHandler; - -public class MemcachierConnection extends MemcachedClient { - - public MemcachierConnection(String username, String password, String servers) throws IOException { - this(new SASLConnectionFactoryBuilder().build(username, password), getAddresses(servers)); - } - - public MemcachierConnection(ConnectionFactory cf, List addrs) throws IOException { - super(cf, addrs); - } - - private static List getAddresses(String servers) { - List addrList = new ArrayList(); - for (String server : servers.split(",")) { - String addr = server.split(":")[0]; - int port = Integer.parseInt(server.split(":")[1]); - addrList.add(new InetSocketAddress(addr, port)); - } - return addrList; - } -} - -class SASLConnectionFactoryBuilder extends ConnectionFactoryBuilder { - public ConnectionFactory build(String username, String password){ - CallbackHandler ch = new PlainCallbackHandler(username, password); - AuthDescriptor ad = new AuthDescriptor(new String[]{"PLAIN"}, ch); - this.setProtocol(Protocol.BINARY); - this.setAuthDescriptor(ad); - return this.build(); - } -} -~~~ - -#####Use Memcachier: - -~~~java -String user = System.getenv("MEMCACHIER_USERNAME"); -String pass = System.getenv("MEMCACHIER_PASSWORD"); -String addr = System.getenv("MEMCACHIER_SERVERS"); -MemcachierConnection mc = new MemcachierConnection(user, pass, addr); -~~~ - -You can also find a ready-to-deploy example on [Github](https://github.com/cloudControl/java-spring-jsp-example-app/tree/memcached_guide). - -Library support ------ - -MemCachier will work with any Memcached binding that supports [SASL authentication](https://en.wikipedia.org/wiki/Simple_Authentication_and_Security_Layer) and the [binary protocol](https://code.google.com/p/memcached/wiki/MemcacheBinaryProtocol). We have tested MemCachier with the following language bindings, although the chances are good that other SASL binary protocol packages will also work. - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LanguageBindings
Rubydalli
Python - pylibmc -
Django - django-pylibmc -
PHP - PHP-Memcached -
Java - spymemcached -
- -Local setup ------ - -To test against your cloudControl application locally, you will need to run a local Memcached process. MemCachier can only run on cloudControl but because MemCachier and Memcached speak the same protocol, you shouldn't have any issues testing it locally. Installation depends on your platform. - -This will install Memcached without SASL authentication support. This is generally what you want as client code can still try to use SASL auth and Memcached will simply ignore the requests which is the same as allowing any credentials. So your client code can run without modification locally and on cloudControl. - -On Ubuntu: - -~~~ -$ sudo apt-get install memcached -~~~ - -Or on OS X (with Homebrew): - -~~~ -$ brew install memcached -~~~ - -Or for Windows please refer to [these instructions](http://www.codeforest.net/how-to-install-memcached-on-windows-machine). - -For further information and resources (such as the memcached sourcecode) please refer to the [Memcache.org homepage](http://memcached.org) - -To run Memcached simply execute the following command: - -~~~ -$ memcached -v -~~~ - -Usage analytics ------- - -Our analytics dashboard is a simple tool that gives you more insight into how you’re using memcache. Just open your application's dashboard on our [web interface](https://www.cloudcontrol.com/console). - -Sample apps ------ - -We've built a number of working sample apps, too: - -* [Sinatra Memcached Example](http://github.com/memcachier/memcachier-social) -* [Rails Memcached Example](http://github.com/memcachier/memcachier-gis) -* [PHP Memcached Example](http://github.com/memcachier/memcachier-primes) -* [Java Jetty Memcached Example](https://github.com/memcachier/memcachier-fibonacci) - -Upgrading and downgrading ------- - -Changing your plan, either by upgrading or downgrading, requires no code changes. Your cache won't be lost, either. Upgrading and downgrading Just Works™. - -Support -------- - -All Memcachier support and runtime issues should be submitted via one of the cloudControl Support channels](https://www.cloudcontrol.com/dev-center/support). Any non-support related issues or product feedback is welcome via email at: [support@memcachier.com](mailto:support@memcachier.com) - -Any issues related to Memcachier service are reported at [Memcachier Status](http://status.memcachier.com/). - diff --git a/Add-on Documentation/Data Storage/MongoLab.md b/Add-on Documentation/Data Storage/MongoLab.md deleted file mode 100644 index e060afc..0000000 --- a/Add-on Documentation/Data Storage/MongoLab.md +++ /dev/null @@ -1,81 +0,0 @@ -# MongoLab - -MongoLab is the cloud-hosted MongoDB solution you've been looking for! MongoLab provides everything you need to make managing your database and data remarkable easy. - -## Adding MongoLab - -The MongoLab Add-on can be added to any deployment from the cctrlapp command line: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add mongolab.OPTION -~~~ - -For your OPTION, select one of MongoLab's plan offerings: free, small, medium, large, xlarge. For more information, click [here](https://www.cloudcontrol.com/add-ons/mongolab). - -## For example: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add mongolab.large -~~~ - -When added, MongoLab automatically creates a new user account and database in an Amazon EC2 cloud. You can manage your database and data easily from the [web console](https://www.cloudcontrol.com/console) by clicking the MongoLab add-on entry on your app's deployment page, and you gain immediate access to MongoLab customer support. Email [support@mongolab.com](mailto:support@mongolab.com) with any questions. - -## Internal access credentials - -Your MongoLab database connection URI is provided in the CRED_FILE environment variable, a JSON document that stores credentials from your add-on providers. This allows you to avoid hard-coding. - -Note: In the event that MongoLab must update your MONGOLAB_URI, you will be notified through the email address you\92ve provided to CloudControl. - -MongoLab's entry in your application CRED_FILE looks like this: - -~~~ -{ - "MONGOLAB":{ - "MONGOLAB_URI":"mongodb://APP_NAME:PASSWORD@ds031947.mongolab.com:31947//DBNAME", - } -} -~~~ - -Your app-name, password and db-name are all automatically generated by cloudControl and MongoLab. - -## Sample - -Here's a snippet of code to get you started: - -~~~ -selectDB(myDbName); -$col = new MongoCollection($db, myCollection); -$cursor = $col->find(); -foreach ($cursor as $doc) { echo $doc, "
"; } -?> -~~~ - -## Upgrading to a larger MongoLab plan - -Currently, automatic plan changes are not supported by MongoLab. - -There are steps to follow if you've outgrown or anticipate outgrowing your current plan. First, stop your app and any other processes running against your database. Then: - -* Backup your database -* Remove your existing Add-on -* Add a new Add-on (see available plans here) -* Restore your database -* Redeploy your app - -Providing you're using the MONGOLAB_URI from your CRED_FILE, no application changes are required. - -## Removing MongoLab - -If you'd like to remove the MongoLab add-on, use the cctrlapp command line: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove mongolab.OPTION -~~~ - -Note: All data in your database will be lost if you remove the MongoLab add-on. - diff --git a/Add-on Documentation/Data Storage/MongoSoup.md b/Add-on Documentation/Data Storage/MongoSoup.md deleted file mode 100644 index 0be03a0..0000000 --- a/Add-on Documentation/Data Storage/MongoSoup.md +++ /dev/null @@ -1,142 +0,0 @@ -# MongoSoup - -MongoSoup is the first German-based MongoDB cloud hosting solution. Supported -by a team of experts from 10gen’s first German partner comSysto you can have a -running MongoDB database in virtually no time. - -## MongoSoup - -The MongoSoup Add-on can be added to any deployment from the cctrlapp command -line: -~~~bash -$ cctrlapp APP_NAME/DEP_NAME addon.add mongosoup.OPTION -~~~ - -For your OPTION, select one of MongoSoup's plan offerings: small, medium, -large, xlarge, dedicated-small, dedicated-medium, dedicated-large, -dedicated-xlarge For more information, click -[here](https://www.cloudcontrol.com/add-ons/mongosoup). - -## For example: -~~~bash -$ cctrlapp APP_NAME/DEP_NAME addon.add mongosoup.large -~~~ - -When added, MongoSoup automatically creates a new user account and database in -an Amazon EC2 cloud. You can manage your database and data easily from the -[web console](https://www.cloudcontrol.com/console) by clicking the MongoSoup add-on -entry on your app's deployment page, and you gain immediate access to MongoSoup -customer support. Email [support@mongosoup.de](mailto:support@mongosoup.de) -with any questions. - -## Internal access credentials - -Your MongoSoup database connection URI is provided in the CRED_FILE environment -variable, a JSON document that stores credentials from your add-on providers. -This allows you to avoid hard-coding. - -Note: In the event that MongoSoup must update your MongoSoup_URI, you will be -notified through the email address you\92ve provided to CloudControl. - -MongoSoup's entry in your application CRED_FILE looks like this: -~~~ -{ - "mongosoup":{ - "MONGOSOUP_URL":"mongodb://APP_NAME:PASSWORD@dbs001.mongosoup.de//DBNAME", - } -} -~~~ - -Your app-name, password and db-name are all automatically generated by cloudControl and MongoSoup. - -## Samples - -Here are some snippets of code to help you get started: - -### PHP - -```php - selectDB(myDbName); - $col = new MongoCollection($db, myCollection); - $cursor = $col->find(); - foreach ($cursor as $doc) { echo $doc, "
"; } - ?> -``` - -### Java - -For reading CloudControl credentials you can use the Credentials class as -described in [Reading the Credentials](https://www.cloudcontrol.com/dev-center/Guides/Java/Add-on%20credentials) -article. - -```java - Credentials credentials = Credentials.getInstance(); - String uriString = credentials.getCredential("url","mongosoup").toString(); - MongoClientURI uri = new MongoClientURI(uriString); - MongoClient mongo = new MongoClient(uri); - DB db = mongo.getDB("myDbName"); - DBColection collection = db.getCollection("myCollection"); - DBCursor cur = collection.find(); - while(cur.hasNext()){ - DBObject obj = cur.next(); - ... - } -``` - - -### Python - -```python -cred_file = open(os.environ["CRED_FILE"]) -data = json.load(cred_file) -creds = data['MONGOSOUP'] -uriString = str(creds['MONGOSOUP_URL']) -mongo = MongoClient(uriString); -db = mongo['myDbName'] -collection = db['myCollection'] -for obj in collection.find(): - ... -``` - -### Ruby - -```ruby -uriString = ENV['MONGOSOUP_URL'] -client = MongoClient.from_uri(uriString) -db = client.db('myDbName') -db.myCollection.each { ... } -``` - -## Upgrading to a larger MongoSoup plan - -Currently, you can only automatically change to another plan within the shared -environment. Moving to smaller plans will only work if your data will fit into -the smaller plan's limit. - -There are steps to follow if you've outgrown or anticipate outgrowing your -current dedicated plan. First, stop your app and any other processes running -against your database. Then: - -* Backup your database -* Remove your existing Add-on -* Add a new Add-on (see available plans here) -* Restore your database -* Redeploy your app - -Providing you're using the MongoSoup_URI from your CRED_FILE, no application -changes are required. - -## Removing MongoSoup - -If you'd like to remove the MongoSoup add-on, use the cctrlapp command line: -~~~bash -$ cctrlapp APP_NAME/DEP_NAME addon.remove mongosoup.OPTION -~~~ - -Note: All data in your database will be lost if you remove the MongoSoup -add-on. diff --git a/Add-on Documentation/Data Storage/MySQLd.md b/Add-on Documentation/Data Storage/MySQLd.md deleted file mode 100644 index c2c6db2..0000000 --- a/Add-on Documentation/Data Storage/MySQLd.md +++ /dev/null @@ -1,146 +0,0 @@ -# MySQLd: Dedicated MySQL Add-on - -High-availability, dedicated MySQL databases are available for -mission-critical production deployments. The dedicated MySQL Add-on is -based on [Amazon RDS] and uses master-slave replicated Multi-AZ instances. Read -slaves or reserved instances are currently not supported via the Add-on, but -you can always create a custom RDS instance in the EU region and connect your -app to it. We recommend using the [Config Add-on] to make the credentials -of the self-managed RDS instance available to your app. - -## Features of the cloudControl MySQLd Add-on - -The MySQLd Add-on comes with the following features: - -1. Easy, Managed Deployments - - Pre-configured Parameters - You can simply launch a MySQL Instance - and connect your application within minutes without additional - configuration. - - Automatic Software Patching - cloudControl will make sure that the - MySQL software powering your deployment stays up-to-date with the - latest patches. - -2. Backup & Recovery - - Automated Backups - Turned on by default, the automated backup feature - enables point-in-time recovery for your instance. - - DB Snapshots - DB Snapshots are available. [Email us] for more details. - -3. High Availability - - Multi-AZ Deployments - Once you create or modify your DB Instance, we - will automatically provision and manage a “standby” replica in a - different Availability Zone (independent infrastructure in a physically - separate location). Database updates are made concurrently on the primary - and standby resources to prevent replication lag. - -4. Dashboard - - View key operational metrics like CPU/ Memory/ Storage/ Connections for your DB Instance deployments via [Webconsole]. - -## Adding the MySQLd Add-on - -To add the MySQLd Add-on use the `addon.add` command: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add mysqld.OPTION -~~~ -Replace `mysqld.OPTION` with a valid option, e.g. `mysqld.small`. See -[MySQLd] in the Add-on Marketplace for pricing and options. - -Please note: After adding a dedicated MySQL database, it can take up to 30 minutes before the instance is available. Also the credentials will only be available after the instance is up and running. - -## Upgrading the MySQLd Add-on - -To upgrade from a smaller to a more powerful plan use the `addon.upgrade` command: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade mysqld.OPTION_OLD mysqld.OPTION_NEW -~~~ - -Please note: Upgrading the instance types is a multi step process that first upgrades the secondary, then promotes the secondary to the new master and after that upgrades also the old master and makes it the new secondary. This process can take up to 30 minutes and can involve a 3 to 10 minute downtime. - -## Downgrading the MySQLd Add-on - -To downgrade to a smaller plan, use the `addon.downgrade` command: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade mysqld.OPTION_OLD mysqld.OPTION_NEW -~~~ - -Please note: It is only possible to downgrade to plans with matching storage -sizes. - - -## Removing the MySQLd Add-on - -The MySQLd Add-on can be removed from the deployment by using the `addon.remove` command: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove mysqld.OPTION -~~~ - -**Attention:** Removing the MySQLd Add-on deletes all data in the database. - -## Replication and Failover - -All instances are master-slave replicated across two different availability -zones. In case of a failure of the master, an automatic failover to the slave -will trigger to restore availability. This failover process takes usually -between 3 and 10 minutes. - -## Database Credentials - -### Internal Access - -It's recommended to the read database credentials from the creds.json file. The -location of the file is available in the `CRED_FILE` environment variable. -Reading the credentials from the creds.json file ensures your app is always -using the correct credentials. For detailed instructions on how to use the -creds.json file, please refer to the section about [Add-on Credentials] in the -general documentation. - -### External Access - -External access to the MySQLd Add-on is available through an SSL-encrypted connection by following these simple steps: - - 1. Download the [certificate file] to your local machine. - 1. Connect to the database using an SSL encrypted connection. - -The following example uses the MySQL command line tool: - -~~~ -$ mysql -u MYSQLD_USERNAME -p --host=MYSQLD_HOSTNAME --ssl-ca=PATH_TO_CERTIFICATE/mysql-ssl-ca-cert.pem -~~~ - -Replace the uppercase variables with the corresponding values shown by the `addon` command: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon mysqld.OPTION -Addon : mysqld.small - Settings - MYSQLD_PASSWORD : SOME_SECRET_PASSWORD - MYSQLD_USER : SOME_SECRET_USER - MYSQLD_HOST : SOME_HOST.eu-west-1.rds.amazonaws.com - MYSQLD_DATABASE : SOME_DATABASE_NAME - MYSQLD_PORT : 3306 - MYSQLD_URL : SOME_DATABASE_URL -~~~ - -Similarly, imports and exports are equally simple. - -To **export** your data use the `mysqldump` command: -~~~ -$ mysqldump -u MYSQLD_USERNAME -p --host=MYSQLD_HOSTNAME --ssl-ca=PATH_TO_CERTIFICATE/mysql-ssl-ca-cert.pem MYSQLD_DATABASE > MYSQLD_DATABASE.sql -~~~ - -To **import** an sql file into a MySQL database use the following command: -~~~ -$ mysql -u MYSQLD_USER -p --host=MYSQLD_SERVER --ssl-ca=PATH_TO_CERTIFICATE/mysql-ssl-ca-cert.pem MYSQLD_DATABASE < MYSQLD_DATABASE.sql -~~~ - - -[Amazon RDS]: http://aws.amazon.com/rds/ -[Config Add-on]: https://www.cloudcontrol.com/add-ons/config -[MySQLd]: https://www.cloudcontrol.com/add-ons/mysqld -[Add-on Credentials]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons -[Email us]: mailto:support@cloudcontrol.de -[certificate file]: http://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem -[Webconsole]: https://www.cloudcontrol.com/console/login diff --git a/Add-on Documentation/Data Storage/MySQLs.md b/Add-on Documentation/Data Storage/MySQLs.md index 8c3ea6f..fcfc551 100644 --- a/Add-on Documentation/Data Storage/MySQLs.md +++ b/Add-on Documentation/Data Storage/MySQLs.md @@ -1,13 +1,14 @@ # MySQLs: Shared MySQL Add-on -Every deployment can access a highly available shared MySQL add-on based on [Amazon RDS](http://aws.amazon.com/rds/). The shared MySQL add-on is recommended for development and low traffic apps only. For medium to high traffic apps we recommend one of the dedicated [MySQLd add-on](https://www.cloudcontrol.com/add-ons/mysqld) plans. +Every deployment can access a highly available shared MySQL add-on with +databases guaranteed to be located in CloudKilat datacenters in Indonesia. ## Adding the MySQLs Add-on The database comes in different sizes and prices. It can be added using the addon.add command. ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add mysqls.OPTION +$ ironcliapp APP_NAME/DEP_NAME addon.add mysqls.OPTION ~~~ Replace `mysqls.OPTION` with a valid option, e.g. `mysqls.free`. @@ -16,7 +17,7 @@ Replace `mysqls.OPTION` with a valid option, e.g. `mysqls.free`. To upgrade from one plan to another use the addon.upgrade command. ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade mysqls.OPTION_OLD mysqls.OPTION_NEW +$ ironcliapp APP_NAME/DEP_NAME addon.upgrade mysqls.OPTION_OLD mysqls.OPTION_NEW ~~~ ## Downgrading the MySQLs Add-on @@ -24,7 +25,7 @@ $ cctrlapp APP_NAME/DEP_NAME addon.upgrade mysqls.OPTION_OLD mysqls.OPTION_NEW To downgrade from the current plan to a smaller one use the addon.downgrade command. ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade mysqls.OPTION_OLD mysqls.OPTION_NEW +$ ironcliapp APP_NAME/DEP_NAME addon.downgrade mysqls.OPTION_OLD mysqls.OPTION_NEW ~~~ ## Removing the MySQLs Add-on @@ -34,55 +35,68 @@ Similarily, an add-on can also be removed from the deployment by using the addon **Attention:** Removing the MySQLs add-on deletes all data in the database. ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove mysqls.OPTION +$ ironcliapp APP_NAME/DEP_NAME addon.remove mysqls.OPTION ~~~ ## Replication and Failover -All instances are master-slave replicated accross two different availability zones. In case of a failure of the master, an automatic failover to the slave will trigger to restore availability. This failover process takes usually between 3 and 10 minutes. +All data is synchronously replicated in our robust multi master +[MariaDB](https://mariadb.org/) [Galera](http://galeracluster.com/) cluster. No slave lag or lost transactions. We provide high available access with our smart load balancers. By periodically checks, nodes in maintenance or failure state are automatically excluded from the load balancers database backend pool. That assures that requests are routed to healthy nodes only. ## Database Credentials ### Internal Access -It's recommended to the read database credentials from the creds.json file. The location of the file is available in the `CRED_FILE` environment variable. Reading the credentials from the creds.json file ensures your app is always using the correct credentials. For detailed instructions on how to use the creds.json file please refer to the section about [Add-on Credentials](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons) in the general documentation. +It's recommended to the read database credentials from the creds.json file. The +location of the file is available in the `CRED_FILE` environment variable. +Reading the credentials from the creds.json file ensures your app is always +using the correct credentials. For detailed instructions on how to use the +creds.json file please refer to the section about +[Add-on Credentials](/Platform Documentation.md/#add-ons) +in the general documentation. + +Most database drivers provide a reconnect on connection issues when you add **autoReconnect=true** parameter to your database uri. This should be enabled to have the most stable setup. For example with Java: +~~~ +jdbc:mysql://{MYSQLS_HOSTNAME}:{MYSQLS_PORT}/{MYSQLS_DATABASE}?autoReconnect=true +~~~ + ### External Access External access to the MySQLs add-on is available through an SSL encrypted connection by following these simple steps. - 1. Download the [certificate file](http://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem) to your local machine. + 1. Download the [certificate file](TODO) to your local machine. 1. Connect to the database using an SSL encrypted connection. The following example uses the MySQL command line tool. ~~~ -$ mysql -u MYSQLS_USERNAME -p --host=MYSQLS_HOSTNAME --ssl-ca=PATH_TO_CERTIFICATE/mysql-ssl-ca-cert.pem +$ mysql -u MYSQLS_USERNAME -p --host=MYSQLS_HOSTNAME --ssl-ca=PATH_TO_CERTIFICATE/ca-cert.pem ~~~ Replace the uppercase variables with the corresponding values shown by the addon command. ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon mysqls.OPTION +$ ironcliapp APP_NAME/DEP_NAME addon mysqls.OPTION Addon : mysqls.512mb Settings +MYSQLS_DATABASE : SOME_DATABASE_NAME +MYSQLS_HOSTNAME : mysql.kilatiron.net +MYSQLS_PORT : 3306 MYSQLS_PASSWORD : SOME_SECRET_PASSWORD MYSQLS_USERNAME : SOME_SECRET_USERNAME -MYSQLS_HOSTNAME : SOME_HOST.eu-west-1.rds.amazonaws.com:3306 -MYSQLS_DATABASE : SOME_DATABASE_NAME ~~~ Likewise imports and exports are equally simple. To **export** your data use the mysqldump command. ~~~ -$ mysqldump -u MYSQLS_USERNAME -p --host=MYSQLS_HOSTNAME --ssl-ca=PATH_TO_CERTIFICATE/mysql-ssl-ca-cert.pem MYSQLS_DATABASE > MYSQLS_DATABASE.sql +$ mysqldump -u MYSQLS_USERNAME -p --host=MYSQLS_HOSTNAME --ssl-ca=PATH_TO_CERTIFICATE/ca-cert.pem MYSQLS_DATABASE > MYSQLS_DATABASE.sql ~~~ To **import** an sql file into a MySQL database use the following command. ~~~ -$ mysql -u MYSQLS_USERNAME -p --host=MYSQLS_HOSTNAME --ssl-ca=PATH_TO_CERTIFICATE/mysql-ssl-ca-cert.pem MYSQLS_DATABASE < MYSQLS_DATABASE.sql +$ mysql -u MYSQLS_USERNAME -p --host=MYSQLS_HOSTNAME --ssl-ca=PATH_TO_CERTIFICATE/ca-cert.pem MYSQLS_DATABASE < MYSQLS_DATABASE.sql ~~~ - diff --git a/Add-on Documentation/Data Storage/OpenRedis.md b/Add-on Documentation/Data Storage/OpenRedis.md deleted file mode 100644 index 82d6e17..0000000 --- a/Add-on Documentation/Data Storage/OpenRedis.md +++ /dev/null @@ -1,44 +0,0 @@ -# OpenRedis (Beta) - -OpenRedis provides hosted Redis services available to all cloudControl apps. - -## Adding or removing the OpenRedis Add-on - -The Add-on comes in different sizes and prices. It can be added by executing the command addon.add: - - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add openredis.OPTION -~~~ -".option" represents the plan size, e.g. openredis.test - -## Upgrade the OpenRedis Add-on - -Upgrading to another option can easily be done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade openredis.OPTION_OLD openredis.OPTION_NEW -~~~ - -## Downgrade the OpenRedis Add-on - -Downgrading to another option can easily be done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade openredis.OPTION_OLD openredis.OPTION_NEW -~~~ - -## Removing the OpenRedis Add-on - -Similarily, an Add-on can also be removed from the deployment easily. The costs only apply for the time the Add-on was active: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove openredis.OPTION -~~~ - -# Add-on credentials - -## Internal access credentials - -It's recommended to the read database credentials from the creds.json file. The location of the file is available in the `CRED_FILE` environment variable. Reading the credentials from the creds.json file ensures your app is always using the correct credentials. For detailed instructions on how to use the creds.json file please refer to the section about [Add-on Credentials](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons) in the general documentation. - diff --git a/Add-on Documentation/Data Storage/PostgreSQLd.md b/Add-on Documentation/Data Storage/PostgreSQLd.md deleted file mode 100644 index 3e8dfc4..0000000 --- a/Add-on Documentation/Data Storage/PostgreSQLd.md +++ /dev/null @@ -1,172 +0,0 @@ -# PostgreSQLd: Dedicated PostgreSQL Add-on - -High-availability, dedicated PostgreSQL databases are available for -mission-critical production deployments. The dedicated PostgreSQL Add-on is -based on [Amazon RDS] and uses master-slave replicated Multi-AZ instances. Read -slaves or reserved instances are currently not supported via the Add-on, but -you can always create a custom RDS instance in the EU region and connect your -app to it. We recommend using the [Config Add-on] to make the credentials of -the self-managed RDS instance available to your app. - -## Features of the cloudControl PostgreSQLd Add-on - -The PostgreSQLd Add-on comes with the following features: - -1. Easy, Managed Deployments - - Pre-configured Parameters - You can simply launch a PostgreSQL Instance - and connect your application within minutes without additional - configuration. - - Automatic Software Patching - cloudControl will make sure that the - PostgreSQL software powering your deployment stays up-to-date with the - latest patches. - -2. Backup & Recovery - - Automated Backups - Turned on by default, the automated backup feature - enables point-in-time recovery for your instance. - - DB Snapshots - DB Snapshots are available. [Email us] for more details. - -3. High Availability - - Multi-AZ Deployments - Once you create or modify your DB Instance, we - will automatically provision and manage a “standby” replica in a - different Availability Zone (independent infrastructure in a physically - separate location). Database updates are made concurrently on the primary - and standby resources to prevent replication lag. - -4. PostgreSQL Features Supported - - PostGIS - PostGIS is a spatial database extender for PostgreSQL - object-relational database. It adds support for geographic objects - allowing you to run location queries to be run in SQL. - - Language Extensions - PostgreSQL allows procedural languages to be loaded - into the database through extensions. Three language extensions are - included with PostgreSQL to support Perl, pgSQL and Tcl. - - Full Text Search Dictionaries - PostgreSQL supports Full Text Searching - that provides the capability to identify natural-language documents that - satisfy a query, and optionally to sort them by relevance to the query. - Dictionaries, besides improving search quality, normalization and removal - of stop words also improve performance of queries. - - HStore, JSON Data Types - PostgreSQL includes support for ‘JSON’ data - type and two JSON functions. These allow return of JSON directly from the - database server. PostgreSQL has an extension that implements the ‘hstore’ - data type for storing sets of key/value pairs within a single PostgreSQL - value. - - Core PostgreSQL engine features - For a detailed list of PostgreSQL core - engine features, please refer here. - -5. Dashboard - - View key operational metrics like CPU/ Memory/ Storage/ Connections for your DB Instance deployments via [Webconsole]. - -## Adding the PostgreSQLd Add-on - -To add the PostgreSQLd Add-on, use the `addon.add` command: -~~~bash -$ cctrlapp APP_NAME/DEP_NAME addon.add postgresqld.OPTION -~~~ -Replace `postgresqld.OPTION` with a valid option, e.g. `postgresqld.small`. See -[PostgreSQLd] in the Add-on Marketplace for pricing and options. - -Please note: After adding a dedicated PostgreSQL database, it can take up to 30 -minutes before the instance is available. Also, the credentials will only be -available after the instance is up and running. - -## Upgrading the PostgreSQLd Add-on - -To upgrade from a smaller to a more powerful plan, use the `addon.upgrade` command: -~~~bash -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade postgresqld.OPTION_OLD postgresqld.OPTION_NEW -~~~ - -Please note: Upgrading the instance types is a multi-step process that first -upgrades the secondary, then promotes the secondary to the new master. After -this, the old master is updated and becomes the new secondary. This process -can take up to 30 minutes and can involve a 3 to 10 minute downtime. - -## Downgrading the PostgreSQLd Add-on - -To downgrade to a smaller plan, use the `addon.downgrade` command: -~~~bash -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade postgresqld.OPTION_OLD postgresqld.OPTION_NEW -~~~ - -Please note: It is only possible to downgrade to plans with matching storage -sizes. - -## Removing the PostgreSQLd Add-on - -The PostgreSQLd Add-on can be removed from the deployment by using the -`addon.remove` command: -~~~bash -$ cctrlapp APP_NAME/DEP_NAME addon.remove postgresqld.OPTION -~~~ - -**Attention:** Removing the PostgreSQLd Add-on deletes all data in the database. - -## Replication and Failover - -All instances are master-slave replicated across two different availability -zones. In case of a failure of the master, an automatic failover to the slave -will trigger to restore availability. This failover process takes usually -between 3 and 10 minutes. - -## Database Credentials - -### Internal Access - -It's recommended to the read database credentials from the creds.json file. The -location of the file is available in the `CRED_FILE` environment variable. -Reading the credentials from the creds.json file ensures your app is always -using the correct credentials. For detailed instructions on how to use the -creds.json file, please refer to the section about [Add-on Credentials] in the -general documentation. - -### External Access - -External access to the PostgreSQLd Add-on is available through an SSL encrypted -connection by using the `psql` command line client: -~~~bash -$ psql "host=POSTGRESQLD_HOST dbname=POSTGRESQLD_DATABASE sslmode=require" -U POSTGRESQLD_USERNAME -~~~ - -Or alternatively using URL: -~~~bash -$ psql POSTGRESQLD_URL -~~~ - -Replace the uppercase variables with the corresponding values shown by the `addon` command: -~~~bash -$ cctrlapp APP_NAME/DEP_NAME addon postgresqld.OPTION -Addon : postgresqld.small - Settings - POSTGRESQLD_PASSWORD : SOME_SECRET_PASSWORD - POSTGRESQLD_USER : SOME_SECRET_USER - POSTGRESQLD_HOST : SOME_HOST.eu-west-1.rds.amazonaws.com - POSTGRESQLD_DATABASE : SOME_DATABASE_NAME - POSTGRESQLD_PORT : 5432 - POSTGRESQLD_URL : SOME_DATABASE_URL -~~~ - -Similarly, imports and exports are equally simple. - -To **export** your data use the `pg_dump` command: -~~~bash -$ pg_dump "host=POSTGRESQLD_HOST dbname=POSTGRESQLD_DATABASE sslmode=require" -U POSTGRESQLD_USERNAME > PG_DUMP -~~~ -Or export your data using URL: -~~~bash -$ pg_dump POSTGRESQLD_URL > PG_DUMP -~~~ - -To **import** an sql file into a PostgreSQL database use the following command: -~~~bash -$ psql "host=POSTGRESQLD_HOST dbname=POSTGRESQLD_DATABASE sslmode=require" -U POSTGRESQLD_USERNAME < PG_DUMP -~~~ -Or import your data using URL: -~~~bash -$ psql POSTGRESQLD_URL < PG_DUMP -~~~ - -[Amazon RDS]: http://aws.amazon.com/rds/ -[Config Add-on]: https://www.cloudcontrol.com/add-ons/config -[PostgreSQLd]: https://www.cloudcontrol.com/add-ons/postgresqld -[Add-on Credentials]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons -[Email us]: mailto:support@cloudcontrol.de -[Webconsole]: https://www.cloudcontrol.com/console/login \ No newline at end of file diff --git a/Add-on Documentation/Deployment/Alias.md b/Add-on Documentation/Deployment/Alias.md index 1e6418e..e5ee037 100644 --- a/Add-on Documentation/Deployment/Alias.md +++ b/Add-on Documentation/Deployment/Alias.md @@ -8,82 +8,83 @@ Adding custom domains to a deployment is supported via the Alias add-on. The pro The verification code is unique to the owner of the app. To get it simply use the alias command. ~~~ - $ cctrlapp APP_NAME/default alias APP_NAME.cloudcontrolled.com + $ ironcliapp APP_NAME/default alias APP_NAME.kilatiron.net ~~~ The verification code is case sensitive and includes a space after the colon. Please ensure, it keeps the exact same syntax in the TXT records text or the alias will not get verified. 1. Add it as a TXT record to your root domain. - + Please use the interface of your DNS provider to add a [TXT record](http://de.wikipedia.org/wiki/TXT_Resource_Record) to your root domain. Please note how the TXT record is set for `example.com` but used to verify `www.example.com`. - + ~~~ - example.com. 3600 IN TXT "cloudControl-verification: 68b676e063eadb350876ae291e9ae43748d6e51c85ecd3c4cc026c869acc9d2d" + example.com. 3600 IN TXT "cloudControl-verification: + 68b676e063eadb350876ae291e9ae43748d6e51c85ecd3c4cc026c869acc9d2d" ~~~ - - Since we are going to use a CNAME to point the custom domain to the provided `.cloudcontrolled.com` subdomain all additional record types will be ignored. It's therefor required to set the TXT record on the root domain. This has the added benefit, that if you can verifiy multiple domains like e.g. `www.example.com` and `secure.example.com` with just one TXT record set for `example.com`. - - 1. Add a CNAME pointing to the provided `.cloudcontrolled.com` subdomain. - - In addition to the TXT record, go ahead and also add a CNAME pointing to your apps `.cloudcontrolled.com` subdomain. Use the command line client's alias command to show the one specific to your deployment. - + + Since we are going to use a CNAME to point the custom domain to the provided `.kilatiron.net` subdomain all additional record types will be ignored. It's therefor required to set the TXT record on the root domain. This has the added benefit, that if you can verifiy multiple domains like e.g. `www.example.com` and `secure.example.com` with just one TXT record set for `example.com`. + + 1. Add a CNAME pointing to the provided `.kilatiron.net` subdomain. + + In addition to the TXT record, go ahead and also add a CNAME pointing to your apps `.kilatiron.net` subdomain. Use the command line client's alias command to show the one specific to your deployment. + ~~~ # for the default deployment - $ cctrlapp APP_NAME/default alias + $ ironcliapp APP_NAME/default alias Aliases name default verified - APP_NAME.cloudcontrolled.com 1 1 + APP_NAME.kilatiron.net 1 1 # for any additional deployment - $ cctrlapp APP_NAME/DEP_NAME alias + $ ironcliapp APP_NAME/DEP_NAME alias Aliases name default verified - DEP_NAME.APP_NAME.cloudcontrolled.com 1 1 + DEP_NAME.APP_NAME.kilatiron.net 1 1 ~~~ - + The resulting CNAME record should look something like this example. - + ~~~ - www.example.com. 1593 IN CNAME APP_NAME.cloudcontrolled.com. + www.example.com. 1593 IN CNAME APP_NAME.kilatiron.net. ~~~ - + 1. Add one alias per domain to your deployment. - + Next add the domain as an alias to your deployment using the alias.add command. - + ~~~ - $ cctrlapp APP_NAME/DEP_NAME alias.add www.example.com + $ ironcliapp APP_NAME/DEP_NAME alias.add www.example.com ~~~ - + You should now see your domain in the deployment's list of aliases. - + ~~~ - $ cctrlapp APP_NAME/DEP_NAME alias + $ ironcliapp APP_NAME/DEP_NAME alias Aliases name default verified www.example.com 0 0 [...] ~~~ - + The verification takes at least 30 minutes, but depends on the TTL of you DNS configuration. - + 1. Wait for the DNS changes to propagate. As soon as the changes have propagated through the DNS the alias will be verified and the deployment will start answering requests to that domain automatically. - + ~~~ - $ cctrlapp APP_NAME/DEP_NAME alias + $ ironcliapp APP_NAME/DEP_NAME alias Aliases name default verified www.example.com 0 1 [...] ~~~ - + ## Removing an Alias To remove an alias, simply use the alias.remove command. ~~~ -$ cctrlapp APP_NAME/DEP_NAME alias.remove www.example.com +$ ironcliapp APP_NAME/DEP_NAME alias.remove www.example.com ~~~ ## Special Case: Wildcard Domains @@ -93,13 +94,13 @@ The alias add-on does support wildcard domains. A wildcard domain like `*.exampl To use this feature first upgrade your alias add-on from free to wildcard. ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade alias.free alias.wildcard +$ ironcliapp APP_NAME/DEP_NAME addon.upgrade alias.free alias.wildcard ~~~ Then add the wildcard domain itself as an alias. ~~~ -$ cctrlapp APP_NAME/DEP_NAME alias.add *.example.com +$ ironcliapp APP_NAME/DEP_NAME alias.add *.example.com ~~~ The TXT record requirement also applies to wildcard domains, so please follow the steps above accordingly. diff --git a/Add-on Documentation/Deployment/Codeship.md b/Add-on Documentation/Deployment/Codeship.md deleted file mode 100644 index 5f9aaef..0000000 --- a/Add-on Documentation/Deployment/Codeship.md +++ /dev/null @@ -1,42 +0,0 @@ -# Codeship: Codeship is a simple to use Continuous Integration and Deployment service. - -Whenever you make changes to your application and push your Code we take the latest version of your code, run all your tests and, if you want, push to your staging and/or production application. Test and deploy your applications without the headache of setting up your own test server. Getting started takes less than two minutes and is fully integrated with cloudControl. - -## Adding the Codeship Add-on - -To add the Codeship Add-on use the addon.add command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add codeship.OPTION -~~~ -Replace `codeship.OPTION` with a valid option, e.g. `codeship.test`. - -When added, Codeship automatically creates a new user account with your email adress. You can manage the Add-on within the [web console](https://www.cloudcontrol.com/console) (go to the specific deployment and click the link "codeship.OPTION"). - -## Upgrading the Codeship Add-on - -To upgrade from a smaller to a more powerful plan use the addon.upgrade command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade codeship.OPTION_OLD codeship.OPTION_NEW -~~~ - -## Downgrading the Codeship Add-on - -To downgrade to a smaller plan use the addon.downgrade command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade codeship.OPTION_OLD codeship.OPTION_NEW -~~~ - -## Removing the Codeship Add-on - -The Codeship Add-on can be removed from the deployment by using the addon.remove command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove codeship.OPTION -~~~ - -### Internal Access - -It's recommended to the read database credentials from the creds.json file. The location of the file is available in the `CRED_FILE` environment variable. Reading the credentials from the creds.json file ensures your app is always using the correct credentials. For detailed instructions on how to use the creds.json file please refer to the section about [Add-on Credentials](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons) in the general documentation. diff --git a/Add-on Documentation/Deployment/Cron.md b/Add-on Documentation/Deployment/Cron.md index 129d737..458693f 100644 --- a/Add-on Documentation/Deployment/Cron.md +++ b/Add-on Documentation/Deployment/Cron.md @@ -1,26 +1,36 @@ + # Cron Add-on ## What are cronjobs? -On UNIX systems [cronjobs](http://en.wikipedia.org/wiki/Cron) are commands that are periodically executed. On cloudControl however, there is no one node that the cronjob can run on. Therefore cronjobs on cloudControl are periodical calls to a URL you specify. +On UNIX systems [cronjobs](http://en.wikipedia.org/wiki/Cron) are commands that +are periodically executed. On CloudKilat however, there is no one node that +the cronjob can run on. Therefore cronjobs on CloudKilat are periodical calls +to a URL you specify. ## How does it work? -The Cron add-on allows you to call an URL in a specific interval, e.g. daily or hourly. When you add an hourly cron at 2.45pm, the next call will run at 3.45pm. For the daily Cron it would reoccur the next day at 2.45pm. The Cron add-on does not guarantee a URL is only called once per interval. +The Cron Add-on allows you to call an URL in a specific interval, e.g. daily or +hourly. When you add an hourly cron at 2.45pm, the next call will run at +3.45pm. For the daily Cron it would reoccur the next day at 2.45pm. The Cron +Add-on does not guarantee a URL is only called once per interval. -Cronjobs are regular requests against your app and are subject the the same 120s timelimit. +Cronjobs are regular requests against your app and are subject to the same 55s +timelimit. -If you need more control over when and how often tasks are run and/or have tasks that take longer than 120 seconds we recommend using the [Worker](https://www.cloudcontrol.com/add-ons/worker) or [IronWorker](https://www.cloudcontrol.com/add-ons/iron_worker) add-on. There are also the [IronMQ](https://www.cloudcontrol.com/add-ons/iron_mq) and the [CloudAMQP](https://www.cloudcontrol.com/add-ons/cloudamqp) message queues available that can be used to dispatch tasks to the workers. +If you need more control over when and how often tasks are run and/or have +tasks that take longer than 55 seconds we recommend using the +[Worker](/Add-on Documentation/Data Processing/Worker.md) Add-on. -## Adding the Cron add-on +## Adding the Cron Add-on -Before you can add a Cron job, the add-on itself has to be added: +Before you can add a Cron job, the Add-on itself has to be added: ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add cron.OPTION +$ ironcliapp APP_NAME/DEP_NAME addon.add cron.OPTION ~~~ -As always the different options are listed on the [Cron add-on](https://www.cloudcontrol.com/add-ons/cron) page. +As always the different options are listed on the [Cron Add-on](/Add-on Documentation/Deployment/Cron.md) page. ## Adding a url for the Cron job @@ -28,19 +38,20 @@ To call an URL with the specific interval you write it as the parameter: ~~~ # for the default deployment -$ cctrlapp APP_NAME/DEP_NAME cron.add http[s]://[user:password@]APP_NAME.cloudcontrolled.com +$ ironcliapp APP_NAME/default cron.add http[s]://[user:password@]APP_NAME.kilatiron.net # for any additional deployment -$ cctrlapp APP_NAME/DEP_NAME cron.add http[s]://[user:password@]DEP_NAME.APP_NAME.cloudcontrolled.com +$ ironcliapp APP_NAME/DEP_NAME cron.add http[s]://[user:password@]DEP_NAME.APP_NAME.kilatiron.net ~~~ -You can only add cron jobs calling a verified alias of the deployment. The Cron add-on supports http basic authentication. It is recommended to use https when sending credentials. Please note, https via piggyback ssl is not available for non-default deployments due to the `*.cloudcontrolled.com` wildcard certificate not being valid for `*.*.cloudcontrolled.com`. +You can only add cron jobs calling a verified alias of the deployment. It is +recommended to use https when sending credentials. ## List Cron overview Get an overview of all your Cron jobs: ~~~ -$ cctrlapp APP_NAME/DEP_NAME cron +$ ironcliapp APP_NAME/DEP_NAME cron ~~~ ## Cron details @@ -48,10 +59,10 @@ $ cctrlapp APP_NAME/DEP_NAME cron Get the details of a specific Cron job: ~~~ -$ cctrlapp APP_NAME/DEP_NAME cron CRON_ID +$ ironcliapp APP_NAME/DEP_NAME cron CRON_ID Cronjob job_id : jobkqy7rdmg - url : http://APP_NAME.cloudcontrolled.com + url : http://APP_NAME.kilatiron.net next_run : 2011-05-09 19:39:39 created : 2011-05-05 19:39:39 modified : 2011-05-05 19:39:39 @@ -62,32 +73,34 @@ Cronjob You can remove a Cron job by the job_id ~~~ -$ cctrlapp APP_NAME/DEP_NAME cron.remove JOB_ID +$ ironcliapp APP_NAME/DEP_NAME cron.remove JOB_ID ~~~ ## Upgrading / downgrading the Cron addon -In order to switch from a daily to hourly Cron or vice versa, use the up- or downgrade function +In order to switch from a daily to hourly Cron or vice versa, use the up- or +downgrade function ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade cron.free cron.hourly +$ ironcliapp APP_NAME/DEP_NAME addon.upgrade cron.free cron.hourly ~~~ or ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade cron.hourly cron.free +$ ironcliapp APP_NAME/DEP_NAME addon.downgrade cron.hourly cron.free ~~~ -Crons added with the free add-on will stay daily and crons added with the hourly add-on will stay hourly. +Crons added with the free Add-on will stay daily and crons added with the +hourly Add-on will stay hourly. -## Removing the Cron add-on +## Removing the Cron Add-on -Removing the add-on itself can be done with: +Removing the Add-on itself can be done with: ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove cron.OPTION +$ ironcliapp APP_NAME/DEP_NAME addon.remove cron.OPTION ~~~ -Please note: Removing the add-on will not automatically remove all Cron jobs. +Please note: Removing the Add-on will not automatically remove all Cron jobs. diff --git a/Add-on Documentation/Deployment/Custom Config.md b/Add-on Documentation/Deployment/Custom Config.md index 7cb85ae..70f1aae 100644 --- a/Add-on Documentation/Deployment/Custom Config.md +++ b/Add-on Documentation/Deployment/Custom Config.md @@ -1,17 +1,15 @@ # Custom Config Add-on The Custom Config Add-on allows you to add custom credentials to the standard -creds.json file provided for each of your deployments. This makes it possible for you to keep your code in separate branches, each with their own configuration settings. - -An example for where you may need such a configuration are the Amazon S3 credentials. In this case, you -likely want to use different credentials for production and development. The Custom Config Add-on allows you to do this. +creds.json file provided for each of your deployments. This makes it possible +for you to keep your code in separate branches, each with their own configuration settings. ## Adding Configuration Settings To add configuration settings, simply invoke the config command with the add option, and append the desired `key` / `value` pairs. ~~~bash -$ cctrlapp APP_NAME/DEP_NAME config.add KEY=VALUE +$ ironcliapp APP_NAME/DEP_NAME config.add KEY=VALUE ~~~ This will automatically add the Config Add-on to your deployment. @@ -21,7 +19,7 @@ be added to your deployment's cred.json file. To set multiple settings at once, simply append more than one `key` / `value` pair. ~~~bash -$ cctrlapp APP_NAME/DEP_NAME config.add KEY1=VALUE1 KEY2=VALUE2 [...] +$ ironcliapp APP_NAME/DEP_NAME config.add KEY1=VALUE1 KEY2=VALUE2 [...] ~~~ Config parameters can be set using the format shown in first column of the following table. They are then stored in JSON format, as shown in the second column. Multiline arguments can be set using the `\n` escape character. @@ -41,14 +39,14 @@ multiline values to make sure they are stored properly. You can list the existing set of configuration settings by invoking the config command: ~~~bash -$ cctrlapp APP_NAME/DEP_NAME config +$ ironcliapp APP_NAME/DEP_NAME config KEY1=VALUE1 KEY2=VALUE2 ~~~ To show the value of a specific key, simply append the desired key name: ~~~bash -$ cctrlapp APP_NAME/DEP_NAME config KEY +$ ironcliapp APP_NAME/DEP_NAME config KEY VALUE ~~~ @@ -57,20 +55,20 @@ VALUE To add or remove settings to your custom config, simply use the `add` or `remove` option of the config command and append the parameters you need. ~~~bash -$ cctrlapp APP_NAME/DEP_NAME config.add [-f|--force] NEW_PARAM=NEW_VALUE [...] -$ cctrlapp APP_NAME/DEP_NAME config.remove PARAM1 PARAM2 [...] +$ ironcliapp APP_NAME/DEP_NAME config.add [-f|--force] NEW_PARAM=NEW_VALUE [...] +$ ironcliapp APP_NAME/DEP_NAME config.remove PARAM1 PARAM2 [...] ~~~ Updating the existing settings is also possible using the `add` command. This will require your confirmation unless you use the `-f` or `--force` flag after the add command. -## Removing the Config Addon +## Removing the Config Add-on Deleting all the existing configuration settings from a deployment can be done by removing the Add-on. ~~~bash -$ cctrlapp APP_NAME/DEP_NAME addon.remove config.free +$ ironcliapp APP_NAME/DEP_NAME addon.remove config.free ~~~ This will remove all the custom configuration settings. diff --git a/Add-on Documentation/Deployment/Logentries.md b/Add-on Documentation/Deployment/Logentries.md deleted file mode 100644 index 5d012ac..0000000 --- a/Add-on Documentation/Deployment/Logentries.md +++ /dev/null @@ -1,33 +0,0 @@ -# Logentries - -[Logentries](https://logentries.com) provides logs collection, analysis, storage and presentation in a professional and meaningful way. - -## Adding Logentries -The Logentries Add-On can be added to every deployment with: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add logentries.PLAN -~~~ - -When added, Logentries automatically creates a new account and log configuration including access token. After Add-on creation all stdout, stderr and syslog output within the container will be available in Logentries. You can access Logentries for your deployment within the [web console](https://www.cloudcontrol.com/console) (go to the specific deployment, choose "Add-Ons" tab and click Logentries login). - -## Removing Logentries - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove logentries.PLAN -~~~ - -## Internal access credentials - -You can view Logentries token via: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon logentries.PLAN -~~~ - -~~~ -Addon : logentries.PLAN - - Settings - LOGENTRIES_TOKEN : 10af1a9e-112c-4075-88c9-e06412f0cd8e -~~~ \ No newline at end of file diff --git a/Add-on Documentation/Deployment/Phrase.md b/Add-on Documentation/Deployment/Phrase.md deleted file mode 100644 index ee260ad..0000000 --- a/Add-on Documentation/Deployment/Phrase.md +++ /dev/null @@ -1,192 +0,0 @@ -# Phrase # - -phrase allows you to edit your translations directly on your site without having to manually edit localization files. This makes your whole translation process easy as pie. Use the in-place editor to translate content directly on your site or manage your translations with the powerful phrase Translation Center. - - -## Provisioning the add-on - -phrase can be attached to CloudControl via the command line client: - - $ cctrlapp APP_NAME/DEP_NAME addon.add phrase.PLAN - - -Once the add-on has been provisioned the `PHRASE_AUTH_TOKEN` will be available within your list of credentials. It contains your authentication token that lets you connect to the phrase service: - - $ cctrlapp APP_NAME/DEP_NAME addon | grep PHRASE_AUTH_TOKEN - PHRASE_AUTH_TOKEN: d219d3abcgcxBahs72K1 - - -## Installation and Usage - -phrase should be integrated in an own staging environment. If you haven't done so already, we recommend you set up a staging environment as explained in the [CloudControl Documentation](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#development-staging-and-production-environments). The staging environment will be the place for your translators to edit your website content. -Of course, you can use your local development environment for integration as well. If you decide to do so, simply replace the staging with your development environment in the following steps. - -If you have any questions, contact us at [info@phraseapp.com](info@phraseapp.com) and we will be happy to guide you through the installation process. - - -### phrase command line tool ### - -Developers typically access phrase with the [phrase ruby gem](https://rubygems.org/gems/phrase) via command line: - - gem install phrase - -You are now able to use phrase to upload translations to the API and export new translation files form phrase as described in the next sections. - - -### Using with Symfony2 - -Simply follow the instructions from our documentation: [phraseapp.com/docs/installation/symfony2](https://phraseapp.com/docs/installation/symfony2) - - -### Using with Ruby / Rails / Sinatra - -*The following integration guide assumes your application uses bundler for gem dependency management.* - - -#### Add the gem - -Add the phrase gem to your staging environment: - - group :development, :staging do - gem 'phrase' - end - -and install the gem with the bundle command: - - $ bundle install - - -#### Initialize phrase - -First you need to enable phrase within your application and provide the authentication token. You can do this by adding the following two lines to an initializer (Rails) or in your main application file: - - Phrase.enabled = true - Phrase.auth_token = ENV['PHRASE_AUTH_TOKEN'] - -If you are using Sinatra, you might have to require phrase in your app file: - - if ENV['RACK_ENV'] == 'staging' - require "phrase" - end - -This will load phrase when you start your application in staging environment. - -Now initialize phrase with the auth token you received after adding the phrase add-on to your application: - - $ bundle exec phrase init --secret=YOUR_AUTH_TOKEN --default-locale=en - -This will generate a .phrase config file in your project root that includes your secret key. We recommend adding it to your .gitignore file. - -Next, upload the existing locale files from your app: - - $ bundle exec phrase push ./config/locales/ - -phrase now knows about your locales and the keys in your application. To enable the phrase in-place editor, simply add the javascript to your application layout file: - - - -In order to tell the i18n gem about the new locales that should be used in production you have to configure the load path as well. When using Rails you can set the load path in your production.rb: - - config.i18n.load_path = Dir[Rails.root.join('phrase', 'locales', '*.yml').to_s] - -If you're using Sinatra or something similar, you probably want to set it in the config.ru file: - - if ENV['RACK_ENV'] == 'production' - I18n.load_path = Dir[File.join(File.dirname(__FILE__), 'phrase', 'locales', '*.yml').to_s] - else - I18n.load_path = Dir[File.join(File.dirname(__FILE__), 'config', 'locales', '*.yml').to_s] - end - - -#### Deploy application to staging environment - -To finally get a look at phrase you simply have to deploy the application to your staging system and open it in the browser. - -You now should see your application with the phrase in-place editor on top of it. To create your first user with translation privileges, you have to log into phrase by following the "Login" link in your add-on management panel. - -After logging in, you can access the user management under the "Account" menu. Simply create a user with an email address and password of your choice. You can now edit your text content right on the site! - - -#### Deploy translations - -After you have finished translating your site, you will need to push the new translation files to production. In order to do so, you will first have to download them from phrase and add them to your project: - - $ bundle exec phrase pull - $ git add ./phrase/locales - $ git commit -m "added new translations" - -Now you can push the changes to your production repository: - - $ cctrlapp APP_NAME/DEP_NAME push - $ cctrlapp APP_NAME/DEP_NAME deploy - -The production system will now use the new locale files including your latest translations! - - -### Using with other platforms - -If you need support for a platform or language that is not yet supported just contact us at [info@phraseapp.com](info@phraseapp.com) - - -## Workflow - -With phrase your translation workflow will get much easier: - -1. Add a new feature to your app that requires translation -2. Add the new keys to phrase by uploading the locale files to phrase or creating them manually within the translation center -3. Deploy your new code to your staging environment and let your translators do their work -4. Download the new locale files from phrase and deploy them to production - - -## Translation Center - -Translation Center lets you manage: - -* Locales -* Keys -* Translations -* Users -* etc. - -To log in to Translation Center, view your add-on settings within your CloudControl console and follow the "Login" link next to the phrase addon. This will perform the sign in to phrase where you can manage your account, users, locales and more. - -*For more information on the features available within the phrase translation center please see the feature tour at [phraseapp.com/features](https://phraseapp.com/features).* - - -## Removing the add-on - -phrase can be removed via the command line client: - - $ cctrlapp APP_NAME/DEP_NAME addon.remove phrase.PLAN - -**Warning:** This will destroy all data associated with your phrase account and cannot be undone! - - -## Other platforms and languages - -phrase supports all common localization formats, including YAML, JSON, Gettext (.po), Properties, XLIFF, Android, iOS, ResX etc. - -You can always access your localization files and translations from within Translation Center. - -If you need support for a platform or language that is not yet supported just contact us at [info@phraseapp.com](info@phraseapp.com) - - -## Support - -If you have any questions regarding phrase, feel free to contact us at [phraseapp.com/support](https://phraseapp.com/support). - - -## Additional resources - -Additional resources are available at: - -* [Example application using Sinatra](https://github.com/phrase/phrase_example_cloudcontrol_app) -* [Support](https://phraseapp.com/support) -* [Full documentation](https://phraseapp.com/docs) diff --git a/Add-on Documentation/Deployment/SSL.md b/Add-on Documentation/Deployment/SSL.md index 28bd4f3..9c01304 100644 --- a/Add-on Documentation/Deployment/SSL.md +++ b/Add-on Documentation/Deployment/SSL.md @@ -9,11 +9,11 @@ Overview: Secure Socket Layer (SSL) encryption is available for improved security when transmitting passwords and other sensitive data. -As part of the provided `.cloudcontrolled.com` subdomain, all deployments have -access to piggyback SSL using a `*.cloudcontrolled.com` wildcard certificate. +As part of the provided `.kilatiron.net` subdomain, all deployments have +access to piggyback SSL using a `*.kilatiron.net` wildcard certificate. To use this, simply point your browser to: -* `https://APP_NAME.cloudcontrolled.com` for the default deployment -* `https://DEP_NAME-APP_NAME.cloudcontrolled.com` for non-default deployments +* `https://APP_NAME.kilatiron.net` for the default deployment +* `https://DEP_NAME-APP_NAME.kilatiron.net` for non-default deployments Please note the **dash** between DEP_NAME and APP_NAME. @@ -160,65 +160,24 @@ in PEM format. To add the SSL Add-on, simply provide the paths to the files provided by the certificate authority using the respective parameters of the addon.add command. ~~~ - $ cctrlapp APP_NAME/DEP_NAME addon.add ssl.host --cert path/to/CERT_FILE --key path/to/KEY_FILE --chain path/to/CHAIN_FILE + $ ironcliapp APP_NAME/DEP_NAME addon.add ssl.host --cert path/to/CERT_FILE --key path/to/KEY_FILE [--chain path/to/CHAIN_FILE] ~~~ In order to check the status of the Add-on, you can do the following. ~~~ - $ cctrlapp APP_NAME/DEP_NAME addon ssl.host + $ ironcliapp APP_NAME/DEP_NAME addon ssl.host Addon : ssl.host Settings SSLDEV_CERT_EXPIRES : 2016-01-01 10:00:00 - SSLDEV_DNS_DOMAIN : addonssl-depxxxxxxxx-1234567890.eu-west-1.elb.amazonaws.com + SSLDEV_DNS_DOMAIN : snip.app.exo.com SSLDEV_CERT_INCEPTS : 2013-01-01 10:00:00 ~~~ -When the SSL certificate is expired, you can update it by removing the Add-on -and re-adding it, providing the updated certificate. The SSL service is provided -for 23 minutes after removing the Add-on so that it can be updated in the -meantime without interrupting the service. To achieve that you have to run the -following commands: - ~~~ - $ cctrlapp APP_NAME/DEP_NAME addon.remove ssl.host - $ cctrlapp APP_NAME/DEP_NAME addon.add ssl.host --cert path/to/NEW_CERT_FILE --key path/to/KEY_FILE --chain path/to/CHAIN_FILE - ~~~ - -Note: You need to provide the original key and chain again when updating the -Add-on even if those are not changed. - -## HTTPS Redirects - -HTTPS termination is done at the routing tier. Requests are then routed via -HTTP to one of your app's clones. To determine if a request was made via HTTPS -originally, the routing tier sets the `X-FORWARDED-PROTO` header to `https`. -The header is only set for requests that arrived via HTTPS at the routing tier. -This allows you to redirect accordingly. - -### PHP Example - -For PHP you can either redirect via Apache's mod_rewrite using a `.htaccess` -file or directly in your PHP code. - -#### .htaccess -~~~ - - RewriteEngine On - RewriteCond %{HTTP:X-FORWARDED-PROTO} !=https [NC] - RewriteRule ^.*$ https://%{HTTP_HOST} - -~~~ - -#### PHP -~~~php - -~~~ +If you want to exchange your certificate (e.g. because it is about to expire), +you can upload the new certificate with the following command: + ~~~ + $ ironcliapp APP_NAME/DEP_NAME addon.upgrade ssl.host ssl.host --cert path/to/NEW_CERT_FILE --key path/to/KEY_FILE [--chain path/to/CHAIN_FILE] + ~~~ + +Note: If the new certificate has the same chain file, you still need to pass it again. diff --git a/Add-on Documentation/Deployment/Userbin.md b/Add-on Documentation/Deployment/Userbin.md deleted file mode 100644 index 27eaef0..0000000 --- a/Add-on Documentation/Deployment/Userbin.md +++ /dev/null @@ -1,333 +0,0 @@ -# Userbin - - -[Userbin](https://userbin.com) is the easiest way to setup, use and maintain a secure user authentication system for both your web and mobile apps, while keeping the users in your own database. - -Userbin provides a set of login, signup, and password reset forms that drop right into your application without any need of styling or writing markup. Connect your users via traditional logins or third party social networks. We take care of linking accounts across networks, resetting passwords and sending out necessary emails, while keeping everything safe and secure. - - - -## Adding the Userbin add-on -To add the Userbin add-on use the addon.add command. - -```bash -$ cctrlapp APP_NAME/DEP_NAME addon.add userbin.PLAN -``` - -Replace `userbin.PLAN` with a valid plan, e.g. `userbin.free`. - -When added, Userbin automatically creates a new account for you. You can access Userbin for your deployment within the [web console](https://www.cloudcontrol.com/console) (go to the specific deployment, choose "Add-Ons" tab and click Userbin login). - - -## Using with Ruby on Rails - - -### Installation and configuration - -Add the `userbin` gem to your `Gemfile` - -```ruby -gem "userbin" -``` - -Install the gem - -```bash -bundle install -``` - -Create `config/initializers/userbin.rb` and configure your credentials. - -```ruby -Userbin.configure do |config| - config.app_id = "YOUR_APP_ID" - config.api_secret = "YOUR_API_SECRET" -end -``` - -> If you don't configure the `app_id` and `api_secret`, the Userbin module will read the `USERBIN_APP_ID` and `USERBIN_API_SECRET` environment variables. - -Implement getter and setter for your user model. For more information about the available attributes in the profile see the [Userbin profile](https://userbin.com/docs/profile) documentation. - -```ruby -config.find_user = -> (userbin_id) do - User.find_by_userbin_id(userbin_id) -end - -# will be called when a user signs up -config.create_user = -> (profile) do - User.create! do |user| - user.userbin_id = profile.id - user.email = profile.email - user.photo = profile.image - end -end -``` - -Migrate your users to include a reference to the Userbin profile: - -```bash -rails g migration AddUserbinIdToUsers userbin_id:integer:index -rake db:migrate -``` - - -### Authenticating users - -Userbin keeps track of the currently logged in user which can be accessed through `current_user` in controllers, views, and helpers. This automatically taps into libraries such as the authorization library [CanCan](https://github.com/ryanb/cancan). - -```erb -<% if current_user %> - <%= current_user.email %> -<% else %> - Not logged in -<% end %> -``` - -To set up a controller with user authentication, just add this `before_filter`: - -```ruby -class ArticlesController < ApplicationController - before_filter :authorize! - - def index - current_user.articles - end -end -``` - -> You can always access the [Userbin profile](https://userbin.com/docs/profile) for the logged in user as `current_profile` when you need to access information that you haven't persisted in your user model. - - - -## Using with Node.js - -### Installation and configuration - -Install the `userbin` package. - -```bash -$ npm install userbin -``` - -Include the Userbin node packages in your app.js or server.js. - -```javascript -var userbin = require('userbin'); -``` - -Configure the Userbin module with the credentials you got from signing up. - -```javascript -userbin.config({ - appId: 'YOUR_APP_ID', - apiSecret: 'YOUR_API_SECRET' -}); -``` - -> If you don't configure the `appId` and `apiSecret`, the Userbin module will read the `USERBIN_APP_ID` and `USERBIN_API_SECRET` environment variables. - -Insert the Userbin authentication middleware after the cookieParser (and add the cookieParser if not present): - -```javascript -app.use(connect.cookieParser()); // or express.cookieParser() -app.use(userbin.authenticate()); -``` - -Implement getter and setter for your user model. For more information about the available attributes in the profile see the [Userbin profile](https://userbin.com/docs/profile) documentation. - -```javascript -userbin.config({ - findUser: function(userbinId, done) { - User.findOne({ userbinId: userbinId }, function(err, user) { - done(user); - }); - }, - - createUser: function(profile, done) { - var user = User.new({ - userbinId : profile.id, - email : profile.email, - photo : profile.image - }); - user.save(function(err, user) { - done(user); - }); - } -}) -``` - - -### Authenticating users - -Userbin keeps track of the currently logged in user which can be accessed in your controllers and views through the `req.currentUser` property which needs to be explicitly passed to your views. - -Insert the `userbin.authorize()` middleware to protect a route fron non-logged in users. - -```javascript -app.get('/account', userbin.authorize(), function(req, res) { - res.render('account', {currentUser: req.currentUser}); -}); -``` - -> You can always access the [Userbin profile](https://userbin.com/docs/profile) for the logged in user as `req.currentProfile` when you need to access information that you haven't persisted in your user model. - - - -## Using with PHP - -### Installation and configuration - -Download Userbin into your project: - -```bash -$ curl -O https://raw.github.com/userbin/userbin-php/master/userbin.php -``` - -All you need to is to include `userbin.php` at the top of your files, configure it with you App ID and API secret, and finally run the Userbin authentication sync. The `authenticate` method will make sure that the user session is refreshed when it expires. - -> If you're not using [output buffering](http://php.net/manual/en/book.outcontrol.php) this needs to be done before any output has been written since Userbin will modify headers. - -```php - -``` - -Include [Userbin.js](https://userbin.com/js/v0) at the bottom of all your web pages to enable form helpers and session handling. - -```php - ... - - - -``` - - -### Authenticating users - -Userbin keeps track of the currently logged in user: - -```php - - - Welcome to your account, - - Not logged in - -``` - -Put the `authorize` method at the top of a file to halt the execution and render a login page if the user is not logged in: - -```php - -``` - -> You can always access the [Userbin profile](https://userbin.com/docs/profile) for the logged in user as `Userbin::current_profile()` when you need to access information that you haven't persisted in your user model. - - -## Using with mobile - -Please see the documentation for [iOS](https://userbin.com/docs/ios) and [Android](https://userbin.com/docs/android) on how to get started with Userbin in mobile apps. - -## Forms - -Once you have set up authentication it's time to choose among the different ways of integrating Userbin into your application. - -### Ready-made forms - -The easiest and fastest way to integrate login and signup forms is to use the Userbin Widget, which provides a set of ready-made views which can be customized to blend in with your current user interface. These views open up in a popup, and on mobile browsers they open up a new window tailored for smaller devices. - -`rel` specifies action; possible options are `login` and `logout`. - -```html -Log in -Sign up -``` - -### Social buttons - -Instead of signing up your users with a username and password, you can offer them to connect with a social identity like Facebook or LinkedIn. To use these button you must first configure your social identiy providers from the [dashboard](https://userbin.com/dashboard). It is also possible to connect a social identity to an already logged in user and the two accounts will be automatically linked. - -`rel` determines action. If the user didn't exist before, it's created, otherwise it's logged in. - -```html -Connect with Facebook -Connect with LinkedIn -``` - -### Custom forms - -The ready-made forms are fairly high level, so you might prefer to use Userbin with your own markup to get full control over looks and behavior. - -If you create a form with `name` set to `login` or `signup`, the user will be sent to the URL specified by `action` after being successfully processed at Userbin. - -Inputs with name `email` and `password` are processed, others are ignored. - -If you add an element with the class `error-messages`, it will be automatically set to `display: block` and populated with a an error message when something goes wrong. So make sure to it is `display: hidden` by default. - -```html -
- -
- - -
-
- - -
- -
-``` - -### Log out - -Clears the session and redirects the user to the specified URL. - -```html -Log out -``` - - -## Dashboard - -With Userbin you get an admin dashboard out of the box. - -- Invite, update, remove and ban users -- Log in as any of your users for debugging -- Configure user validation, access rights and login methods -- See who is using your web or mobile app in real-time. -- Customize copy and appearance of your transactional emails. - - -## Removing Userbin - -```bash -$ cctrlapp APP_NAME/DEP_NAME addon.remove userbin.PLAN -``` - -## Internal access credentials - -You can view your Userbin crendentials via: - -```bash -$ cctrlapp APP_NAME/DEP_NAME addon userbin.PLAN -``` - -```bash -Addon : userbin.PLAN - - Settings - USERBIN_APP_ID : 689751686362727 - USERBIN_API_SECRET : P1pBdtjAJvQP7qsqz5zrLC1pDCxBJqFw -``` - -## Support & feedback - -Any non-support related issues or product feedback is welcome by [email](mailto:support@userbin.com). diff --git a/Add-on Documentation/Deployment/Usersnap.md b/Add-on Documentation/Deployment/Usersnap.md deleted file mode 100644 index b0e4053..0000000 --- a/Add-on Documentation/Deployment/Usersnap.md +++ /dev/null @@ -1,264 +0,0 @@ -# Usersnap -[Usersnap](https://usersnap.com/?gat=cloudcontrol) is an [add-on](https://www.cloudcontrol.com/add-ons/usersnap) -to allow your users to give visual feedback in a comfortable and easy way: -directly in their browser. - -Stop wasting time trying to understand unclear bug reports. Screenshots with -comments from your users and testers delivered directly to your bug tracker -help you to fix problems faster and speed up your development cycle. -Understand the reported issues immediately by seeing it. Usersnap -reduces expensive communication overhead significantly. - -Usersnap integrates seamlessly with your existing Bug Tracker and causes -no switching costs. Connect Usersnap with one of our supported tools and -you will get issue reports in a familiar place. - -[Learn more about all supported tools](https://usersnap.com/doc/connect) -Usersnap provides simple and yet powerful tools which allow anybody to -report bugs and issues. All bug reports contain additional information -such as the used browser and the source URL of the screenshot making it -easy to reproduce the reported issues. -[Learn more about Usersnap's features](https://usersnap.com/support/docs/javascript#tools). - -## Adding or removing the Usersnap Add-on -The Add-on comes in different sizes and prices. It can be added by -executing the command addon.add: -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add usersnap.OPTION -~~~ - -".option" represents the plan size, e.g. usersnap.premium. - -You can add initial settings during this process using optional command line parameters: -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add usersnap.OPTION \ - [--targeturls=http://your-website.com,http://your-website-alias.com] \ - [--targetmails=contact@your-mail.com,user1@your-mail.com] \ - [--senderemail=noreply@usersnap.com] \ - [--subject="[Usersnap] New Usersnap feedback"] -~~~ - + __targeturls__ (comma-separated, optional - default: configured domains for your cloud control app): Specify the list of URLs on which you intend to use Usersnap. - + __targetmails__ (comma-separated, optional - default: cloud control account owner email): You can add one or more email addresses as recipients for Usersnap screenshots. - + __senderemail__ (optional - default: "noreply@usersnap.com"): If you plan to deliver Usersnap reports to a ticketing system via email, you can change the sender address to your needs. - + __subject__ (optional - default: "[Usersnap] New Usersnap feedback"): Particularly useful if you want to create an email filter to organize your screenshots. - - -Once Usersnap has been added, a `USERSNAP_APIKEY` setting will be available inside the `CRED_FILE` under the `USERSNAP` key. This will contain the API key to be used in the [Usersnap snippet](https://usersnap.com/support/docs/install). - -You can confirm a valid setup using: -~~~ -cctrlapp APPNAME/DEPLOYMENTNAME addon.creds -~~~ - -After installing Usersnap the application should be configured to fully integrate with the addon. - -## Upgrade the Usersnap Add-on -Upgrading to another option can easily be done: -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade usersnap.OPTION_OLD usersnap.OPTION_NEW -~~~ -## Downgrade the Usersnap Add-on -Downgrading to another option can easily be done: -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade usersnap.OPTION_OLD usersnap.OPTION_NEW -~~~ -## Removing the Usersnap Add-on -Similarily, an Add-on can also be removed from the deployment easily. The costs only apply for the time the Add-on was active: -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove usersnap.OPTION -~~~ -## Add-on credentials -The access credentials for the Usersnap snippet are stored in the key `USERSNAP` / `USERSNAP_APIKEY` inside the `CRED_FILE`. - -It's recommended to read the Usersnap API key from the creds.json file. The location of the file is available in the `CRED_FILE` environment variable. Reading the credentials from the creds.json file ensures your app is always using the correct credentials. For detailed instructions on how to use the creds.json file please refer to the section about Add-on Credentials in the general documentation. - -Usersnap can be integrated easily to any type of web page. The Usersnap [support page](https://usersnap.com/support) offers an overview of [how to integrate Usersnap](https://usersnap.com/support/docs/install) in your site via a simple JavaScript snippet. - -On CloudControl, one even doesn't have to take care of the API key because it is accessible via the `CRED_FILE` as mentioned above. - -Provisioning Usersnap sets up a default email subscription for screenshots. To set up more advanced delivery methods just use the add-on's administration interface. You can open it in the resources view of your app. One single click on the Usersnap add-on opens the configuration view. - -## Install Usersnap to your Web App -Usersnap works with every web project, regardless of the backend language. -All you need to do is include the [Usersnap JavaScript code](https://usersnap.com/configurator) right before -the closing `` tag of your main template. - - -### Example for PHP web sites -Include this snippet in your base template, right before the closing `` -tag (you can easily configure the snippet to your needs with the -[Usersnap Configurator](https://usersnap.com/configurator)): - -```php - - - - - -``` -You can learn more about getting addon credentials with PHP in the -[cloudControl Add-On-Credentials Doc](https://www.cloudcontrol.com/dev-center/Guides/PHP/Add-on%20credentials). - -### Example for Python web sites (Example for mako templates) -Include this snippet in your base template, right before the closing `` -tag (you can easily configure the snippet to your needs with the -[Usersnap Configurator](https://usersnap.com/configurator)): - -```python -<% -import os -import json - -apikey = "" -try: - cred_file = open(os.environ['CRED_FILE']) - creds = json.load(cred_file) - apikey = creds.get("USERSNAP", {}).get("USERSNAP_APIKEY", ""); -except IOError: - print "Could not open the creds.json file!" - -%> - - - - -``` - -You can learn more about getting addon credentials with Python in the -[cloudControl Add-On-Credentials Doc](https://www.cloudcontrol.com/dev-center/Guides/Python/Add-on%20credentials). - -### Example for Ruby on Rails websites -Include this snippet in your base template, right before the closing `` -tag (you can easily configure the snippet to your needs with the -[Usersnap Configurator](https://usersnap.com/configurator)): - -```ruby -<% -require 'json' -apikey = "" -begin - cred_file = File.open(ENV["CRED_FILE"]).read - creds = JSON.parse(cred_file)["USERSNAP"] - apikey = creds["USERSNAP_APIKEY"] -rescue - puts "Could not open the creds.json file" -end -%> - - - - -``` - -Tip: Save this snippet in a file named `_usersnap.html.erb` and you can include -it in other templates by adding this line to your main template: - -```ruby -<%= render :partial => "usersnap" %> -``` - - -You can learn more about getting addon credentials with Ruby in the -[cloudControl Add-On-Credentials Doc](https://www.cloudcontrol.com/dev-center/Guides/Ruby/Add-on%20credentials). - -### Example for Java, NodeJS and all other web languages -Include this snippet in your base template, right before the closing `` tag -(you can easily configure the snippet to your needs with the -[Usersnap Configurator](https://usersnap.com/configurator)): - -```html - - - -``` - -Make sure to replace `YOUR-APIKEY-HERE` with the addon credential value stored in the `USERSNAP.USERSNAP_APIKEY` -option. [How to get add on credentials in cloudControl](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons). - -## Support -If you need help installing the [Usersnap addon](https://www.cloudcontrol.com/add-ons/usersnap) -or you have further questions, please get in touch with the [Usersnap team](https://usersnap.com/support). - diff --git a/Add-on Documentation/Messaging & Mobile/46elks.md b/Add-on Documentation/Messaging & Mobile/46elks.md deleted file mode 100644 index eeb9943..0000000 --- a/Add-on Documentation/Messaging & Mobile/46elks.md +++ /dev/null @@ -1,28 +0,0 @@ -# 46elks (Beta) - -46elks is a cloud communications platform. Use it to integrate SMS and phone call features into your applications. - -## Adding the 46elks Add-on - -The 46elks Add-on can be added to every deployment with: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add 46elks.free -~~~ - -## Getting started - -In order to use the 46elks addon, you need to create a [46elks account](http://www.46elks.com/registration). - -Then, head over to the [46elks documentation](http://www.46elks.com/docs) and read about how you can send SMS, make automated phone calls, build IVR menus and more! - -## Examples - -Check out the [46elks samples](http://www.46elks.com/samples). - -## Removing 46elks Add-on - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove 46elks.free -~~~ - diff --git a/Add-on Documentation/Messaging & Mobile/CloudMailin.md b/Add-on Documentation/Messaging & Mobile/CloudMailin.md deleted file mode 100644 index 2114a44..0000000 --- a/Add-on Documentation/Messaging & Mobile/CloudMailin.md +++ /dev/null @@ -1,55 +0,0 @@ -# CloudMailin - -CloudMailIn allows you to receive any volume of incoming email via a Webhook. You are given an email address that will forward any incoming message to your app, as an HTTP POST request, within milliseconds. You can also seamlessly check the delivery status of each of your incoming emails via the dashboard, bounce emails that you do not wish to receive and use your own domain name. - -## Adding CloudMailin - -CloudMailin can be added to every deployment with: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add cloudmailin.OPTION -~~~ - -## Upgrade CloudMailin - -Upgrading to another version of CloudMailin is easily done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade cloudmailin.OPTION_OLD cloudmailin.OPTION_NEW -~~~ - -## Downgrade CloudMailin - -Downgrading to another version of CloudMailin is easily done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade cloudmailin.OPTION_OLD cloudmailin.OPTION_NEW -~~~ - -## Removing CloudMailin - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove cloudmailin.OPTION -~~~ - -## Internal Access Credentials - -It's recommended to the read database credentials from the creds.json file. The location of the file is available in the `CRED_FILE` environment variable. Reading the credentials from the creds.json file ensures your app is always using the correct credentials. For detailed instructions on how to use the creds.json file please refer to the section about [Add-on Credentials](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons) in the general documentation. - -The JSON file has the following structure: - -~~~ -{ - "CLOUDMAILIN":{ - "CLOUDMAILIN_SECRET":"12341337asdf1335asdfqwert", - "CLOUDMAILIN_USERNAME":"depxasdfqwert@cloudcontrolled.com", - "CLOUDMAILIN_PASSWORD":"1337asdf1234", - "CLOUDMAILIN_FORWARD_ADDRESS":"12345asdf73@cloudmailin.net" - } -} -~~~ - -## CloudMailin Code Example - -You will find an example on how to use CloudMailIn within your app at [Github](https://github.com/cloudControl/CloudMailInAddonUsage). - diff --git a/Add-on Documentation/Messaging & Mobile/Mailgun.md b/Add-on Documentation/Messaging & Mobile/Mailgun.md deleted file mode 100644 index 8c0bf40..0000000 --- a/Add-on Documentation/Messaging & Mobile/Mailgun.md +++ /dev/null @@ -1,197 +0,0 @@ -# Mailgun - -Mailgun is a complete email platform: optimized outbound message delivery, inbound email push into your app, real time email analytics and more. - -## Adding Mailgun - -Mailgun can be added to every deployment with: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add mailgun.OPTION -~~~ - -## Internal access credentials - -It's recommended to the read database credentials from the creds.json file. The location of the file is available in the `CRED_FILE` environment variable. Reading the credentials from the creds.json file ensures your app is always using the correct credentials. For detailed instructions on how to use the creds.json file please refer to the section about [Add-on Credentials](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons) in the general documentation. - -The JSON file has the following structure: - -~~~ -{ - "MAILGUN":{ - "MAILGUN_SMTP_LOGIN":"postmaster@cloud.mailgun.org", - "MAILGUN_SMTP_SERVER":"smtp.mailgun.org", - "MAILGUN_SMTP_PORT":"587", - "MAILGUN_SMTP_PASSWORD":"1337asdf1337ASDF", - "MAILGUN_API_KEY":"key-12341337ASDF345567-qwert13373" - } -} -~~~ - -## Upgrade Mailgun - -Upgrading to another version of Mailgun is easily done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade mailgun.OPTION_OLD mailgun.OPTION_NEW -~~~ - -## Downgrade Mailgun - -Downgrading to another version of Mailgun is easily done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade mailgun.OPTION_OLD mailgun.OPTION_NEW -~~~ - -## Removing Mailgun - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove mailgun.OPTION -~~~ - -## Mailgun Code Example - -Here is an example on how to use Mailgun in a Zend setup. - -## Step 1: Installing Zend - -Let's use the [Zend framework](http://framework.zend.com/download/latest) to send our first mail. This example assumes that you've downloaded and extracted it to the vendor folder inside the main directory - so you should get similar output if you use *nix: - -~~~ -$ cd ~/cctrl_tutorial_app/ -$ ~/cctrl_tutorial_app: ls vendor/Zend/ -Acl Cache Crypt Dojo Form Layout Log.php Mime.php Pdf Search Test Validate -~~~ - -To make Zend usable, we need to add the vendor folder to the PHP search path of our application: - -~~~ - -~~~ - -## Step 2: Getting access to Mailgun credentials - -When you install the addon, Mailgun populates your app environment with the access credentials. Here's how you access them from the source code: - -~~~ -< -// Parse the json file with ADDONS credentials -$string = file_get_contents($_ENV['CRED_FILE'], false); -if ($string == false) { - die('FATAL: Could not read credentials file'); -} - -$creds = json_decode($string, true); -> -~~~ - -## Step 3: Configure Zend to use Mailgun by default - -~~~ - 'tls', - 'port' => $creds['MAILGUN']['MAILGUN_SMTP_PORT'], - 'auth' => 'login', - 'username' => $creds['MAILGUN']['MAILGUN_SMTP_LOGIN'], - 'password' => $creds['MAILGUN']['MAILGUN_SMTP_PASSWORD']); - -$transport = new Zend_Mail_Transport_Smtp($creds['MAILGUN']['MAILGUN_SMTP_SERVER'], $config); -Zend_Mail::setDefaultTransport($transport); -?> -~~~ - -## Step 4: Send! - -~~~ -setBodyText('This is the text of the mail.'); -$mail->setFrom('somebody@yourdomain.com', 'Some Sender'); -$mail->addTo('klizhentas@gmail.com', 'Some Recipient'); -$mail->setSubject('TestSubject'); -$mail->send(); -?> -~~~ - -## Putting it all together - -~~~ - 'tls', - 'port' => $creds['MAILGUN']['MAILGUN_SMTP_PORT'], - 'auth' => 'login', - 'username' => $creds['MAILGUN']['MAILGUN_SMTP_LOGIN'], - 'password' => $creds['MAILGUN']['MAILGUN_SMTP_PASSWORD']); - -$transport = new Zend_Mail_Transport_Smtp($creds['MAILGUN']['MAILGUN_SMTP_SERVER'], $config); -Zend_Mail::setDefaultTransport($transport); - -// Here we go, now you can send -$mail = new Zend_Mail(); -$mail->setBodyText('This is the text of the mail.'); -$mail->setFrom('somebody@yourdomain.com', 'Some Sender'); -$mail->addTo('klizhentas@gmail.com', 'Some Recipient'); -$mail->setSubject('TestSubject'); -$mail->send(); -?> -~~~ - -Read more on sending in Mailguns [documentation](http://documentation.mailgun.net/user_manual.html#sending-messages). - -## Receiving Emails -There are two ways to handle incoming messages using Mailgun: - -* Forward incoming messages using Routes to a URL or to another email address. -* Store incoming messages in Mailboxes. - -In other words, Mailgun can POST each incoming message to your application as if someone submitted a form with email contents. This is particularly appealing because message content comes in as UTF-8, signature and quoted content are extracted, attachments arrive as file uploads. - -Here's the simple script in PHP that shows how to process an incoming message posted by Mailgun: - -~~~ - -~~~ - -Read more on receiving messages [here](http://documentation.mailgun.net/user_manual.html#receiving-messages). - diff --git a/Add-on Documentation/Messaging & Mobile/SendGrid.md b/Add-on Documentation/Messaging & Mobile/SendGrid.md deleted file mode 100644 index e767269..0000000 --- a/Add-on Documentation/Messaging & Mobile/SendGrid.md +++ /dev/null @@ -1,55 +0,0 @@ -# Sendgrid - -Sendgrid's cloud-based email infrastructure relieves businesses of the cost and complexity of maintaining custom email systems. - -## Adding Sendgrid - -The Sendgrid Add-on can be added to every deployment with: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add sendgrid.OPTION -~~~ - -When added, Sendgrid automatically creates a new user account with your email adress. You can manage your sendgrid Add-on easily within the web console (go to the specific deployment and click the link "sendgrid.OPTION"). - -## Upgrade Sendgrid - -Upgrading to another version of Sendgrid is easily done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade sendgrid.OPTION_OLD sendgrid.OPTION_NEW -~~~ - -## Downgrade Sendgrid - -Downgrading to another version of Sendgrid is easily done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade sendgrid.OPTION_OLD sendgrid.OPTION_NEW -~~~ - -## Removing Sendgrid - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove sendgrid.OPTION -~~~ - -Once you added a SendGrid plan, you need to login once at http://sendgrid.com with your Add-on credentials (see below) and complete their setup wizard to activate your account. For additional information please visit the SendGrid documentation. - -# Add-on credentials - -## Internal access credentials - -It's recommended to the read database credentials from the creds.json file. The location of the file is available in the `CRED_FILE` environment variable. Reading the credentials from the creds.json file ensures your app is always using the correct credentials. For detailed instructions on how to use the creds.json file please refer to the section about [Add-on Credentials](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons) in the general documentation. - -The JSON file has the following structure: - -~~~ -{ - "SENDGRID": { - "SENDGRID_USERNAME": "SOME_NAME@example.com", - "SENDGRID_PASSWORD": "SOME_SECRET_PASSWORD", - } -} -~~~ - diff --git a/Add-on Documentation/Performance & Monitoring/Blitz.io.md b/Add-on Documentation/Performance & Monitoring/Blitz.io.md deleted file mode 100644 index 26957d7..0000000 --- a/Add-on Documentation/Performance & Monitoring/Blitz.io.md +++ /dev/null @@ -1,43 +0,0 @@ -# Blitz.io: Performance Testing - -Blitz makes load and performance testing of your web site, API, iPhone and Android and Facebook apps a fun sport. Instantly launch 1,000,000 users from around the world against your app to see if it can hold up. Integrate blitz into your continuous deployment with their Ruby Gem. Can you take the hits? - -## Adding the Blitz.io Add-on - -To add the Blitz.io Add-on use the addon.add command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add blitz.OPTION -~~~ -Replace `blitz.OPTION` with a valid option, e.g. `blitz.250`. - -When added, Blitz.io automatically creates a new user account with your email adress. You can manage the load tests for your deployment within the [web console](https://www.cloudcontrol.com/console) (go to the specific deployment and click the link "blitz.OPTION"). - -## Upgrading the Blitz.io Add-on - -To upgrade from a smaller to a more powerful plan use the addon.upgrade command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade blitz.OPTION_OLD blitz.OPTION_NEW -~~~ - -## Downgrading the Blitz.io Add-on - -To downgrade to a smaller plan use the addon.downgrade command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade blitz.OPTION_OLD blitz.OPTION_NEW -~~~ - -## Removing the Blitz.io Add-on - -The Blitz.io Add-on can be removed from the deployment by using the addon.remove command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove blitz.OPTION -~~~ - -### Internal Access - -It's recommended to the read database credentials from the creds.json file. The location of the file is available in the `CRED_FILE` environment variable. Reading the credentials from the creds.json file ensures your app is always using the correct credentials. For detailed instructions on how to use the creds.json file please refer to the section about [Add-on Credentials](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons) in the general documentation. - diff --git a/Add-on Documentation/Performance & Monitoring/Exceptiontrap.md b/Add-on Documentation/Performance & Monitoring/Exceptiontrap.md deleted file mode 100644 index b6bfd87..0000000 --- a/Add-on Documentation/Performance & Monitoring/Exceptiontrap.md +++ /dev/null @@ -1,50 +0,0 @@ -# Exceptiontrap - -Exceptiontrap is an Add-on for providing exception and error tracking to your Ruby on Rails and PHP applications. - -Exceptiontrap catches occuring errors and exceptions in your application and notifies you about them in real-time. The errors are sent to the Exceptiontrap service that groups the incoming errors automatically and provides you with all the information (request params, environment variables, stacktrace, etc.) you need to resolve them. - -For example: If your email provider is down and your application crashes while users are trying to sign up, Exceptiontrap informs you of it immediately. - -## Adding Exceptiontrap - -The Exceptiontrap Add-on can be added to every deployment with: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add exceptiontrap.OPTION -~~~ - -When added, cloudControl automatically creates a new user account with your email address at New Relic. You will be notified by New Relic via email and can log on to New Relic's console to monitor your deployment's performance. It might take a little while until New Relic has collected enough data to show you the first statistics. - -## Using with Rails 2.3+, Rails 3 and Rails 4 - -You can find the documentation on our [Exceptiontrap Gem](https://github.com/itmLABS/exceptiontrap) GitHub page. The API key is already set in the cloudControl environment. So you can just use "cloudcontrol" as the API key string while generating the Exceptiontrap config file. - -## Using with PHP, Zend Framework & other frameworks - -You can find the documentation on our [Exceptiontrap Library](https://github.com/itmLABS/exceptiontrap-php) GitHub page. -The easiest way to get the API key automatically set by cloudControl and our library is to set the variable `SET_ENV_VARS` to `true` for your application using the `Custom Config Add-on`, which is desribed [here](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons) under "Add-on Credentials". - -If you don't want to do this, use the following code snippet to "manually" extract the Exceptiontrap API key from the cloudControl environment variables file. - -~~~php - -~~~ - -## Removing Exceptiontrap - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove exceptiontrap.OPTION -~~~ - -## Further Information - -Visit [Exceptiontrap](https://exceptiontrap.com) or [write us a message](mailto:info@exceptiontrap.com) diff --git a/Add-on Documentation/Performance & Monitoring/Hosted Graphite.md b/Add-on Documentation/Performance & Monitoring/Hosted Graphite.md deleted file mode 100644 index 613bc06..0000000 --- a/Add-on Documentation/Performance & Monitoring/Hosted Graphite.md +++ /dev/null @@ -1,136 +0,0 @@ -# Hosted Graphite: Graphic metrics made scalable - -Graphite is the leading open-source metrics collection, retrieval, and visualization service. Collect thousands of metrics from your application and graph them on easily-readable dashboards. Find the pulse of your application and ensure you see the really important things happening in your technology in real-time. - -## Adding the Hosted Graphite Add-on - -To add the Hosted Graphite Add-on use the addon.add command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add hostedgraphite.OPTION -~~~ -Replace `hostedgraphite.OPTION` with a valid option, e.g. `hostedgraphite.free`. - -When added, Hosted Graphite automatically creates a new user account with your email adress. You can manage the Add-on within the [web console](https://www.cloudcontrol.com/console) (go to the specific deployment and click the link "hostedgraphite.OPTION"). - -## Upgrading the Hosted Graphite Add-on - -To upgrade from a smaller to a more powerful plan use the addon.upgrade command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade hostedgraphite.OPTION_OLD hostedgraphite.OPTION_NEW -~~~ - -## Downgrading the Hosted Graphite Add-on - -To downgrade to a smaller plan use the addon.downgrade command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade hostedgraphite.OPTION_OLD hostedgraphite.OPTION_NEW -~~~ - -## Removing the Hosted Graphite Add-on - -The Hosted Graphite Add-on can be removed from the deployment by using the addon.remove command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove hostedgraphite.OPTION -~~~ - -## Internal Access - -It's recommended to the read database credentials from the creds.json file. The location of the file is available in the `CRED_FILE` environment variable. Reading the credentials from the creds.json file ensures your app is always using the correct credentials. For detailed instructions on how to use the creds.json file please refer to the section about [Add-on Credentials](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons) in the general documentation. - -## Code Snippets - -## Using with Ruby / Rails -### TCP Connection - -~~~ - require 'socket' - - apikey = ENV['HOSTEDGRAPHITE_APIKEY'] - conn = TCPSocket.new 'carbon.hostedgraphite.com', 2003 - conn.puts apikey + ".request.time 1444\n" - conn.close -~~~ - -### UDP Connection - -~~~ - require 'socket' - - apikey = ENV['HOSTEDGRAPHITE_APIKEY'] - sock = UDPSocket.new - sock.send apikey + ".request.time 1444\n", 0, "carbon.hostedgraphite.com", 2003 -~~~ - -## Using with Python -### TCP Connection - -~~~ - import socket - import os - - apikey = os.environ['HOSTEDGRAPHITE_APIKEY'] - conn = socket.create_connection(("carbon.hostedgraphite.com", 2003)) - conn.send("%s.request.time 1444\n" % apikey) - conn.close() -~~~ - -### UDP Connection - -~~~ - import socket - import os - - apikey = os.environ['HOSTEDGRAPHITE_APIKEY'] - sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - sock.sendto("%s.request.time 1444\n" % apikey, ("carbon.hostedgraphite.com", 2003)) -~~~ - -## Using with PHP -### TCP Connection - -~~~ - -~~~ - -### UDP Connection - -~~~ - -~~~ - -## Using with Java -### TCP Connection - -~~~ - String apikey = System.getenv("HOSTEDGRAPHITE_APIKEY"); - Socket conn = new Socket("carbon.hostedgraphite.com", 2003); - DataOutputStream dos = new DataOutputStream(conn.getOutputStream()); - dos.writeBytes(apikey + ".request.time 1444\n"); - conn.close(); -~~~ - -### UDP Connection - -~~~ - String apikey = System.getenv("HOSTEDGRAPHITE_APIKEY"); - DatagramSocket sock = new DatagramSocket(); - InetAddress addr = InetAddress.getByName("carbon.hostedgraphite.com"); - byte[] message = apikey + ".request.time 1444\n".getBytes() - DatagramPacket packet = new DatagramPacket(message, message.length, addr, 2003); - sock.send(packet); - sock.close(); -~~~ \ No newline at end of file diff --git a/Add-on Documentation/Performance & Monitoring/Loader.io.md b/Add-on Documentation/Performance & Monitoring/Loader.io.md deleted file mode 100644 index 594e451..0000000 --- a/Add-on Documentation/Performance & Monitoring/Loader.io.md +++ /dev/null @@ -1,34 +0,0 @@ -# Loader.io - -Loader.io is a simple cloud-based load testing tool for your apps - by SendGrid -Labs. It allows you to stress test your web-apps/apis with thousands of -concurrent connections. - -## Adding or removing the Loader.io Add-on - -The Add-on is free. It can be added by executing the command addon.add: -~~~bash -$ cctrlapp APP_NAME/DEP_NAME addon.add loaderio.test -~~~ - -When added, Loader.io automatically creates a new account and login -configuration including access token. You can access Loader.io for your -deployment within the [web console](https://www.cloudcontrol.com/console) (go to -the specific deployment, choose "Add-Ons" tab and click Loader.io login). - -## Removing the Loader.io Add-on - -Similarily, an Add-on can also be removed from the deployment easily: -~~~bash -$ cctrlapp APP_NAME/DEP_NAME addon.remove loaderio.test -~~~ - -### Internal access credentials - -It's recommended to the read database credentials from the creds.json file. The -location of the file is available in the `CRED_FILE` environment variable. -Reading the credentials from the creds.json file ensures your app is always -using the correct credentials. For detailed instructions on how to use the -creds.json file please refer to the section about -[Add-on Credentials](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons) -in the general documentation. diff --git a/Add-on Documentation/Performance & Monitoring/New Relic.md b/Add-on Documentation/Performance & Monitoring/New Relic.md deleted file mode 100644 index 061693b..0000000 --- a/Add-on Documentation/Performance & Monitoring/New Relic.md +++ /dev/null @@ -1,40 +0,0 @@ -# New Relic - -New Relic is an on-demand performance management solution for PHP web applications. The New Relic plugin is seamlesly integrated in the cloudControl platform, enabling immediate and automatic access to comprehensive capabilities for monitoring, troubleshooting and tuning web applications. A complete list of features is displayed on [New Relic's feature overview](http://www.newrelic.com/web-app-monitoring-features.html). - -## Adding New Relic - -The New Relic add-on can be added to every deployment with: - - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add newrelic.OPTION -~~~ - -When added, cloudControl automatically creates a new user account with your email adress at New Relic. You will be notified by New Relic via email and can log on to New Relic's console to monitor your deployment's performance. It might take a little while until New Relic has collected enough data to show you the first statistics. - -## Upgrade New Relic - -Upgrading to another version of New Relic is easily done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade newrelic.OPTION_OLD newrelic.OPTION_NEW -~~~ - -## Downgrade New Relic - -Downgrading to another version of New Relic is easily done: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade newrelic.OPTION_OLD newrelic.OPTION_NEW -~~~ -## Removing New Relic - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove newrelic.OPTION -~~~ - -## PHP API - -cloudControl takes care of the whole installation and settings process. Therefore, some settings can't be edited by you. However, you can optionally use a set of PHP functions for influencing its data collection and recording for an even better integration. A detailed description of the available methods that can be used is listed in [New Relic's PHP documentation](https://newrelic.com/docs/php/the-php-api). - diff --git a/Add-on Documentation/Performance & Monitoring/StillAlive.md b/Add-on Documentation/Performance & Monitoring/StillAlive.md deleted file mode 100644 index 230f8bc..0000000 --- a/Add-on Documentation/Performance & Monitoring/StillAlive.md +++ /dev/null @@ -1,23 +0,0 @@ -# StillAlive - -Stillalive is the best way to monitor the live functionality of your web application. -## Adding or removing StillAlive -StillAlive can be added by executing the command addon.add: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add stillalive.developer -~~~ -When added, StillAlive automatically creates a new account and login configuration including access token. You can access StillAlive for your deployment within the [web console](https://console.cloudcontrolled.com) (go to the specific deployment, choose "Add-Ons" tab and click StillAlive login). -## Removing StillAlive -Similarily, an Add-on can also be removed from the deployment easily: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove stillalive.developer - -~~~ - -# Add-on Credentials - -## Internal access credentials - -It's recommended to the read database credentials from the creds.json file. The location of the file is available in the `CRED_FILE` environment variable. Reading the credentials from the creds.json file ensures your app is always using the correct credentials. For detailed instructions on how to use the creds.json file please refer to the section about [Add-on Credentials](https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-ons) in the general documentation. diff --git a/Guides/Java/AWS S3.md b/Guides/Java/AWS S3.md index fce79f0..38e9bca 100644 --- a/Guides/Java/AWS S3.md +++ b/Guides/Java/AWS S3.md @@ -26,10 +26,10 @@ Follow the [Amazon Guide](http://docs.aws.amazon.com/AWSSdkDocsJava/latest/Devel ## Example usage: -The recommended way to provide your AWS credentials to your app is via environment variables. To do this, use the [Config Add-on](https://www.cloudcontrol.com/dev-center/Add-on%20Documentation/Deployment/Custom%20Config): +The recommended way to provide your AWS credentials to your app is via environment variables. To do this, use the [Config Add-on](/Add-on Documentation/Deployment/Custom Config.md): ~~~bash -$ cctrlapp APP_NAME/default config.add AWS_SECRET_KEY=[YOUR_SECRET_KEY] AWS_ACCESS_KEY=[YOUR_ACCESS_KEY] +$ ironcliapp APP_NAME/default config.add AWS_SECRET_KEY=[YOUR_SECRET_KEY] AWS_ACCESS_KEY=[YOUR_ACCESS_KEY] ~~~ Now let's show some operations on buckets and objects: diff --git a/Guides/Java/Add-on credentials.md b/Guides/Java/Add-on credentials.md index 0fc7851..e65cf6e 100644 --- a/Guides/Java/Add-on credentials.md +++ b/Guides/Java/Add-on credentials.md @@ -17,7 +17,7 @@ Some examples for database Add-ons can be seen in the last section. In case you don't want to expose these credentials in the environment, you can disable them by executing: ~~~bash -$ cctrlapp APP_NAME/DEP_NAME config.add SET_ENV_VARS=false +$ ironcliapp APP_NAME/DEP_NAME config.add SET_ENV_VARS=false ~~~ The Add-on credentials can still be read from the credentials file, as explained in the next section. @@ -31,10 +31,10 @@ All the [Add-on credentials] can be found in a provided JSON file as well, which is exposed in the `CRED_FILE` environment variable. You can see the format of that file locally: ~~~bash -$ cctrlapp APP_NAME/DEP_NAME addon.creds +$ ironcliapp APP_NAME/DEP_NAME addon.creds ~~~ -We provide a small [cloudControl credentials helper class] to get the Add-on credentials from the file. +We provide a small [CloudKilat credentials helper class] to get the Add-on credentials from the file. It requires [json-simple], a simple Java toolkit to encode or decode JSON text easily. To use it in your project, add it as a maven dependency: ~~~xml @@ -56,12 +56,12 @@ String database = (String)cr.getCredential("MYSQLS_DATABASE", "MYSQLS"); # Examples -cloudControl offers a number of data storage solutions via the [Add-on Marketplace]. +CloudKilat offers a number of data storage solutions via the [Add-on Marketplace]. Below you can find examples on how to access the Add-on -credentials for MySQL and PostgreSQL. +credentials for MySQL. ## MySQL -To add a MySQL database, use the [MySQL Dedicated Add-on] or [MySQL Shared Add-on]. +To add a MySQL database, use the [MySQL Shared Add-on]. Here's a Java snippet that reads the database settings from the environment variables: ~~~java @@ -71,36 +71,13 @@ int port = Integer.valueOf(System.getenv("MYSQLS_PORT")); String username = System.getenv("MYSQLS_USERNAME"); String password = System.getenv("MYSQLS_PASSWORD"); ~~~ -The example used the MySQLd Add-on. Variable names for MySQLs differ. Remember, you can always refer to the addon.creds command to see the actual variable names and values. - -You can also find a working example of a [Java application with MySQL] on Github. - -## PostgreSQL - -To add a PostgreSQL database, use the [ElephantSQL Add-on]. - -With this Java snippet you can read the PostgreSQL settings from the environment variables: -~~~java -String elephantsqlUrl = System.getenv("ELEPHANTSQL_URL"); -URI databaseUri = URI.create(elephantsqlUrl); - -String database = databaseUri.getPath().substring(1); -String host = databaseUri.getHost(); -int port = databaseUri.getPort(); -String userInfo = databaseUri.getUserInfo(); - -String[] credentials = userInfo.split(":"); -String username = credentials[0]; -String password = credentials[1]; -~~~ +Remember, you can always refer to the addon.creds command to see the actual variable names and values. [Java application with MySQL]: https://github.com/cloudControl/java-mysql-example-app -[Add-on Marketplace]: https://www.cloudcontrol.com/add-ons/?c=1 -[environment variables]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#environment-variables -[Add-on credentials]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-on-credentials -[cred-env-vars]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#enabling-disabling-credentials-environment-variables +[Add-on Marketplace]: http://www.cloudkilat.com/ +[environment variables]: /Platform%20Documentation.md/#environment-variables +[Add-on credentials]: /Platform%20Documentation.md/#add-on-credentials +[cred-env-vars]: /Platform%20Documentation.md/#enablingdisabling-credentials-environment-variables [json-simple]: http://code.google.com/p/json-simple/ -[cloudControl credentials helper class]: https://gist.github.com/b350762c61fcc069b427 -[MySQL Dedicated Add-on]: https://www.cloudcontrol.com/add-ons/mysqld -[MySQL Shared Add-on]: https://www.cloudcontrol.com/add-ons/mysqls -[ElephantSQL Add-on]: https://www.cloudcontrol.com/add-ons/elephantsql +[CloudKilat credentials helper class]: https://gist.github.com/b350762c61fcc069b427 +[MySQL Shared Add-on]: /Add-on%20Documentation/Data%20Storage/MySQLs.md diff --git a/Guides/Java/Auto-Detection.md b/Guides/Java/Auto-Detection.md deleted file mode 100644 index e244a05..0000000 --- a/Guides/Java/Auto-Detection.md +++ /dev/null @@ -1,23 +0,0 @@ -# Autodetection for JVM-Based Applications - -For most officially supported languages on the cloudControl platform, the application type defines exactly which buildpack is used, and thus which runtime is created. Due to the diversity of JVM-based applications and the mix of languages used, these types of apps are an exception to this rule. - -To determine the right buildpack to use for JVM-based applications, each of the Java buildpacks defines a "detect" script. In order for the platform to determine the correct buildpack, your application must follow these conventions: - -|Technology|Detection| -|:---------|:----------:| -|[Clojure][buildpack-clojure]|`/project.clj` exists| -|[Gradle][buildpack-gradle]|`/build.gradle` exists| -|[Grails][buildpack-grails]|`/grails-app/` exists| -|[Java][buildpack-java]|`/pom.xml` exists| -|[Scala][buildpack-scala]|`/*.sbt`, or `project/*.scala` or `.sbt/*.scala`| -|[Play!][buildpack-play]|`*/conf/application.conf` inside your application (not modules). | - -For more details, check the `detect` script of the corresponding buildpack. - -[buildpack-clojure]: https://github.com/cloudControl/buildpack-clojure -[buildpack-gradle]: https://github.com/cloudControl/buildpack-gradle -[buildpack-grails]: https://github.com/cloudControl/buildpack-grails -[buildpack-java]: https://github.com/cloudControl/buildpack-java -[buildpack-scala]: https://github.com/cloudControl/buildpack-scala -[buildpack-play]: https://github.com/cloudControl/buildpack-play diff --git a/Guides/Java/Clojure - HelloWorld.md b/Guides/Java/Clojure - HelloWorld.md deleted file mode 100644 index 96619dc..0000000 --- a/Guides/Java/Clojure - HelloWorld.md +++ /dev/null @@ -1,81 +0,0 @@ -# Deploying a Clojure application - -In this tutorial we're going to show you how to deploy a Clojure application on [cloudControl]. You can find the [source code on Github](https://github.com/cloudControl/clojure-example-app) and check out the [Clojure buildpack] for supported features. - -## The Clojure Application Explained -### Get the App -First, clone the Clojure application from our repository on Github: - -~~~bash -$ git clone https://github.com/cloudControl/clojure-example-app.git -$ cd clojure-example-app -~~~ - -Now you have a small, but fully functional Clojure application. - -### Dependency Tracking -Clojure tracks your dependencies with the help of [Leiningen]. They are defined in the `project.clj` file which needs to be located in the root of your repository. The one you cloned as part of the example app looks like this: -~~~clojure -(defproject clojure-sample "1.0.1" - :description "Hello World Clojure Web App" - :dependencies [[org.clojure/clojure "1.4.0"] - [compojure "1.1.1"] - [ring/ring-jetty-adapter "1.1.2"]] - :main ^:skip-aot sample.app) -~~~ - -### Process Type Definition -cloudControl uses a [Procfile] to know how to start your processes. - -The example code already includes the `Procfile` at the top level of your repository. It looks like this: - -~~~ -web: lein run -~~~ - -The `web` process type is required and specifies the command that will be executed when the app is deployed. - -## Pushing and Deploying your App -Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the cloudControl platform: - -~~~bash -$ cctrlapp APP_NAME create java -~~~ - -Push your code to the application's repository, which triggers the deployment image build process: - -~~~bash -$ cctrlapp APP_NAME/default push - -[...] ------> Receiving push ------> Installing OpenJDK 1.7... ------> Installing Leiningen - Downloading: leiningen-1.7.1-standalone.jar - Downloading: rlwrap-0.3.7 - Writing: lein script ------> Building with Leiningen - Running: lein deps - [...] - Copying 20 files to /srv/tmp/builddir/lib ------> Building image ------> Uploading image (54M) - -To ssh://APP_NAME@cloudcontrolled.com/repository.git - * [new branch] master -> master -~~~ - -Last but not least, deploy the latest version of the app with the cctrlapp deploy command: - -~~~bash -$ cctrlapp APP_NAME/default deploy -~~~ - -Congratulations, you can now see your Clojure application running at `http[s]://APP_NAME.cloudcontrolled.com`. - -[cloudControl]: https://www.cloudcontrol.com/ -[Clojure buildpack]: https://github.com/cloudControl/buildpack-clojure -[cloudControl-command-line-client]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#command-line-client-web-console-and-api -[Git client]: http://git-scm.com/ -[Procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#buildpacks-and-the-procfile -[Leiningen]: http://leiningen.org/ diff --git a/Guides/Java/Gradle - HelloWorld.md b/Guides/Java/Gradle - HelloWorld.md deleted file mode 100644 index 80e5294..0000000 --- a/Guides/Java/Gradle - HelloWorld.md +++ /dev/null @@ -1,98 +0,0 @@ -# Deploying a Gradle application - -In this tutorial we're going to show you how to deploy a Gradle Application on [cloudControl]. You can find the [source code on Github](https://github.com/cloudControl/gradle-example-app) and check out the [Gradle buildpack] for supported features. - -## The Gradle Application Explained -### Get the App -First, clone the Gradle application from our repository on Github: - -~~~bash -$ git clone https://github.com/cloudControl/gradle-example-app.git -$ cd gradle-example-app -~~~ - -Now you have a small, but fully functional Gradle application. - -### Dependency Tracking -The dependency requirements are defined in the `build.gradle` file which needs to be located in the root of your repository. The one you cloned as part of the example app looks like this: - -~~~ -apply plugin:'java' -apply plugin:'application' - -mainClassName = "HelloWorld" -applicationName = "app" - -repositories { - mavenCentral() -} - -dependencies { - compile 'org.eclipse.jetty:jetty-servlet:7.5.3.v20111011' - compile 'javax.servlet:servlet-api:2.5' -} - -task stage(dependsOn: ['clean', 'installApp']) -~~~ - -### Process Type Definition -cloudControl uses a [Procfile] to know how to start your processes. - -The example code already includes the `Procfile` at the root of your repository. It looks like this: - -~~~ -web: ./build/install/app/bin/app -~~~ - -The `web` process type is required and specifies the command that will be executed when the app is deployed. - -## Pushing and Deploying your Gradle App -Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the cloudControl platform: - -~~~bash -$ cctrlapp APP_NAME create java -~~~ - -Push your code to the application's repository, which triggers the deployment image build process: - -~~~bash -$ cctrlapp APP_NAME/default push -[...] ------> Receiving push ------> Installing OpenJDK 1.6... ------> Installing OpenJDK 1.6(openjdk6.b27.tar.gz)... done ------> Installing gradle-1.0-milestone-5..... done ------> Building Gradle app... - WARNING: The Gradle buildpack is currently in Beta. ------> executing gradle stage - :clean - :compileJava - [...] - :processResources UP-TO-DATE - :classes - :jar - :startScripts - :installApp - :stage - - BUILD SUCCESSFUL ------> Building image ------> Uploading image (39M) - - To ssh://APP_NAME@cloudcontrolled.com/repository.git - * [new branch] master -> master -~~~ - -Last but not least, deploy the latest version of the app with the cctrlapp deploy command: - -~~~bash -$ cctrlapp APP_NAME/default deploy -~~~ - -Congratulations, you can now see your Gradle application running at `http[s]://APP_NAME.cloudcontrolled.com`. - -[cloudControl]: https://www.cloudcontrol.com/ -[Gradle buildpack]: https://github.com/cloudControl/buildpack-gradle -[cloudControl-command-line-client]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#command-line-client-web-console-and-api -[Git client]: http://git-scm.com/ -[Procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#buildpacks-and-the-procfile diff --git a/Guides/Java/Grails.md b/Guides/Java/Grails.md deleted file mode 100644 index 6c2c6b4..0000000 --- a/Guides/Java/Grails.md +++ /dev/null @@ -1,108 +0,0 @@ -# Deploying a Grails application - -In this tutorial we're going to show you how to deploy a Grails application on [cloudControl]. You can find the [source code on Github](https://github.com/cloudControl/grails-example-app) and check out the [Grails buildpack] for supported features. - -## The Grails Application Explained -### Get the App -First, clone the Grails application from our repository on Github: - -~~~bash -$ git clone https://github.com/cloudControl/grails-example-app -$ cd grails-example-app -~~~ - -Now you have a small, but fully functional Grails application. - -### Dependency Tracking -Dependencies in Grails applications are resolved using [Ivy]. The dependency requirements are defined in the `grails-app/conf/BuildConfig.groovy` file which needs to be located in the root of your repository. The one you cloned as part of the example app looks like this: - -~~~groovy -grails.servlet.version = "2.5" -grails.project.target.level = 1.6 -grails.project.source.level = 1.6 - -grails.project.dependency.resolution = { - inherits("global") { - } - log "error" - checksums true - legacyResolve false - repositories { - inherits true - grailsPlugins() - grailsHome() - grailsCentral() - - mavenLocal() - mavenCentral() - } - dependencies { - // runtime 'mysql:mysql-connector-java:5.1.20' - runtime 'postgresql:postgresql:8.4-702.jdbc3' - } - plugins { - runtime ":hibernate:$grailsVersion" - runtime ":jquery:1.8.3" - runtime ":resources:1.1.6" - build ":tomcat:$grailsVersion" - runtime ":database-migration:1.2.1" - compile ':cache:1.0.1' - } -} -~~~ - -### Process Type Definition -cloudControl uses a [Procfile] to know how to start your processes. - -The example code already includes the `Procfile` at the top level of your repository. It looks like this: - -~~~ -web: java $JAVA_OPTS -jar server/webapp-runner.jar --port $PORT target/*.war -~~~ - -The `web` process type is required and specifies the command that will be executed when the app is deployed. The environment variable `$PORT` defines the port the application-server should listen to. - -## Pushing and Deploying your App -Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the cloudControl platform: - -~~~bash -$ cctrlapp APP_NAME create java -~~~ - -Push your code to the application's repository, which triggers the deployment image build process: - -~~~bash -$ cctrlapp APP_NAME/default push -[...] ------> Receiving push ------> Grails 2.2.0 app detected - WARNING: The Grails buildpack is currently in Beta. ------> Installing OpenJDK 1.6... ------> Installing Grails 2.2.0..... ------> Done ------> Executing grails -Divy.default.ivy.user.dir=/srv/tmp/buildpack-cache compile --non-interactive - [...] ------> Executing grails -plain-output -Divy.default.ivy.user.dir=/srv/tmp/buildpack-cache war --non-interactive - [...] ------> No server directory found. Adding webapp-runner 7.0.40.0 automatically. ------> Building image ------> Uploading image (73M) - -To ssh://APP_NAME@cloudcontrolled.com/repository.git - * [new branch] master -> master -~~~ - -Last but not least, deploy the latest version of the app with the cctrlapp deploy command: - -~~~bash -$ cctrlapp APP_NAME/default deploy -~~~ - -Congratulations, you can now see your Grails application running at `http[s]://APP_NAME.cloudcontrolled.com`. - -[cloudControl]: https://www.cloudcontrol.com/ -[Grails buildpack]: https://github.com/cloudControl/buildpack-grails -[cloudControl-command-line-client]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#command-line-client-web-console-and-api -[Git client]: http://git-scm.com/ -[Procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#buildpacks-and-the-procfile -[Ivy]: http://ant.apache.org/ivy/ diff --git a/Guides/Java/Java - HelloWorld.md b/Guides/Java/Java - HelloWorld.md index 0c2582e..14cc5e6 100644 --- a/Guides/Java/Java - HelloWorld.md +++ b/Guides/Java/Java - HelloWorld.md @@ -2,7 +2,7 @@ If you're looking for a fast and lightweight Java web server / Servlet container for your projects, you definitely have to try [Jetty]. -In this tutorial we're going to show you how to deploy a Jetty application on [cloudControl]. You can find the [source code on Github](https://github.com/cloudControl/java-jetty-example-app) and check out the [Java buildpack] for supported features. +In this tutorial we're going to show you how to deploy a Jetty application on [CloudKilat]. You can find the [source code on Github](https://github.com/cloudControl/java-jetty-jsp-example-app.git) and check out the [Java buildpack] for supported features. ## The Jetty Application Explained @@ -10,25 +10,45 @@ In this tutorial we're going to show you how to deploy a Jetty application on [c First, clone the hello world app from our repository: ~~~bash -$ git clone https://github.com/cloudControl/java-jetty-example-app.git -$ cd java-jetty-example-app +$ git https://github.com/cloudControl/java-jetty-jsp-example-app.git +$ cd java-jetty-jsp-example-app ~~~ Now you have a small but fully functional Java/Jetty application. ### Dependency Tracking -To create this application we had to provide Jetty server and Servlet library as Maven dependencies in the `pom.xml`. +To create this application we had to provide Spring framework and Log4j as Maven dependencies in the `pom.xml`. ~~~xml - org.eclipse.jetty - jetty-servlet - 7.6.0.v20120127 + org.springframework + spring-core + ${org.springframework.version} - javax.servlet - servlet-api - 2.5 + org.springframework + spring-webmvc + ${org.springframework.version} + + + org.springframework + spring-context + ${org.springframework.version} + + + org.springframework + spring-beans + ${org.springframework.version} + + + log4j + log4j + 1.2.17 + + + org.slf4j + slf4j-log4j13 + 1.0.1 ~~~ @@ -50,29 +70,29 @@ To create this application we had to provide Jetty server and Servlet library as ~~~ ### Process Type Definition -cloudControl uses a [Procfile] to know how to start your processes. +CloudKilat uses a [Procfile] to know how to start your processes. The example code already includes the `Procfile` at the top level of your repository. It looks like this: ~~~ -web: java -cp target/classes:target/dependency/* com.cloudcontrolled.sample.jetty.App +web: java $JAVA_OPTS -jar target/dependency/jetty-runner.jar --port $PORT target/java-jetty-jsp-example-app-0.0.1-SNAPSHOT.war ~~~ The `web` process type is required and specifies the command that will be executed when the app is deployed. -The java command starts the 'com.cloudcontrolled.sample.jetty.App' with the classpath set to the compiled Java classes and dependencies. +The java command starts the 'com.exo.sample.jetty.App' with the classpath set to the compiled Java classes and dependencies. ## Pushing and Deploying your App -Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the cloudControl platform: +Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the CloudKilat platform: ~~~bash -$ cctrlapp APP_NAME create java +$ ironcliapp APP_NAME create java ~~~ Push your code to the application's repository, which triggers the deployment image build process: ~~~bash -$ cctrlapp APP_NAME/default push +$ ironcliapp APP_NAME/default push -----> Receiving push -----> Installing OpenJDK 1.7(openjdk7.b32.tar.gz)... done @@ -94,22 +114,22 @@ $ cctrlapp APP_NAME/default push -----> Building image -----> Uploading image (39M) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@kilatiron.net/repository.git 54b0da2..d247825 master -> master ~~~ -Last but not least deploy the latest version of the app with the cctrlapp deploy command: +Last but not least deploy the latest version of the app with the ironcliapp deploy command: ~~~bash -$ cctrlapp APP_NAME/default deploy +$ ironcliapp APP_NAME/default deploy ~~~ -Congratulations, you can now see your Jetty Application running at `http[s]://APP_NAME.cloudcontrolled.com`. +Congratulations, you can now see your Jetty Application running at `http[s]://APP_NAME.kilatiron.net`. [Jetty]: http://jetty.codehaus.org/jetty/ -[cloudControl]: https://www.cloudcontrol.com/ +[CloudKilat]: http://www.cloudkilat.com/ [Java buildpack]: https://github.com/cloudControl/buildpack-java -[cloudControl-command-line-client]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#command-line-client-web-console-and-api +[CloudKilat-command-line-client]: /Platform%20Documentaion.md/#command-line-client-web-console-and-api [Git client]: http://git-scm.com/ [Maven dependency plugin]: http://maven.apache.org/plugins/maven-dependency-plugin/ -[Procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#buildpacks-and-the-procfile +[Procfile]: /Platform%20Documentaion.md/#buildpacks-and-the-procfile diff --git a/Guides/Java/Java - Spring.md b/Guides/Java/Java - Spring.md index c1f4e32..8bed6cb 100644 --- a/Guides/Java/Java - Spring.md +++ b/Guides/Java/Java - Spring.md @@ -1,6 +1,6 @@ #Deploying a Spring Application -In this tutorial we're going to show you how to deploy a Spring/MVC/Hibernate application on [cloudControl]. The example app is a ready to deploy project based on the [Spring Roo petclinic] example. +In this tutorial we're going to show you how to deploy a Spring/MVC/Hibernate application on [CloudKilat]. The example app is a ready to deploy project based on the [Spring Roo petclinic] example. ## The Spring Application Explained @@ -62,9 +62,9 @@ In this tutorial we use the [Shared MySQL Add-on]. We have changed the `src/main ### Adjust Logger Configuration -Logging to a file is not recommended since the container's [file system] is not persistent. -The default logger configuration - `src/main/resources/log4j.properties` is modified to log to `stdout/stderr`. -Then cloudcontrol can pick up all the messages and provide them to you via the [log command]. This is how the file looks now: +Logging to a file is not recommended since the container's [file system] is not persistent. +The default logger configuration - `src/main/resources/log4j.properties` is modified to log to `stdout/stderr`. +Then CloudKilat can pick up all the messages and provide them to you via the [log command]. This is how the file looks now: ~~~xml og4j.rootLogger=DEBUG, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender @@ -74,7 +74,7 @@ log4j.appender.stdout.layout.ConversionPattern=%p [%t] (%c) - %m%n% ### Process Type Definition -cloudControl uses the `Procfile` to start the application. The `Procfile` in the project root therefore specifies the command which executes the Jetty Runner: +CloudKilat uses the `Procfile` to start the application. The `Procfile` in the project root therefore specifies the command which executes the Jetty Runner: ~~~ web: java $JAVA_OPTS -jar target/dependency/jetty-runner.jar --port $PORT target/*.war @@ -83,16 +83,16 @@ web: java $JAVA_OPTS -jar target/dependency/jetty-runner.jar --port $PORT target ## Pushing and Deploying your App -Choose a unique name (from now on called APP_NAME) for your application and create it on the cloudControl platform: +Choose a unique name (from now on called APP_NAME) for your application and create it on the CloudKilat platform: ~~~bash -$ cctrlapp APP_NAME create java +$ ironcliapp APP_NAME create java ~~~ Push your code to the application's repository: ~~~bash -$ cctrlapp APP_NAME/default push +$ ironcliapp APP_NAME/default push Counting objects: 223, done. Delta compression using up to 4 threads. Compressing objects: 100% (212/212), done. @@ -130,26 +130,26 @@ Total 223 (delta 107), reused 0 (delta 0) -----> Building image -----> Uploading image (84M) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@kilatiron.net/repository.git * [new branch] master -> master ~~~ Add MySQLs Add-on with free plan to your deployment and deploy it: ~~~bash -$ cctrlapp APP_NAME/default addon.add mysqls.free -$ cctrlapp APP_NAME/default deploy --memory=768MB +$ ironcliapp APP_NAME/default addon.add mysqls.free +$ ironcliapp APP_NAME/default deploy --memory=768MB ~~~ The `--memory=768MB` argument increases the container size to meet the high memory consumption of the Spring framework. Please note: increasing the size comes with additional costs. -Et voila, the app is now up and running at `http[s]://APP_NAME.cloudcontrolled.com` . +Et voila, the app is now up and running at `http[s]://APP_NAME.kilatiron.net` . [Spring Roo petclinic]: http://static.springsource.org/spring-roo/reference/html/intro.html#intro-exploring-sample -[Database credentials]: Add-on%20credentials +[Database credentials]: /Guides/Java/Add-on%20credentials.md [Jetty Runner]: http://wiki.eclipse.org/Jetty/Howto/Using_Jetty_Runner -[cloudControl]: / -[file system]: ../../Platform%20Documentation#non-persistent-filesystem -[log command]: ../../Platform%20Documentation#logging -[Shared MySQL Add-on]: ../../Add-on%20Documentation/Data%20Storage/MySQLs +[CloudKilat]: http://www.cloudkilat.com/ +[file system]: /Platform%20Documentation.md/#non-persistent-filesystem +[log command]: /Platform%20Documentation.md//#logging +[Shared MySQL Add-on]: /Add-on%20Documentation/Data%20Storage/MySQLs.md diff --git a/Guides/Java/Play - HelloWorld.md b/Guides/Java/Play - HelloWorld.md deleted file mode 100644 index c09e064..0000000 --- a/Guides/Java/Play - HelloWorld.md +++ /dev/null @@ -1,87 +0,0 @@ -# Deploying a Play! V1 application - -In this tutorial we're going to show you how to deploy a Play! application on [cloudControl]. You can find the [source code on Github](https://github.com/cloudControl/play-example-app) and check out the [Play buildpack] for supported features. - -If you want to deploy a Play! V2 application, see the [Scala Tutorial]. - -## The Play! Application Explained -### Get the App -First, clone the Play! application from our repository on Github: - -~~~bash -$ git clone https://github.com/cloudControl/play-example-app.git -$ cd play-example-app -~~~ - -Now you have a small, but fully functional Play! application. - -### Dependency Tracking -Dependencies in Play! applications are resolved using [Ivy]. The dependency requirements are defined in the `conf/dependencies.yml` file which needs to be located in the root of your repository. The one you cloned as part of the example app looks like this: - -~~~yaml -require: - - play -~~~ - -### Process Type Definition -cloudControl uses a [Procfile] to know how to start your processes. - -The example code already includes the `Procfile` at the top level of your repository. It looks like this: - -~~~ -web: play run --http.port=$PORT $PLAY_OPTS -~~~ - -The `web` process type is required and specifies the command that will be executed when the app is deployed. The environment variable `$PORT` defines the port the application-server should listen to. - -## Pushing and Deploying your App -Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the cloudControl platform: - -~~~bash -$ cctrlapp APP_NAME create java -~~~ - -Push your code to the application's repository, which triggers the deployment image build process: - -~~~bash -$ cctrlapp APP_NAME/default push -[...] ------> Receiving push ------> Installing OpenJDK 1.6... ------> Installing Play! 1.2.4..... ------> done ------> Installing ivysettings.xml..... done ------> Building Play! application... - ~ _ _ - ~ _ __ | | __ _ _ _| | - ~ | '_ \| |/ _' | || |_| - ~ | __/|_|\____|\__ (_) - ~ |_| |__/ - ~ - ~ play! 1.2.4, http://www.playframework.org - ~ - 1.2.4 - Building Play! application at directory ./ - Precompiling: .play/play precompile ./ --silent 2>&1 ------> Building image ------> Uploading image (65M) - -To ssh://APP_NAME@cloudcontrolled.com/repository.git - * [new branch] master -> master -~~~ - -Last but not least, deploy the latest version of the app with the cctrlapp deploy command: - -~~~bash -$ cctrlapp APP_NAME/default deploy -~~~ - -Congratulations, you can now see your Play! application running at `http[s]://APP_NAME.cloudcontrolled.com`. - -[cloudControl]: https://www.cloudcontrol.com/ -[Play buildpack]: https://github.com/cloudControl/buildpack-play -[Scala tutorial]: Scala -[cloudControl-command-line-client]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#command-line-client-web-console-and-api -[Git client]: http://git-scm.com/ -[Procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#buildpacks-and-the-procfile -[Ivy]: http://ant.apache.org/ivy/ \ No newline at end of file diff --git a/Guides/Java/Scala - HelloWorld.md b/Guides/Java/Scala - HelloWorld.md deleted file mode 100644 index fcbb469..0000000 --- a/Guides/Java/Scala - HelloWorld.md +++ /dev/null @@ -1,87 +0,0 @@ -# Deploying a Scala application - -In this tutorial we're going to show you how to deploy a Scala application on [cloudControl]. You can find the [source code on Github](https://github.com/cloudControl/scalatra-example-app) and check out the [Scala buildpack] for supported features. - -## The Scala Application Explained -### Get the App -First, clone the Scala application from our repository on Github: - -~~~bash -$ git clone https://github.com/cloudControl/scalatra-example-app.git -$ cd scalatra-example-app -~~~ - -Now you have a small, but fully functional Scala application. - -### Dependency Tracking -Dependencies in Scala applications are resolved using [sbt]. The dependency requirements are defined in the `build.sbt` file which needs to be located in the root of your repository. The one you cloned as part of the example app looks like this: - -~~~scala -import com.typesafe.startscript.StartScriptPlugin -seq(StartScriptPlugin.startScriptForClassesSettings: _*) -organization := "org.soichiro" -name := "scalatra" -version := "0.1.0-SNAPSHOT" -scalaVersion := "2.9.1" -seq(webSettings :_*) -libraryDependencies ++= Seq( - "org.scalatra" %% "scalatra" % "2.0.4", - "org.scalatra" %% "scalatra-scalate" % "2.0.4", - "org.scalatra" %% "scalatra-specs2" % "2.0.4" % "test", - "ch.qos.logback" % "logback-classic" % "1.0.0" % "runtime", - "org.eclipse.jetty" % "jetty-webapp" % "7.6.0.v20120127" % "container", - "org.eclipse.jetty" % "jetty-webapp" % "7.6.0.v20120127" % "compile", - "javax.servlet" % "servlet-api" % "2.5" % "provided" -) -resolvers += "Sonatype OSS Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/" -~~~ - -### Process Type Definition -cloudControl uses a [Procfile] to know how to start your processes. - -The example code already includes the `Procfile` at the top level of your repository. It looks like this: - -~~~ -web: target/start -~~~ - -The `web` process type is required and specifies the command that will be executed when the app is deployed. - -## Pushing and Deploying your App -Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the cloudControl platform: - -~~~bash -$ cctrlapp APP_NAME create java -~~~ - -Push your code to the application's repository, which triggers the deployment image build process: - -~~~bash -$ cctrlapp APP_NAME/default push -[...] ------> Receiving push ------> Installing OpenJDK 1.6... ------> Building app with sbt ------> Running: sbt clean compile stage - [...] ------> Building image ------> Uploading image (80M) - -To ssh://APP_NAME@cloudcontrolled.com/repository.git - * [new branch] master -> master -~~~ - -Last but not least, deploy the latest version of the app with the cctrlapp deploy command: - -~~~bash -$ cctrlapp APP_NAME/default deploy -~~~ - -Congratulations, you can now see your Scala application running at `http[s]://APP_NAME.cloudcontrolled.com`. - -[cloudControl]: https://www.cloudcontrol.com/ -[Scala buildpack]: https://github.com/cloudControl/buildpack-scala -[sbt]: http://www.scala-sbt.org/ -[cloudControl-command-line-client]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#command-line-client-web-console-and-api -[Git client]: http://git-scm.com/ -[Procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#buildpacks-and-the-procfile \ No newline at end of file diff --git a/Guides/NodeJS/AWS S3.md b/Guides/NodeJS/AWS S3.md index e913fe8..7c3d5be 100644 --- a/Guides/NodeJS/AWS S3.md +++ b/Guides/NodeJS/AWS S3.md @@ -24,7 +24,7 @@ In addition to the AWS SDK, you also need to have AWS access credentials. If you S3 needs your AWS credentials for access. The recommended way to provide your AWS credentials to your app is via environment variables. To do this, use the [Config Add-on]: ~~~bash -cctrlapp APP_NAME/default config.add +ironcliapp APP_NAME/default config.add AWS_ACCESS_KEY_ID=[YOUR_SECRET_KEY] AWS_SECRET_ACCESS_KEY=[YOUR_ACCESS_KEY] AWS_REGION='eu-west-1' @@ -94,4 +94,4 @@ You can build rich Node.js apps using more advanced S3 operations. To learn more [npm package manager]: https://npmjs.org/ [Amazon Guide]: http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-intro.html [AWS access credentials]: http://aws.amazon.com/security-credentials -[Config Add-on]: https://www.cloudcontrol.com/dev-center/Add-on%20Documentation/Deployment/Custom%20Config +[Config Add-on]: /Add-on%20Documentation/Deployment/Custom%20Config.md diff --git a/Guides/NodeJS/Add-on credentials.md b/Guides/NodeJS/Add-on credentials.md index 72d9409..41a102f 100644 --- a/Guides/NodeJS/Add-on credentials.md +++ b/Guides/NodeJS/Add-on credentials.md @@ -11,7 +11,7 @@ By default, each Add-on exposes its credentials in the environment. You can look In case you don't want to expose these credentials in the environment, you can disable them by executing: ~~~bash -$ cctrlapp APP_NAME/DEP_NAME config.add SET_ENV_VARS=false +$ ironcliapp APP_NAME/DEP_NAME config.add SET_ENV_VARS=false ~~~ The Add-on credentials can still be read from the credentials file, as explained in the next section. @@ -24,7 +24,7 @@ All the [Add-on credentials] can be found in a provided JSON file as well, which the `CRED_FILE` environment variable. You can see the format of that file locally with the command: ~~~bash -$ cctrlapp APP_NAME/DEP_NAME addon.creds +$ ironcliapp APP_NAME/DEP_NAME addon.creds ~~~ You can use the following code wherever you want to get the credentials in your Node.js app: @@ -44,10 +44,10 @@ var param3 = creds.ADDON_NAME.ADDON_NAME_PARAMETER3; # Examples -cloudControl offers a number of data storage solutions via the [Add-on Marketplace]. Below you can see how to access Add-on credentials on two examples, for MySQL and PostgreSQL. +CloudKilat offers a number of data storage solutions via the [Add-on Marketplace]. Below you can see how to access Add-on credentials for MySQL. ##MySQL -To add a MySQL database, use the [MySQL Dedicated Add-on] or [MySQL Shared Add-on]. +To add a MySQL database, use the [MySQL Shared Add-on]. Here's a Node.js snippet that reads the database settings from the credentials file: @@ -58,41 +58,17 @@ var creds = JSON.parse( fs.readFileSync(process.env.CRED_FILE) ); -var host = creds.MYSQLD.MYSQLD_HOST; -var database = creds.MYSQLD.MYSQLD_DATABASE; -var user = creds.MYSQLD.MYSQLD_USER; -var password = creds.MYSQLD.MYSQLD_PASSWORD; -var port = creds.MYSQLD.MYSQLD_PORT; +var host = creds.MYSQLS.MYSQLS_HOSTNAME; +var database = creds.MYSQLS.MYSQLS_DATABASE; +var user = creds.MYSQLS.MYSQLS_USERNAME; +var password = creds.MYSQLS.MYSQLS_PASSWORD; +var port = creds.MYSQLS.MYSQLS_PORT; ~~~ -The example used the MySQLd Add-on. Variable names for MySQLs differ. Remember, you can always refer to the `addon.creds` command to see the actual variable names and values. +Remember, you can always refer to the `addon.creds` command to see the actual variable names and values. -##PostgreSQL -To add a PostgreSQL database, use the [ElephantSQL Add-on]. - -This sets the `ELEPHANTSQL_URL` environment variable which can be used in your code as shown below: - -~~~javascript -var fs = require('fs'); -var url = require('url'); - -var creds = JSON.parse( - fs.readFileSync(process.env.CRED_FILE) -); -var elephantSQLUrl = url.parse(creds.ELEPHANTSQL.ELEPHANTSQL_URL); - -var host = elephantSQLUrl.hostname; -var database = elephantSQLUrl.pathname.substr(1); -var auth = elephantSQLUrl.auth.split(':'); -var user = auth[0]; -var password = auth[1]; -var port = elephantSQLUrl.port; -~~~ - -[Add-on Marketplace]: https://www.cloudcontrol.com/add-ons -[environment variables]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#environment-variables -[MySQL Dedicated Add-on]: https://www.cloudcontrol.com/add-ons/mysqld -[MySQL Shared Add-on]: https://www.cloudcontrol.com/add-ons/mysqls -[Add-on credentials]:https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-on-credentials -[ElephantSQL Add-on]: https://www.cloudcontrol.com/add-ons/elephantsql +[Add-on Marketplace]: http://www.cloudkilat.com/ +[environment variables]: /Platform%20Documentation.md/#environment-variables +[MySQL Shared Add-on]: /Add-on%20Documentation/Data%20Storage/MySQLs.md +[Add-on credentials]: /Platform%20Documentation.md/#add-on-credentials diff --git a/Guides/NodeJS/Express.md b/Guides/NodeJS/Express.md deleted file mode 100644 index 1cb13cc..0000000 --- a/Guides/NodeJS/Express.md +++ /dev/null @@ -1,165 +0,0 @@ -# Deploying an Express Application - -This example demonstrates how to build a simple Express app on [cloudControl]. The -app uses [Express], which is a [Node.js] web framework, and MongoDB as the -backend database. - -## The Express Application Explained - -### Get the App -First, clone the Express application from our -Github repository by executing the following commands from your command line: - -~~~bash -$ git clone git@github.com:cloudControl/nodejs-express-mongodb-example-app.git -$ cd nodejs-express-mongodb-example-app -~~~ - -Now you have a small, but fully functional Express application. - -### Dependency Tracking - -The Node.js buildpack tracks dependencies using -[npm]. The dependency requirements are defined in a `package.json` file which needs to be located -in the root of your repository. The one you cloned as part of the example app looks like this: - -~~~json -{ - "name": "ExpressTut", - "version": "0.0.1", - "private": true, - "scripts": { - "start": "node app" - }, - "dependencies": { - "express": "3.4.0", - "jade": "*", - "mongodb": "1.3.19" - } -} -~~~ - -### Process Type Definition - -A [Procfile] is required to start processes on the cloudControl platform. There -must be a file called `Procfile` at the root of your repository. In the example -code you already cloned it looks like this: - -~~~ -web: node app.js -~~~ - -Left of the colon, we specified the **required** process type called `web` followed by the command that starts the app. - -### MongoDB Database - -Node.js and MongoDB are an excellent combination because JSON -(JavaScript Object Notation) is a subset of JavaScript, making storage and -retrieval of the objects very simple. MongoDB is provided by [MongoSoup] and -[MongoLab] which can be found in cloudControl's Add-on Marketplace under the -category [Data Storage]. - -This example uses the MongoLab Add-on. In the -`employeeprovider.js` file, you can find how the connection to the database is -established: - -~~~javascript -var Db = require('mongodb').Db, - MongoClient = require('mongodb').MongoClient, - Server = require('mongodb').Server, - ReplSetServers = require('mongodb').ReplSetServers, - ObjectID = require('mongodb').ObjectID, - Binary = require('mongodb').Binary, - GridStore = require('mongodb').GridStore, - Grid = require('mongodb').Grid, - Code = require('mongodb').Code, - BSON = require('mongodb').pure().BSON, - assert = require('assert'); - -EmployeeProvider = function() { - var that = this; - mongodbUri = process.env.MONGOLAB_URI || 'mongodb://localhost'; - MongoClient.connect(mongodbUri, function(err, db){ - if(err) { return console.dir(err); } - that.db = db; - }) -}; -~~~ - -For more information related to getting Add-on credentials in JavaScript, you -can refer to the Node.js Add-on credentials [guide][get-conf]. - - -## Pushing and Deploying your Express App - -Choose a unique name to replace the `APP_NAME` placeholder for your application -and create it on the cloudControl platform: - -~~~bash -$ cctrlapp APP_NAME create nodejs -~~~ - -Push your code to the application's repository, which triggers the deployment -image build process: - -~~~bash -$ cctrlapp APP_NAME/default push -Counting objects: 73, done. -Delta compression using up to 8 threads. -Compressing objects: 100% (35/35), done. -Writing objects: 100% (73/73), 267.28 KiB | 0 bytes/s, done. -Total 73 (delta 30), reused 73 (delta 30) - ------> Receiving push ------> Resolving engine versions - - WARNING: No version of Node.js specified in package.json, - - Using Node.js version: 0.10.15 - Using npm version: 1.3.5 ------> Fetching Node.js binaries ------> Vendoring node into slug ------> Installing dependencies with npm - npm WARN package.json ExpressTut@0.0.1 No repository field. - npm http GET https://registry.npmjs.org/jade - npm http GET https://registry.npmjs.org/mongodb/1.3.19 - npm http GET https://registry.npmjs.org/express/3.4.0 - ... - Dependencies installed ------> Building runtime environment ------> Building image ------> Uploading image (17M) - -To ssh://APP_NAME@cloudcontrolled.com/repository.git - * [new branch] master -> master -~~~ - -Finally, don’t forget to add the MongoLab Add-on for cloudControl and deploy the -latest version of the app: - -~~~bash -$ cctrlapp APP_NAME/default addon.add mongolab.free -$ cctrlapp APP_NAME/default deploy -~~~ - -Congratulations, you can now see your Express app running with MongoDB at -`http[s]://APP_NAME.cloudcontrolled.com`. - - -## Next Steps -Read our [platform documentation] for a technical overview of the concepts you’ll -encounter while writing, configuring, deploying and running your Node.js -applications. - - -[Node.js]: http://nodejs.org/ -[Express]: http://expressjs.com/ -[npm]: https://npmjs.org/ -[cloudControl]: http://www.cloudcontrol.com -[Node.js buildpack]: https://github.com/cloudControl/buildpack-nodejs -[get-conf]: https://www.cloudcontrol.com/dev-center/Guides/NodeJS/Add-on%20credentials -[Procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#buildpacks-and-the-procfile -[platform documentation]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation -[Data Storage]: https://www.cloudcontrol.com/add-ons?c=1 -[MongoLab]: https://www.cloudcontrol.com/add-ons/mongolab -[MongoSoup]: https://www.cloudcontrol.com/add-ons/mongosoup diff --git a/Guides/NodeJS/HelloWorld.md b/Guides/NodeJS/HelloWorld.md index 6be127d..4f5a649 100644 --- a/Guides/NodeJS/HelloWorld.md +++ b/Guides/NodeJS/HelloWorld.md @@ -1,7 +1,7 @@ # Deploying a Node.js Application [Node.js] is a platform built on Chrome's JavaScript runtime for building fast and scalable network applications. Its event-driven, non-blocking I/O model makes it a lightweight and efficient framework for building data-intensive real-time cloud apps. -This tutorial demonstrates how to build and deploy a simple Hello World Node.js application on [cloudControl]. Check out the [Node.js buildpack] for supported features. +This tutorial demonstrates how to build and deploy a simple Hello World Node.js application on [CloudKilat]. Check out the [Node.js buildpack] for supported features. ## The Node.js App Explained @@ -39,7 +39,7 @@ app looks like this: You should always specify the versions of your dependencies if you want your builds to be reproducible and to prevent unexpected errors caused by version changes. ### Process Type Definition -A [Procfile] is required to start processes on the cloudControl platform. There must be a file called `Procfile` at the root of your repository. In the example code you already cloned it looks like this: +A [Procfile] is required to start processes on the CloudKilat platform. There must be a file called `Procfile` at the root of your repository. In the example code you already cloned it looks like this: ~~~ web: node web.js @@ -49,16 +49,16 @@ Left from the colon, we specified the **required** process type called `web` fol ## Pushing and Deploying your App Choose a unique name to replace the `APP_NAME` placeholder for your application -and create it on the cloudControl platform: +and create it on the CloudKilat platform: ~~~bash -$ cctrlapp APP_NAME create nodejs +$ ironcliapp APP_NAME create nodejs ~~~ Push your code to the application's repository, which triggers the deployment image build process: ~~~bash -$ cctrlapp APP_NAME/default push +$ ironcliapp APP_NAME/default push Counting objects: 307, done. Delta compression using up to 8 threads. Compressing objects: 100% (261/261), done. @@ -91,28 +91,23 @@ Total 307 (delta 18), reused 307 (delta 18) -----> Building image -----> Uploading image (4.3M) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@kilatiron.net/repository.git * [new branch] master -> master ~~~ -Last but not least, deploy the latest version of the app with the cctrlapp deploy command: +Last but not least, deploy the latest version of the app with the ironcliapp deploy command: ~~~bash -$ cctrlapp APP_NAME/default deploy +$ ironcliapp APP_NAME/default deploy ~~~ Congratulations, you can now see your Node.js app running at -`http[s]://APP_NAME.cloudcontrolled.com`. +`http[s]://APP_NAME.kilatiron.net`. -## Next Steps -Building a data app with Node.js? Check out our next [example on how to use Node.js with MongoDB]. Read our [platform documentation] for a technical overview of the concepts you’ll encounter while writing, configuring, deploying and running your Node.js applications. -Good luck building your apps using Node.js and cloudControl. - -[example on how to use Node.js with MongoDB]: https://www.cloudcontrol.com/dev-center/Guides/NodeJS/Express [Node.js]: http://nodejs.org/ [npm]: https://npmjs.org/ -[cloudControl]: http://www.cloudcontrol.com +[CloudKilat]: http://www.cloudkilat.com/ [Node.js buildpack]: https://github.com/cloudControl/buildpack-nodejs -[Procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#buildpacks-and-the-procfile -[platform documentation]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation +[Procfile]: /Platform%20Documentation.md/#buildpacks-and-the-procfile +[platform documentation]: /Platform%20Documentation.md diff --git a/Guides/NodeJS/Sailsjs.md b/Guides/NodeJS/Sailsjs.md index 2065dd9..8fbf7d2 100644 --- a/Guides/NodeJS/Sailsjs.md +++ b/Guides/NodeJS/Sailsjs.md @@ -1,6 +1,6 @@ # Deploying a Sails.js Application -In this guide we're going to show you how to deploy a [Sails.js] application on [cloudControl]. Sails.js is a real-time [Node.js] MVC framework, designed to mimic the pattern of frameworks like [Ruby on Rails]. It allows you to easily create applications with Node.js using the Model-View-Controller pattern to organize your code so that it is easier to maintain. +In this guide we're going to show you how to deploy a [Sails.js] application on [CloudKilat]. Sails.js is a real-time [Node.js] MVC framework, designed to mimic the pattern of frameworks like [Ruby on Rails]. It allows you to easily create applications with Node.js using the Model-View-Controller pattern to organize your code so that it is easier to maintain. If you are new to Sails.js, first, check out the [Sails getting started page] for more info on how to install Sails. @@ -48,7 +48,7 @@ The one you cloned as part of the example app looks like this: ~~~ ### Process Type Definition -cloudControl uses a [Procfile] to start the application processes. The `Procfile` can be found at the root level of your repository. +CloudKilat uses a [Procfile] to start the application processes. The `Procfile` can be found at the root level of your repository. To start the sails server, you need to use the `sails lift` command. This command is included in the procfile definition as shown below: @@ -59,7 +59,7 @@ web: export NODE_ENV=production; sails lift Left from the colon we specified the **required** process type called `web` for a web application and followed by the command that starts the Sails server. ### Connecting the Sails.js Application to a Database -Sails.js is database agnostic. It provides a simple data access layer that works, no matter what database you're using. All you have to do is plug in one of the adapters for your database. Here, we show you how to connect your Sails.js application to a MySQL database using the cloudControl [Shared MySQL Add-on]. +Sails.js is database agnostic. It provides a simple data access layer that works, no matter what database you're using. All you have to do is plug in one of the adapters for your database. Here, we show you how to connect your Sails.js application to a MySQL database using the CloudKilat [Shared MySQL Add-on]. Have a look at the `config/adapter.js` file so you can find out how to [get the MySQL credentials] provided by MySQLs Add-on: @@ -94,19 +94,19 @@ module.exports.adapters = { ### Socket.io and Websocket Support -In Sails.js, client-backend communication is done using [websockets]. In order to use websockets, it is important to use `*.cloudcontrolapp.com` domain instead of `*.cloudcontrolled.com`. For more details, take a look at the [cloudControl websockets documentation]. +In Sails.js, client-backend communication is done using [websockets]. For more details, take a look at the [CloudKilat websockets documentation]. ## Pushing and Deploying your Sails.js App -To deploy your Sails.js application, choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the cloudControl platform: +To deploy your Sails.js application, choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the CloudKilat platform: ~~~bash -$ cctrlapp APP_NAME create nodejs +$ ironcliapp APP_NAME create nodejs ~~~ Push your code to the application's repository, which triggers the deployment image build process: ~~~bash -$ cctrlapp APP_NAME/default push +$ ironcliapp APP_NAME/default push Counting objects: 73, done. Delta compression using up to 8 threads. Compressing objects: 100% (35/35), done. @@ -126,31 +126,31 @@ Total 73 (delta 30), reused 73 (delta 30) -----> Building image -----> Uploading image (17M) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@kilatiron.net/repository.git * [new branch] master -> master ~~~ Add the [Shared MySQL Add-on]: ~~~bash -$ cctrlapp APP_NAME/default addon.add mysqls.free +$ ironcliapp APP_NAME/default addon.add mysqls.free ~~~ Finally, deploy the Sails.js application: ~~~bash -$ cctrlapp APP_NAME/default deploy +$ ironcliapp APP_NAME/default deploy ~~~ Congratulations, you can now see your Sails.js application running at -`http://APP_NAME.cloudcontrolapp.com`. +`http://APP_NAME.kilatiron.net`. [Node.js]: http://nodejs.org/ [Sails.js]: http://sailsjs.org/ [Sails getting started page]: http://sailsjs.org/#!getStarted [Ruby on Rails]: http://rubyonrails.org/ [npm]: https://npmjs.org/ -[cloudControl]: http://www.cloudcontrol.com -[Procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#buildpacks-and-the-procfile -[get the MySQL credentials]: https://www.cloudcontrol.com/dev-center/Guides/NodeJS/Add-on%20credentials +[CloudKilat]: http://www.cloudkilat.com/ +[Procfile]: /Platform%20Documentation.md/#buildpacks-and-the-procfile +[get the MySQL credentials]: /Guides/NodeJS/Add-on%20credentials.md [websockets]: http://socket.io/ -[cloudControl websockets documentation]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#websockets -[Shared MySQL Add-on]: https://www.cloudcontrol.com/dev-center/Add-on%20Documentation/Data%20Storage/MySQLs +[CloudKilat websockets documentation]: /Platform%20Documentation.md/#websockets +[Shared MySQL Add-on]: /Add-on%20Documentation/Data%20Storage/MySQLs.md diff --git a/Guides/PHP/Add-on credentials.md b/Guides/PHP/Add-on credentials.md index 1d521b9..7d44f3b 100644 --- a/Guides/PHP/Add-on credentials.md +++ b/Guides/PHP/Add-on credentials.md @@ -10,7 +10,7 @@ appear in the version control and cause potential security issues. All the [Add-on credentials] can be found in a provided JSON file, which path is exposed in the `CRED_FILE` environment variable. You can see the format of that file locally with the command: ~~~bash -$ cctrlapp APP_NAME/DEPLOYMENT_NAME addon.creds +$ ironcliapp APP_NAME/DEP_NAME addon.creds ~~~ You can use the following code wherever you want to get the credentials in your @@ -35,12 +35,12 @@ $var3_name = $creds['ADDON_NAME']['ADDON_NAME_PARAMETER3']; # Examples -cloudControl offers a number of data storage solutions via the [Add-on Marketplace]. -Below you can see how to access Add-on credentials on two examples for MySQL and PostgreSQL. +CloudKilat offers a number of data storage solutions via the [Add-on Marketplace]. +Below you can see how to access Add-on credentials for MySQL. ## MySQL -To add a MySQL database, use the [MySQL Dedicated Add-on] or [MySQL Shared Add-on]. +To add a MySQL database, use the [MySQL Shared Add-on]. Here's a PHP snippet that reads the database settings from the credentials file: ~~~php @@ -56,33 +56,9 @@ $username = $creds['MYSQLS']['MYSQLS_USERNAME']; $password = $creds['MYSQLS']['MYSQLS_PASSWORD']; ~~~ -The example used the MySQLs Add-on. Variable names for MySQLd differ. Remember, you can always refer to the `addon.creds` command to see the actual variable names and values. +Remember, you can always refer to the `addon.creds` command to see the actual variable names and values. -## PostgreSQL - -To add a PostgreSQL database, use the [ElephantSQL Add-on]. - -With this PHP snippet you can read the PostgreSQL settings and store them in -the `$db_config` array: -~~~php -$creds_string = file_get_contents($_ENV['CRED_FILE'], false); -if ($creds_string == false) { - die('FATAL: Could not read credentials file'); -} -$creds = json_decode($creds_string, true); -$elephant_uri = parse_url(http://github.com/$creds['ELEPHANTSQL']['ELEPHANTSQL_URL']); -$db_config = array( - "database" => substr($elephant_uri["path"], 1), - "host" => $elephant_uri["host"], - "port" => $elephant_uri["port"], - "username" => $elephant_uri["user"], - "password" => $elephant_uri["pass"] -); -~~~ - -[env-vars]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#environment-variables -[Add-on credentials]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-on-credentials -[Add-on Marketplace]: https://www.cloudcontrol.com/add-ons/ -[MySQL Dedicated Add-on]: https://www.cloudcontrol.com/add-ons/mysqld -[MySQL Shared Add-on]: https://www.cloudcontrol.com/add-ons/mysqls -[ElephantSQL Add-on]: https://www.cloudcontrol.com/add-ons/elephantsql +[env-vars]: /Platform%20Documentation.md/#environment-variables +[Add-on credentials]: /Platform%20Documentation.md/#add-on-credentials +[Add-on Marketplace]: http://www.cloudkilat.com/ +[MySQL Shared Add-on]: /Add-on%20Documentation/Data%20Storage/MySQLs.md diff --git a/Guides/PHP/CakePHP 2.2.1.md b/Guides/PHP/CakePHP 2.2.1.md index c237f33..82e1c82 100644 --- a/Guides/PHP/CakePHP 2.2.1.md +++ b/Guides/PHP/CakePHP 2.2.1.md @@ -1,6 +1,6 @@ #Deploying CakePHP 2.2.1 -![Successful Deployment](images/cake-homepage.png) +![Successful Deployment](/static/apps/images/cake-homepage.png) If you're looking for a fast, light and effective PHP Framework for your projects, you can't go past [CakePHP](http://cakephp.org/). Now at [version 2.2.1](https://github.com/cakephp/cakephp/zipball/2.2.1) it comes with a variety of features to speed up your application development, including: @@ -10,7 +10,7 @@ If you're looking for a fast, light and effective PHP Framework for your project * Loads of plugins and add-ons * Easy to read documentation -In this tutorial, we're going to take you through deploying CakePHP v2.2.1 to [the cloudControl platform](http://www.cloudcontrol.com). +In this tutorial, we're going to take you through deploying CakePHP v2.2.1 to [the CloudKilat platform](http://www.CloudKilat.ch). ##Prerequisites @@ -23,20 +23,20 @@ You're going to need only a few things to following along with this tutorial. Th So now that you have the prerequisites in place, download a copy of the latest, stable, release, 2.2.1 at the time or publishing. You can find it at: [https://github.com/cakephp/cakephp/zipball/2.2.1](https://github.com/cakephp/cakephp/zipball/2.2.1). After that, extract it to your local file sytem. -![Source files](images/expanded-sourcefile.png) +![Source files](/static/apps/images/expanded-sourcefile.png) If you use an IDE, then it's best to open up the source as a project in it. In this tutorial, I'm using SublimeText2. ##2. Amend the Code -A few changes need to be made to the default CakePHP configuration and code to accommodate cloudControl deployment. These changes are as follows: +A few changes need to be made to the default CakePHP configuration and code to accommodate CloudKilat deployment. These changes are as follows: * Store session and log files in a database, not on the filesystem * Auto-magically determine the environment and set the configuration ###2.1 Store session and log files in a database, not on the filesystem -We need to do this because CakePHP, by default, stores its session files on the filesystem. However, this approach isn’t recommended on cloud platforms like cloudControl. +We need to do this because CakePHP, by default, stores its session files on the filesystem. However, this approach isn’t recommended on cloud platforms like CloudKilat. What's more, storing files in a multi-server environment can lead to hard to debug issues. So what we're going to do is to store both the session and log files in a two-level cache, composed of MySQL and APC. @@ -46,7 +46,7 @@ Thankfully, CakePHP is written in a very straight-forward and configurable manne As each environment will, likely, have different configuration settings, we also need to be able to differentiate between them. CakePHP does do this out of the box, but it's done by using different bootstrap files, such as **index.php**, **index-test.php** and so on. -On cloudControl, an app should programmatically know where it is and set the appropriate configuration options. That way, your code will run in every environment. So we're going to be making additions to the code so this happens auto-magically. +On CloudKilat, an app should programmatically know where it is and set the appropriate configuration options. That way, your code will run in every environment. So we're going to be making additions to the code so this happens auto-magically. ##3. Put the Code under Git Control @@ -74,23 +74,22 @@ That will show output similar to below: master * testing -I am using the application name ``cloudcontrolledcakephp`` in this example. You will of course have to use some different name. -Now, we need to make our first deployment of both branches to the cloudControl platform. To do this we checkout the master branch, create the application in our cloudControl account and push and deploy both deployments. +Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the CloudKilat platform. Now, we need to make our first deployment of both branches to the CloudKilat platform. To do this we checkout the master branch, create the application in our CloudKilat account and push and deploy both deployments. By running the following commands, this will all be done: // switch to the master branch git checkout master // create the application - cctrlapp cloudcontrolledcakephp create php + ironcliapp APP_NAME create php // deploy the default branch - cctrlapp cloudcontrolledcakephp/default push - cctrlapp cloudcontrolledcakephp/default deploy - + ironcliapp APP_NAME/default push + ironcliapp APP_NAME/default deploy + // deploy the testing branch - cctrlapp cloudcontrolledcakephp/testing push - cctrlapp cloudcontrolledcakephp/testing deploy + ironcliapp APP_NAME/testing push + ironcliapp APP_NAME/testing deploy ##4. Initialise the Required Add-ons @@ -101,16 +100,16 @@ Now that that's done, we need to configure two add-ons, config and mysqls. The c Now let's be sure that everything is in order by having a look at the add-on configuration output, in this case for testing. To do that, run the command below: // Initialise the mysqls.free addon for the default deployment - cctrlapp cloudcontrolledcakephp/default addon.add mysql.free + ironcliapp APP_NAME/default addon.add mysqls.free // Retrieve the settings - cctrlapp cloudcontrolledcakephp/default addon mysql.free + ironcliapp APP_NAME/default addon mysqls.free // Initialise the mysqls.free addon for the testing deployment - cctrlapp cloudcontrolledcakephp/testing addon.add mysql.free + ironcliapp APP_NAME/testing addon.add mysqls.free // Retrieve the settings - cctrlapp cloudcontrolledcakephp/testing addon mysql.free + ironcliapp APP_NAME/testing addon mysqls.free The output of the commands will be similar to that below: @@ -128,10 +127,10 @@ The output of the commands will be similar to that below: Now we need to configure the config add-on and store the respective environment setting in it. So run the following commands to do this: // Set the default environment setting - cctrlapp cloudcontrolledcakephp/default config.add CAKE_ENV=production + ironcliapp APP_NAME/default config.add CAKE_ENV=production // Set the testing environment setting - cctrlapp cloudcontrolledcakephp/testing config.add CAKE_ENV=testing + ironcliapp APP_NAME/testing config.add CAKE_ENV=testing Now that this is done, we're ready to make some changes to our code to make use of the new configuration. @@ -149,7 +148,7 @@ We then create a new class, **BASE_CONFIG**, that the database config, will late var $default = array(); -In the function, ``getEnvironmentName``, if we're not in a local, development, environment, as indicated by having '**localdomain**' in the URL, we retrieve [the credentials file](https://github.com/cloudControl/add_on_cred_file/blob/master/_config.php) from the environment, which is part of a standard cloudControl deployment. +In the function, ``getEnvironmentName``, if we're not in a local, development, environment, as indicated by having '**localdomain**' in the URL, we retrieve [the credentials file](https://github.com/cloudControl/add_on_cred_file/blob/master/_config.php) from the environment, which is part of a standard CloudKilat deployment. We then look in there for a value called **CAKE_ENV**, which determines the active environment and we store that in an application environment setting and return the value determined. @@ -176,7 +175,7 @@ We then look in there for a value called **CAKE_ENV**, which determines the acti return $environment; } -Now that we're able to know the environment that we're operating in, we setup the database configuration appropriately. If we're in development, then we use the development configuration in ``app/Config/database.php``. If we're not, then we retrieve the options from the ``CRED_FILE`` that is available to all cloudControl environments. +Now that we're able to know the environment that we're operating in, we setup the database configuration appropriately. If we're in development, then we use the development configuration in ``app/Config/database.php``. If we're not, then we retrieve the options from the ``CRED_FILE`` that is available to all CloudKilat environments. When we configured the add ons earlier (*mysqls* and *config*) the settings were automatically persisted to the running server environments. So we're now able to retrieve these settings, when we're not in a local development environment, and configure our database connection to use them. It's really handy as we don't need to do too much to make use of the options. @@ -235,7 +234,7 @@ An example is provided below: 'host' => 'localhost', 'login' => 'cc_dev', 'password' => 'cc _dev', - 'database' => 'cloudcontrol_cakephp', + 'database' => 'CloudKilat_cakephp', 'prefix' => '', 'encoding' => 'utf8', ); @@ -244,7 +243,7 @@ An example is provided below: ###5.2 app/Config/bootstrap.php -The bootstrap file is the core file managing the bootstrap process in CakePHP. By default, caching is using the filesystem as storage. What we're going to do is to make use of the built-in APC module that comes with cloudControl and store the cache information there. We could use Memcache, but for the purposes of this tutorial, we'll be using APC. +The bootstrap file is the core file managing the bootstrap process in CakePHP. By default, caching is using the filesystem as storage. What we're going to do is to make use of the built-in APC module that comes with CloudKilat and store the cache information there. We could use Memcache, but for the purposes of this tutorial, we'll be using APC. Go down in the file until you find a line similar to below: @@ -356,7 +355,7 @@ What this does is to extend the DatabaseSession class so that we can use both AP ##6. Database Schema -Ok, next we need to create a basic database schema for storing both the session and log information. To save time, add the following to a SQL file called ``cakephp_cloudcontrol_init.sql``, ready to be used to initialise the database next. +Ok, next we need to create a basic database schema for storing both the session and log information. To save time, add the following to a SQL file called ``cakephp_CloudKilat_init.sql``, ready to be used to initialise the database next. CREATE TABLE `cake_sessions` ( `id` varchar(255) NOT NULL DEFAULT '', @@ -393,7 +392,7 @@ Now, in the shell, we're going to load the data in to the remote mysql instance mysql -u -p \ -h mysqlsdb.co8hm2var4k9.eu-west-1.rds.amazonaws.com \ - --ssl-ca=mysql-ssl-ca-cert.pem < cakephp_cloudcontrol_init.sql + --ssl-ca=mysql-ssl-ca-cert.pem < cakephp_CloudKilat_init.sql In the command above, you can see a reference to a **.pem** file. This can be downloaded from: [http://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem](http://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem). All being well, the command will finish silently, loading the data. You can check that all's gone well with following commands: @@ -411,31 +410,25 @@ Now that that's done, commit the changes we made earlier and push and deploy bot git commit -m "changed to store log and session in mysql and auto-determine environment" // deploy the default branch - cctrlapp cloudcontrolledcakephp/default push - cctrlapp cloudcontrolledcakephp/default deploy + ironcliapp APP_NAME/default push + ironcliapp APP_NAME/default deploy git checkout testing git merge master // deploy the testing branch - cctrlapp cloudcontrolledcakephp/testing push - cctrlapp cloudcontrolledcakephp/testing deploy + ironcliapp APP_NAME/testing push + ironcliapp APP_NAME/testing deploy ##7. Review the Deployment With that completed, then have a look at both your deployments to ensure that they're working. -You should see output similar to that below, in figure 2. - -![Successful Deployment](images/cake-deployed-successfully.png) - ###7.1 Deployment Problems -If you see output similar to figure 3, then double check your database configuration settings and run through commit and deploy again. - -![Misconfigured Database](images/misconfigured-database.png) +If you see any errors, then double check your database configuration settings and run through commit and deploy again. -With that, you should be up and running, ready to create your next, amazing, PHP web application, using CakePHP. If you want to save yourself some time, you can clone a copy of the modified CakePHP source from the cloudControl Github repository. If you have any issues, feel free to email [support@cloudcontrol.com](mailto:support@cloudcontrol.com). +With that, you should be up and running, ready to create your next, amazing, PHP web application, using CakePHP. If you want to save yourself some time, you can clone a copy of the modified CakePHP source from the CloudKilat Github repository. If you have any issues, feel free to email [support@CloudKilat.ch](mailto:support@CloudKilat.ch). ##Links diff --git a/Guides/PHP/Drupal 7.md b/Guides/PHP/Drupal 7.md index 62f28d7..2f279ec 100644 --- a/Guides/PHP/Drupal 7.md +++ b/Guides/PHP/Drupal 7.md @@ -1,5 +1,5 @@ #Deploying Drupal 7 -![Successful Deployment](images/drupal7.png) +![Successful Deployment](/static/apps/images/drupal7.png) If you're looking for a flexible, friendly and powerful content management platform, built in PHP, for your projects, you really can't go past [Drupal](http://drupal.org/). Having been consistently growing and evolving since it was first created by Dries Buytaert in January 2001, Drupal 7 is the latest iteration and comes packed with a variety of features to speed up your application development, including: @@ -9,7 +9,7 @@ If you're looking for a flexible, friendly and powerful content management platf * Auto-update notification * Easy to read documentation -In this tutorial, we're going to take you through deploying Drupal 7 to [the cloudControl platform](http://www.cloudcontrol.com). +In this tutorial, we're going to take you through deploying Drupal 7 to [the CloudKilat platform](http://www.CloudKilat.ch). ##Prerequisites @@ -22,7 +22,7 @@ You're going to need only a few things to following along with this tutorial. Th So now that you have the prerequisites in place, download a copy of the latest, stable, release, 7.14 at the time or publishing. You can find it at: [http://ftp.drupal.org/files/projects/drupal-7.14.tar.gz](http://ftp.drupal.org/files/projects/drupal-7.14.tar.gz). After that, extract it to your local filesystem. -![Source files](images/drupal7-files.png) +![Source files](/static/apps/images/drupal7-files.png) After this, in your local development environment, perform a standard installation of Drupal, as covered in the [online installation documentation](http://drupal.org/documentation/install). @@ -64,22 +64,21 @@ That will show output similar to below: master * testing -I am using the application name ``cloudcontroldldrupal`` in this example. You will of course have to use some different name. -Now, we need to make our first deployment of both branches to the cloudControl platform. To do this we checkout the master branch, create the application in our cloudControl account and *push* and *deploy* both deployments. By running the following commands, this will all be done: +Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the CloudKilat platform. Now, we need to make our first deployment of both branches to the CloudKilat platform. To do this we checkout the master branch, create the application in our CloudKilat account and *push* and *deploy* both deployments. By running the following commands, this will all be done: // switch to the master branch git checkout master // create the application, indicating it's PHP-based - cctrlapp cloudcontroldldrupal create php + ironcliapp APP_NAME create php // deploy the default branch - cctrlapp cloudcontroldldrupal/default push - cctrlapp cloudcontroldldrupal/default deploy + ironcliapp APP_NAME/default push + ironcliapp APP_NAME/default deploy // deploy the testing branch - cctrlapp cloudcontroldldrupal/testing push - cctrlapp cloudcontroldldrupal/testing deploy + ironcliapp APP_NAME/testing push + ironcliapp APP_NAME/testing deploy ##4. Initialise the Required Addons @@ -90,16 +89,16 @@ Now that that's done, we need to configure two add-ons, config and mysqls. The c To initialise mysqls, run the following commands and make a note of the output: // Initialise the mysqls.free addon for the default deployment - cctrlapp cloudcontroldldrupal/default addon.add mysql.free + ironcliapp APP_NAME/default addon.add mysqls.free // Retrieve the settings - cctrlapp cloudcontroldldrupal/default addon mysql.free + ironcliapp APP_NAME/default addon mysqls.free // Initialise the mysqls.free addon for the testing deployment - cctrlapp cloudcontroldldrupal/testing addon.add mysql.free + ironcliapp APP_NAME/testing addon.add mysqls.free // Retrieve the settings - cctrlapp cloudcontroldldrupal/testing addon mysql.free + ironcliapp APP_NAME/testing addon mysqls.free The output of the commands will be similar to that below: @@ -117,10 +116,10 @@ The output of the commands will be similar to that below: Now we need to configure the config addon and store the respective environment setting in it. So run the following commands to do this: // Set the default environment setting - cctrlapp cloudcontroldldrupal/default config.add APPLICATION_ENV=production + ironcliapp APP_NAME/default config.add APPLICATION_ENV=production // Set the testing environment setting - cctrlapp cloudcontroldldrupal/testing config.add APPLICATION_ENV=testing + ironcliapp APP_NAME/testing config.add APPLICATION_ENV=testing Now that this is done, we're ready to make some changes to our code to make use of the new configuration. @@ -156,7 +155,7 @@ Have a look at it and we'll go through it together. Firstly, we set the environment to default to production. Then, if we're in a local development environment, as determined, rather simply, by having ``localdomain`` in the URL, then we set the environment to development. -Otherwise, we will retrieve the setting contained in the cloudControl credentials file setting, **APPLICATION_ENV**, that we set earlier with the config addon, which should be one of '**production**' or '**testing**'. +Otherwise, we will retrieve the setting contained in the CloudKilat credentials file setting, **APPLICATION_ENV**, that we set earlier with the config addon, which should be one of '**production**' or '**testing**'. With this code in place, we can now bootstrap multiple environments. Following this, we need to configure the database,. @@ -232,13 +231,15 @@ Two examples are provided below: ###6.3 Database Schema -Ok, next we need to create a basic database schema for storing the session and log information as well as the other configuration and user data settings that Drupal stores. Download [the file](drupal_cloudcontrol_init.sql), ready to be used to initialise the database. +Ok, next we need to create a basic database schema for storing the session and +log information as well as the other configuration and user data settings that +Drupal stores. Download [the file](/static/apps/drupal_CloudKilat_init.sql), ready to be used to initialise the database. Now, in the shell, we're going to load the data in to the remote mysql instance that we created earlier. To do so, run the following command, changing the respective options with your configuration settings, doing this for both **default** and **testing**: mysql -u -p \ -h mysqlsdb.co8hm2var4k9.eu-west-1.rds.amazonaws.com \ - --ssl-ca=mysql-ssl-ca-cert.pem < drupal_cloudcontrol_init.sql + --ssl-ca=mysql-ssl-ca-cert.pem < drupal_CloudKilat_init.sql In the command above, you can see a reference to a **.pem** file. This can be downloaded from: [http://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem](http://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem). All being well, the command will finish silently, loading the data. You can check that all's gone well with following commands: @@ -281,23 +282,19 @@ Now that that's done, commit the changes we made earlier and push and deploy bot git commit -m "changed to store log and session in mysql and auto-determine environment" // deploy the default branch - cctrlapp cloudcontroldlDrupal 7/default push - cctrlapp cloudcontroldlDrupal 7/default deploy + ironcliapp APP_NAME/default push + ironcliapp APP_NAME/default deploy git checkout testing git merge master // deploy the testing branch - cctrlapp cloudcontroldlDrupal 7/testing push - cctrlapp cloudcontroldlDrupal 7/testing deploy + ironcliapp APP_NAME/testing push + ironcliapp APP_NAME/testing deploy ##8. Review the Deployment With that completed, then you'll be able to have a look at both your deployments to ensure that they're working. -You should see output similar to that below, in figure 2. - -![Successful Deployment](images/drupal7-running.png) - -With that, you should be up and running, ready to create your next, amazing, PHP web application, using Drupal 7. If you have any issues, feel free to email [support@cloudcontrol.com](mailto:support@cloudcontrol.com). +With that, you should be up and running, ready to create your next, amazing, PHP web application, using Drupal 7. If you have any issues, feel free to email [support@cloudkilat.com](mailto:support@cloudkilat.com). diff --git a/Guides/PHP/HelloWorld.md b/Guides/PHP/HelloWorld.md index 3e1c4cc..d5c3241 100644 --- a/Guides/PHP/HelloWorld.md +++ b/Guides/PHP/HelloWorld.md @@ -1,10 +1,10 @@ -#Deploying a Silex application on cloudControl +#Deploying a Silex application on CloudKilat [Silex] is a PHP microframework for PHP 5.3. It is inspired by sinatra and built on the shoulders of Symfony2 and Pimple. In this tutorial we're going to show you how to deploy a Silex application on -[cloudControl]. You can find the [source code on Github][example-app] and check +[CloudKilat]. You can find the [source code on Github][example-app] and check out the [php buildpack] for supported features. @@ -67,14 +67,14 @@ DocumentRoot /app/www/web For more information check out [the buildpack documentation][php buildpack]. ## Pushing and Deploying the App -Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the cloudControl platform: +Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the CloudKilat platform: ~~~bash -$ cctrlapp APP_NAME create php +$ ironcliapp APP_NAME create php ~~~ Push your code to the application's repository, which triggers the deployment image build process: ~~~ -$ cctrlapp APP_NAME/default push +$ ironcliapp APP_NAME/default push Counting objects: 29, done. Delta compression using up to 4 threads. Compressing objects: 100% (21/21), done. @@ -99,24 +99,24 @@ Total 29 (delta 5), reused 18 (delta 0) -----> Building image -----> Uploading image (14M) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@kilatiron.net/repository.git * [new branch] master -> master ~~~ -Last but not least deploy the latest version of the app with the cctrlapp deploy command: +Last but not least deploy the latest version of the app with the ironcliapp deploy command: ~~~bash -$ cctrlapp APP_NAME/default deploy +$ ironcliapp APP_NAME/default deploy ~~~ -Congratulations, you can now see your Silex app running at `http[s]://APP_NAME.cloudcontrolled.com`. +Congratulations, you can now see your Silex app running at `http[s]://APP_NAME.kilatiron.net`. [silex]: http://silex.sensiolabs.org/ -[cloudControl]: http://www.cloudcontrol.com -[cloudControl-doc-user]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#user-accounts -[cloudControl-doc-cmdline]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#command-line-client-web-console-and-api "documentation of the cloudControl-command-line-client" +[CloudKilat]: http://www.cloudkilat.com/ +[CloudKilat-doc-user]: /Platform%20Documentation/#user-accounts +[CloudKilat-doc-cmdline]: /Platform%20Documentation/#command-line-client-web-console-and-api "documentation of the CloudKilat-command-line-client" [php buildpack]: https://github.com/cloudControl/buildpack-php -[procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#buildpacks-and-the-procfile +[procfile]: /Platform%20Documentation/#buildpacks-and-the-procfile [git]: https://help.github.com/articles/set-up-git [composer]: http://getcomposer.org/ [example-app]: https://github.com/cloudControl/php-silex-example-app diff --git a/Guides/PHP/Joomla 2.5.md b/Guides/PHP/Joomla 2.5.md index 0bd7a5c..12b50b7 100644 --- a/Guides/PHP/Joomla 2.5.md +++ b/Guides/PHP/Joomla 2.5.md @@ -1,6 +1,6 @@ -#Deploying Joomla 2.5 to cloudControl +#Deploying Joomla 2.5 to CloudKilat -![Successful Deployment](images/joomla-logo.png) +![Successful Deployment](/static/apps/images/joomla-logo.png) If you're looking for a fast, light and effective PHP Framework for your projects, you can't go past [Joomla](http://www.joomla.org/download.html). Now at [version 2.5](http://www.joomla.org/download.html) it comes with a variety of features to speed up your application development, including: @@ -10,7 +10,7 @@ If you're looking for a fast, light and effective PHP Framework for your project * Loads of plugins and add-ons * Easy to read documentation -In this tutorial, we're going to take you through deploying Joomla v2.5 to [the cloudControl platform](http://www.cloudcontrol.com). +In this tutorial, we're going to take you through deploying Joomla v2.5 to [the CloudKilat platform](http://www.CloudKilat.ch). ##Prerequisites @@ -23,7 +23,7 @@ You're going to need only a few things to following along with this tutorial. Th So now that you have the prerequisites in place, download a copy of the latest, stable, release. You can find it at: [http://www.joomla.org/download.html](http://www.joomla.org/download.html). After that, extract it to your local file sytem. -![Successful Deployment](images/joomla-source.png) +![Successful Deployment](/static/apps/images/joomla-source.png) ##Create a Basic Application @@ -32,7 +32,7 @@ Once you have a copy of the Joomla source available locally, setup a VHost (or e ##2. Update the Configuration -A few changes need to be made to the default Joomla configuration and code to accommodate cloudControl deployment. These changes are as follows: +A few changes need to be made to the default Joomla configuration and code to accommodate CloudKilat deployment. These changes are as follows: * Store sessions in the database * Store Cache Information in APC @@ -59,7 +59,7 @@ Click **Save & Close**. ###2.3 Update the Configuration Code -Joomla's core configuration file, ``configuration.php``, is updated whenever the details are changed in the administration panel as we just did. So, to retrieve the information from the cloudControl environment becomes a, little, bit tricky. +Joomla's core configuration file, ``configuration.php``, is updated whenever the details are changed in the administration panel as we just did. So, to retrieve the information from the CloudKilat environment becomes a, little, bit tricky. What we can do, though an impermanent solution if we're upgrading our version of Joomla, is to update the file that is responsible for writing the configuration.php file, so that though a new constructor it can elect to return either the original information or the retrieve the database data from the environment and return that instead. @@ -153,22 +153,21 @@ That will show output similar to below: master * testing -I am using the application name ``cloudcontroldljoomla`` in this example. You will of course have to use some different name. -Now, we need to make our first deployment of both branches to the cloudControl platform. To do this we checkout the master branch, create the application in our cloudControl account and push and deploy both deployments. By running the following commands, this will all be done: +Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the CloudKilat platform. Now, we need to make our first deployment of both branches to the CloudKilat platform. To do this we checkout the master branch, create the application in our CloudKilat account and push and deploy both deployments. By running the following commands, this will all be done: // switch to the master branch git checkout master // create the application - cctrlapp cloudcontroldljoomla create php + ironcliapp APP_NAME create php // deploy the default branch - cctrlapp cloudcontroldljoomla/default push - cctrlapp cloudcontroldljoomla/default deploy + ironcliapp APP_NAME/default push + ironcliapp APP_NAME/default deploy // deploy the testing branch - cctrlapp cloudcontroldljoomla/testing push - cctrlapp cloudcontroldljoomla/testing deploy + ironcliapp APP_NAME/testing push + ironcliapp APP_NAME/testing deploy ##4. Initialise the Required Add-ons @@ -179,16 +178,16 @@ Now that that's done, we need to configure two add-ons, config and mysqls. The c Now let's be sure that everything is in order by having a look at the add-on configuration output, in this case for testing. To do that, run the command below: // Initialise the mysqls.free addon for the default deployment - cctrlapp cloudcontroldljoomla/default addon.add mysql.free + ironcliapp APP_NAME/default addon.add mysqls.free // Retrieve the settings - cctrlapp cloudcontroldljoomla/default addon mysql.free + ironcliapp APP_NAME/default addon mysqls.free // Initialise the mysqls.free addon for the testing deployment - cctrlapp cloudcontroldljoomla/testing addon.add mysql.free + ironcliapp APP_NAME/testing addon.add mysqls.free // Retrieve the settings - cctrlapp cloudcontroldljoomla/testing addon mysql.free + ironcliapp APP_NAME/testing addon mysqls.free The output of the commands will be similar to that below: @@ -206,10 +205,10 @@ The output of the commands will be similar to that below: Now we need to configure the config add-on and store the respective environment setting in it. So run the following commands to do this: // Set the default environment setting - cctrlapp cloudcontroldljoomla/default config.add APPLICATION_ENV=production + ironcliapp APP_NAME/default config.add APPLICATION_ENV=production // Set the testing environment settings - cctrlapp cloudcontroldljoomla/testing config.add APPLICATION_ENV=testing + ironcliapp APP_NAME/testing config.add APPLICATION_ENV=testing Now that this is done, we're ready to make some changes to our code to make use of the new configuration. @@ -222,12 +221,12 @@ Where it may become interesting is if/when you start to use more than one clone Now, in the shell, we're going to dump the database that the install routine created and load it in to the remote mysql instance that we created earlier. To do so, run the following command, changing the respective options with your configuration settings, doing this for both default and testing: -- the database dump (SQL) file - mysqldump -u -p > joomla_cloudcontrol_init.sql + mysqldump -u -p > joomla_CloudKilat_init.sql -- load the database dump (SQL) file in to the remote environment database mysql -u -p \ -h mysqlsdb.co8hm2var4k9.eu-west-1.rds.amazonaws.com \ - --ssl-ca=mysql-ssl-ca-cert.pem < joomla_cloudcontrol_init.sql + --ssl-ca=mysql-ssl-ca-cert.pem < joomla_CloudKilat_init.sql In the command above, you can see a reference to a **.pem** file. This can be downloaded from: [http://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem](http://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem). All being well, the command will finish silently, loading the data. You can check that all's gone well with following commands: @@ -243,22 +242,19 @@ This will show you the tables from the SQL file. Now that that's done, commit th git commit -m "changed to store log and session in mysql and auto-determine environment" // deploy the default branch - cctrlapp cloudcontroldljoomla/default push - cctrlapp cloudcontroldljoomla/default deploy + ironcliapp APP_NAME/default push + ironcliapp APP_NAME/default deploy git checkout testing git merge master // deploy the testing branch - cctrlapp cloudcontroldljoomla/testing push - cctrlapp cloudcontroldljoomla/testing deploy + ironcliapp APP_NAME/testing push + ironcliapp APP_NAME/testing deploy ##7. Review the Deployment With that completed, then have a look at both your deployments to ensure that they're working. -You should see output similar to that below, in figure 2. - -![Successful Deployment](images/joomla-running.png) ###7.1 Deployment Problems @@ -268,11 +264,11 @@ To view the information, run the following commands respectively: ####7.1.1 Deployment - cctrlapp cloudcontroldljoomla/default log deploy + ironcliapp APP_NAME/default log deploy ####7.1.1 Errors - cctrlapp cloudcontroldljoomla/default log error + ironcliapp APP_NAME/default log error The commands output information in a [UNIX tail](http://en.wikipedia.org/wiki/Tail_%28Unix%29) like fashion. So just call them and cancel the commend when you are no longer interested in the output. diff --git a/Guides/PHP/Kohana 3.2.0.md b/Guides/PHP/Kohana 3.2.0.md index b3ae78c..444e350 100644 --- a/Guides/PHP/Kohana 3.2.0.md +++ b/Guides/PHP/Kohana 3.2.0.md @@ -1,6 +1,6 @@ #Deploying Kohana 3.2.0 -![Successful Deployment](images/kohana-homepage.png) +![Successful Deployment](/static/apps/images/kohana-homepage.png) If you're looking for a very fast, light, highly configurable and effective PHP Framework for your projects, look no further than [Kohana](http://kohanaframework.org/). Now at [version 3.2.0](http://dev.kohanaframework.org/attachments/download/1670/kohana-3.2.0.zip) it comes with a variety of features to speed up your application development, including: @@ -12,7 +12,7 @@ If you're looking for a very fast, light, highly configurable and effective PHP * The ability to add in 3rd party libraries, such as Zend Framework * Rich [HMVC](http://en.wikipedia.org/wiki/Hierarchical_model%E2%80%93view%E2%80%93controller) support -In this tutorial, we're going to take you through deploying Kohana 3.2.0 to [the cloudControl platform](http://www.cloudcontrol.com). If you need further information about Kohana, check out [the online user guide](http://kohanaframework.org/documentation) or jump in to [the IRC channel](irc://irc.freenode.net/kohana). Otherwise, let's get started. +In this tutorial, we're going to take you through deploying Kohana 3.2.0 to [the CloudKilat platform](http://www.cloudkilat.com/). If you need further information about Kohana, check out [the online user guide](http://kohanaframework.org/documentation) or jump in to [the IRC channel](irc://irc.freenode.net/kohana). Otherwise, let's get started. ##Prerequisites @@ -21,11 +21,11 @@ You're going to need only a few things to following along with this tutorial. Th * A [Git client](http://git-scm.com/), whether command-line or GUI. * A MySQL client, whether command-line or GUI, such as [MySQL Workbench](http://dev.mysql.com/downloads/workbench/) or the command-line tools. -##1. Grab a Copy of the Kohana code. +##1. Grab a Copy of the Kohana code. -Now that you have the prerequisites in place, download a copy of the latest, stable, release, 3.2.0 at the time or publishing. You can find it at: [http://dev.kohanaframework.org/attachments/download/1670/kohana-3.2.0.zip](http://dev.kohanaframework.org/attachments/download/1670/kohana-3.2.0.zip). After that, extract it to your local filesystem. +Now that you have the prerequisites in place, download a copy of the latest, stable, release, 3.2.0 at the time or publishing. You can find it at: [http://dev.kohanaframework.org/attachments/download/1670/kohana-3.2.0.zip](http://dev.kohanaframework.org/attachments/download/1670/kohana-3.2.0.zip). After that, extract it to your local filesystem. -![Source files](images/kohana-files.png) +![Source files](/static/apps/images/kohana-files.png) ##2. Amend the Code @@ -36,72 +36,71 @@ As I mentioned before, a few changes need to be made to the default Kohana confi ###2.1 Store Sessions in the Database -We need to do this because Kohana, by default, stores its session files on the filesystem. However, this approach isn't recommended on the cloudControl platform. +We need to do this because Kohana, by default, stores its session files on the filesystem. However, this approach isn't recommended on the CloudKilat platform. -What's more, storing files in a multi-server environment can lead to hard to debug issues. So what we're going to do is to store them in a MySQL database. +What's more, storing files in a multi-server environment can lead to hard to debug issues. So what we're going to do is to store them in a MySQL database. -Thankfully, Kohana is written in a very straight-forward and configurable manner, so this isn't too hard to do. What's more, the community around it is very healthy, so there's loads of options and support available when needed. +Thankfully, Kohana is written in a very straight-forward and configurable manner, so this isn't too hard to do. What's more, the community around it is very healthy, so there's loads of options and support available when needed. ###2.2 Auto-Magically Determine the Environment and Set the Configuration -As each environment will, likely, have different configuration settings, we also need to be able to differentiate between them. Kohana does do this out of the box, but it's done by using different bootstrap files, such as **index.php**, **index-test.php** and so on. +As each environment will, likely, have different configuration settings, we also need to be able to differentiate between them. Kohana does do this out of the box, but it's done by using different bootstrap files, such as **index.php**, **index-test.php** and so on. -On cloudControl, an app should programmatically know where it is and set the appropriate configuration options. That way, your code will run in every environment. So we're going to be making additions to the code so this happens auto-magically. +On CloudKilat, an app should programmatically know where it is and set the appropriate configuration options. That way, your code will run in every environment. So we're going to be making additions to the code so this happens auto-magically. ##3. Put the Code Under Git Control Ok, now let's get started making these changes to the application. We'll begin by putting it [under Git control](http://git-scm.com/). So run the following command to do that: cd - + git init . - + git add -A - + git commit -m "First addition of the source files" - + Now that the code's under version control, we're going to create a testing branch as well, so that we have one to test with and one for production. Run the following command and it will be done: git checkout -b testing - + If you're not familiar with Git, the previous command will checkout a copy of our existing branch, into a new branch, called *testing*. You can confirm that you now have two branches, by running the following command: git branch - + That will show output similar to below: $ git branch master * testing -I am using the application name ``cloudcontroldlkohana`` in this example. You will of course have to use some different name. -Now, we need to make our first deployment of both branches to the cloudControl platform. To do this we checkout the master branch, create the application in our cloudControl account and push and deploy both deployments. By running the following commands, this will all be done: +Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the CloudKilat platform. Now, we need to make our first deployment of both branches to the CloudKilat platform. To do this we checkout the master branch, create the application in our CloudKilat account and push and deploy both deployments. By running the following commands, this will all be done: // switch to the master branch git checkout master - + // create the application - cctrlapp cloudcontroldlkohana create php - + ironcliapp APP_NAME create php + // deploy the default branch - cctrlapp cloudcontroldlkohana/default push - cctrlapp cloudcontroldlkohana/default deploy - + ironcliapp APP_NAME/default push + ironcliapp APP_NAME/default deploy + // deploy the testing branch - cctrlapp cloudcontroldlkohana/testing push - cctrlapp cloudcontroldlkohana/testing deploy - + ironcliapp APP_NAME/testing push + ironcliapp APP_NAME/testing deploy + ###3.1 Kohana Auto-Detected When you do this, you'll see output similar to the following: - - $ cctrlapp cloudcontroldlkohana/default push + + $ ironcliapp APP_NAME/default push Counting objects: 9, done. Delta compression using up to 2 threads. Compressing objects: 100% (5/5), done. Writing objects: 100% (5/5), 489 bytes, done. Total 5 (delta 3), reused 0 (delta 0) - + >> Receiving push remote: No submodule mapping found in .gitmodules for path 'modules/kohana-cache' >> Compiling PHP @@ -109,8 +108,8 @@ When you do this, you'll see output similar to the following: INFO: Required directory missing, creating 'application/cache'. >> Building image >> Uploading image (772K) - - To ssh://cloudcontroldlkohana@cloudcontrolled.com/repository.git + + To ssh://APP_NAME@kilatiron.net/repository.git f98a87c..a685cd6 master -> master Note the following lines: @@ -118,53 +117,52 @@ Note the following lines: INFO: Kohana Framework detected INFO: Required directory missing, creating 'application/cache'. -Beginning with the **luigi** stack, a number of PHP frameworks, including Kohana, are auto-detected handling some of the deployment work for us, such as clearing/creating the cache directory. ##4. Initialise the Required Addons Now that that's done, we need to configure two addons, config and mysqls. The config addon's required for determining the active environment and mysqls for storing our session information. To initialise these, run the following commands and make a note of the output: // Initialise the mysqls.free addon for the default deployment - cctrlapp cloudcontroldlkohana/default addon.add mysqls.free + ironcliapp APP_NAME/default addon.add mysqls.free // Initialise the mysqls.free addon for the testing deployment - cctrlapp cloudcontroldlkohana/testing addon.add mysqls.free + ironcliapp APP_NAME/testing addon.add mysqls.free Now we need to configure the config addon and store the respective environment setting in it. So run the following commands to do this: // Add the APPLICATION_ENV variable to production - cctrlapp cloudcontroldlkohana/default config.add APPLICATION_ENV=production + ironcliapp APP_NAME/default config.add APPLICATION_ENV=production // Add the APPLICATION_ENV variable to testing - cctrlapp cloudcontroldlkohana/testing config.add APPLICATION_ENV=testing + ironcliapp APP_NAME/testing config.add APPLICATION_ENV=testing ###4.1 Check the Add-on Configuration Now let's be sure that everything is in order by having a look at the add-on configuration output, in this case for testing. To do that, run the command below: - + // Retrieve the settings - cctrlapp cloudcontroldlkohana/testing addon mysqls.free + ironcliapp APP_NAME/testing addon mysqls.free The output of the commands will be similar to that below: Addon : alias.free - + Addon : mysqls.free - + Settings MYSQLS_DATABASE : MYSQLS_PASSWORD : MYSQLS_PORT : 3306 MYSQLS_HOSTNAME : mysqlsdb.co8hm2var4k9.eu-west-1.rds.amazonaws.com MYSQLS_USERNAME : - + Addon : config.free - + Settings CONFIG_VARS : {u'APPLICATION_ENV': u'testing'} -Now that this is done, we're ready to make some changes to our code to make use of the new configuration. +Now that this is done, we're ready to make some changes to our code to make use of the new configuration. ##5. Environment Configuration @@ -174,43 +172,43 @@ In ``application/bootstrap.php``, search for the following line: { Kohana::$environment = constant('Kohana::'.strtoupper($_SERVER['KOHANA_ENV'])); } - + After you've found it, replace them with the following. I'll go through the code afterwards. - $env = Kohana::DEVELOPMENT; - + $env = Kohana::DEVELOPMENT; + if (!empty($_SERVER['HTTP_HOST']) && strpos($_SERVER['HTTP_HOST'], 'localdomain') === FALSE) { // Parse the json file with ADDONS credentials $string = file_get_contents($_ENV['CRED_FILE'], false); - + if ($string == false) { die('FATAL: Could not read credentials file'); } - + $creds = json_decode($string, true); - + // Now getenv('APPLICATION_ENV') should work: $environment = $creds['CONFIG']['CONFIG_VARS']['APPLICATION_ENV']; - - switch($environment) + + switch($environment) { case ('testing'): - $env = Kohana::TESTING; + $env = Kohana::TESTING; break; - + case ('staging'): - $env = Kohana::STAGING; + $env = Kohana::STAGING; break; - + case ('production'): default: $env = Kohana::PRODUCTION; } } - + Kohana::$environment = $env; -What that the code's completed for replacing the original environment configuration with one that is based on looking at the setting contained in the cloudControl credentials file setting, *APPLICATION_ENV*, that we set earlier. +What that the code's completed for replacing the original environment configuration with one that is based on looking at the setting contained in the CloudKilat credentials file setting, *APPLICATION_ENV*, that we set earlier. You'll notice that the we're using the Kohana environment constants, which you can find in ``/system/classes/kohana/core.php``. This way, the code can stay consistent throughout and we're not adding on any unnecessary complexity or reinventing the wheel. @@ -244,14 +242,14 @@ Basically, what this means is that none of the modules above are able to be used // 'userguide' => MODPATH.'userguide', // User guide and API documentation )); -Now we'll have both the cache and database modules available. As our example application is simple, this is all we'll need to enable. Leave everything else in the file as it is and let's move on to caching. +Now we'll have both the cache and database modules available. As our example application is simple, this is all we'll need to enable. Leave everything else in the file as it is and let's move on to caching. ###5.2 Configuring Caching Create a new file under ``application/config`` called ``cache.php``. In that file, add the following code: array @@ -310,7 +308,7 @@ Create a new file under ``application/config`` called ``database.php``. In that 'username' => 'cc_dev', 'password' => 'cc_dev', 'persistent' => FALSE, - 'database' => 'cloudcontrol_kohana', + 'database' => 'CloudKilat_kohana', ), 'table_prefix' => '', 'charset' => 'utf8', @@ -326,7 +324,7 @@ When we configured the add ons earlier (*mysqls* and *config*) the settings were Create a new file under ``application/config`` called ``session.php``. In that file, add the following code: array( @@ -348,7 +346,7 @@ What this does is to say that the session information will be stored in the data So your ``application/config`` directory should look like that below: -![Successful Deployment](images/kohana application-config dir.png) +![Successful Deployment](/static/apps/images/kohana application-config dir.png) ##6. Database Schema @@ -365,20 +363,20 @@ Ok, after all this is done, we need to load the database schema in to each of ou KEY `last_active` (`last_active`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; - + -- -- Dumping data for table `sessions` -- - + LOCK TABLES `sessions` WRITE; /*!40000 ALTER TABLE `sessions` DISABLE KEYS */; /*!40000 ALTER TABLE `sessions` ENABLE KEYS */; UNLOCK TABLES; - + -- -- Table structure for table `tblUsers` -- - + DROP TABLE IF EXISTS `tblUsers`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -390,39 +388,39 @@ Ok, after all this is done, we need to load the database schema in to each of ou PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; - + -- -- Dumping data for table `tblUsers` -- - + LOCK TABLES `tblUsers` WRITE; /*!40000 ALTER TABLE `tblUsers` DISABLE KEYS */; INSERT INTO `tblUsers` VALUES (1,'matthew','setter','ms@example.com'),(2,'don','bradman','db@example.com'),(3,'alan','border','ab@example.com'); /*!40000 ALTER TABLE `tblUsers` ENABLE KEYS */; UNLOCK TABLES; -What we have is a simple MySQL schema that creates two tables, one to store **session information** and one to store **users**, which we'll be using in our simple example application controller and view next. +What we have is a simple MySQL schema that creates two tables, one to store **session information** and one to store **users**, which we'll be using in our simple example application controller and view next. -We also load in a few users in to the users table as we're not going to create and forms to manage the information there, but want to have something to look at to confirm it's working. So store the schema in a file called ``kohana_cloudcontrol_init.sql``. +We also load in a few users in to the users table as we're not going to create and forms to manage the information there, but want to have something to look at to confirm it's working. So store the schema in a file called ``kohana_CloudKilat_init.sql``. Now, in the shell, we're going to load the schema in to the remote mysql instance that we created earlier with the mysqls add-on. To do so, run the following command, changing the respective options with your configuration settings: mysql -u -p \ -h mysqlsdb.co8hm2var4k9.eu-west-1.rds.amazonaws.com \ - --ssl-ca=mysql-ssl-ca-cert.pem < kohana_cloudcontrol_init.sql + --ssl-ca=mysql-ssl-ca-cert.pem < kohana_CloudKilat_init.sql In the command above, you can see a reference to a **.pem** file. This can be downloaded from: [http://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem](http://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem). All being well, the command will finish silently, loading the data. You can check that all's gone well with following commands: mysql -u -p \ -h mysqlsdb.co8hm2var4k9.eu-west-1.rds.amazonaws.com \ --ssl-ca=mysql-ssl-ca-cert.pem - + show tables; - + This should show you output similar to below: Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. - + mysql> show tables; +-----------------------+ | Tables_in_dep5jrx8a9a | @@ -430,83 +428,83 @@ This should show you output similar to below: | sessions | | tblUsers | +-----------------------+ - 2 rows in set (0.06 sec) + 2 rows in set (0.06 sec) ##Commit and Push the Code After all these changes are done, we need to then commit them on the master branch and merge the changes to the testing branch, we created earlier. To keep it simple, you can run the commands below: - git add application/config/database.php + git add application/config/database.php git add application/config/cache.php git add application/config/session.php git add application/bootstrap.php git commit -m "Updated to enable cache, database & session and auto-determine the environment" git checkout testing git merge master - + // push the code to the default (production) branch - cctrlapp cloudcontroldlkohana/default push - cctrlapp cloudcontroldlkohana/default deploy + ironcliapp APP_NAME/default push + ironcliapp APP_NAME/default deploy // push the code to the testing branch - cctrlapp cloudcontroldlkohana/testing push - cctrlapp cloudcontroldlkohana/testing deploy - + ironcliapp APP_NAME/testing push + ironcliapp APP_NAME/testing deploy + ##A Simple Application Now we're going to build a very simple application to test our new configuration and deployment. It will have only one controller and view. In the controller we're going to: * Get a handle on our database and perform some basic SQL * Create, store and manipulate a simple object in the cache - + Under ``application/classes/controller`` create a new controller file called ``hello.php``, which contains the following code: template->message = 'hello, world!'; - + // Change the default cache driver to memcache Cache::$default = 'apc'; - + // Create a new instance of cache using the default group $cache = Cache::instance(); - + // Create a cachable object $object = new stdClass; - + // Set a property $object->foo = 'bar'; - + // Cache the object using default group (quick interface) with default time (3600 seconds) Cache::instance()->set('foo', $object); - + print "Stored item in cache"; - + // If the cache key is available (with default value set to FALSE) if ($object = Cache::instance()->get('foo', FALSE)) { print "
Retrieved item from cache"; } else { print "
Didn't retrieve item from cache"; } - + // If the cache entry for 'foo' is deleted if (Cache::instance()->delete('foo')) { print '
Deleted the module'; } - + $results = DB::select('id', 'emailAddress')->from('tblUsers')->execute(); $this->template->users = $results->as_array(); } } - -What this does is to tell the controller that we're going to use a view template, called ``site.php`` that we'll create next. We then get a handle on the database configuration, based on the environment we've automatically determined and use the configured cache. + +What this does is to tell the controller that we're going to use a view template, called ``site.php`` that we'll create next. We then get a handle on the database configuration, based on the environment we've automatically determined and use the configured cache. After that, we create an object that we use to manipulate the cache and print out output showing how it worked, or not. After this, we select ``id`` and ``emailAddress`` from the table: ``tblUsers`` and return the information as a simple array and assign the value to a template variable called users. @@ -520,11 +518,11 @@ Now create a file called ``site.php`` under ``application/views/``. In it, add t -

Welcome to Kohana on cloudControl

+

Welcome to Kohana on CloudKilat

@@ -535,18 +533,16 @@ Now create a file called ``site.php`` under ``application/views/``. In it, add t - +
- -In this view file, we output some simple HTML and then iterate the value of the users that we retrieved in the controller before. All being well, you'll see output similar to that below. -![Successful Deployment](images/kohana-success-output.png) - +In this view file, we output some simple HTML and then iterate the value of the users that we retrieved in the controller before. Point your browser to `APP_NAME.kilatiron.net/hello.php` to see the result. + ##7. Review the Deployment -After this, add the files to git and commit them and push/deploy the changes out to both environments. From there you can review the testing and production deployments to ensure that they're working as well. +After this, add the files to git and commit them and push/deploy the changes out to both environments. From there you can review the testing and production deployments to ensure that they're working as well. -With that, you should be up and running, ready to create your next, amazing, PHP web application, using Kohana and cloudControl. If you have any issues, feel free to email [support@cloudcontrol.com](mailto:support@cloudcontrol.com). +With that, you should be up and running, ready to create your next, amazing, PHP web application, using Kohana and CloudKilat. If you have any issues, feel free to email [support@cloudkilat.com](mailto:support@cloudkilat.com). diff --git a/Guides/PHP/Symfony 1.4.md b/Guides/PHP/Symfony 1.4.md index b5f6419..5d181d8 100644 --- a/Guides/PHP/Symfony 1.4.md +++ b/Guides/PHP/Symfony 1.4.md @@ -1,6 +1,6 @@ -#Deploying Symfony 1.4 to cloudControl +#Deploying Symfony 1.4 to CloudKilat -![Successful Deployment](images/symfony1.4-homepage.png) +![Successful Deployment](/static/apps/images/symfony1.4-homepage.png) If you're looking for a feature-rich, open source, PHP Framework for your projects complete with a strong community, large variety of plugins and add-ons and a strong history of active development, you can't go past [Symfony 1](http://symfony.com/). It comes with a variety of features to speed up your application development, including: @@ -12,7 +12,7 @@ If you're looking for a feature-rich, open source, PHP Framework for your projec * Factories, plug-ins, and mixins * Built-in unit and functional testing framework -In this tutorial, we're going to take you through deploying CakePHP v2.2.1 to [the cloudControl platform](http://www.cloudcontrol.com). +In this tutorial, we're going to take you through deploying CakePHP v2.2.1 to [the CloudKilat platform](http://www.cloudkilat.com/). ##Prerequisites @@ -23,9 +23,9 @@ You're going to need only a few things to following along with this tutorial. Th ##1. Grab a Copy of Symfony -Now that you have the prerequisites in place, download a copy of the latest, stable, release of Symfony, **version 1.4** at the time or publishing. You can find it at: [http://www.symfony-project.org/installation/1_4](http://www.symfony-project.org/installation/1_4). After that, extract it to your local filesystem. +Now that you have the prerequisites in place, download a copy of the latest, stable, release of Symfony, **version 1.4** at the time or publishing. You can find it at: [http://www.symfony-project.org/installation/1_4](http://www.symfony-project.org/installation/1_4). After that, extract it to your local filesystem. -![Source files](images/symfony1-source.png) +![Source files](/static/apps/images/symfony1-source.png) ##2. Amend the Code @@ -38,11 +38,11 @@ As I mentioned before, a few changes need to be made to the default Symfony conf ###2.1 Store Sessions in the Database & Disable Logging -We need to do this because Symfony, by default, logs to and stores its session files on the filesystem. However, this approach recommended on the cloudControl platform. +We need to do this because Symfony, by default, logs to and stores its session files on the filesystem. However, this approach recommended on the CloudKilat platform. -What's more, storing files in a multi-server environment can lead to hard to debug issues. So what we're going to do is to store sessions in the database and disable logging. +What's more, storing files in a multi-server environment can lead to hard to debug issues. So what we're going to do is to store sessions in the database and disable logging. -Thankfully, Symfony is written in a very straight-forward and configurable manner, so this isn't too hard to do. What's more, the community around it is very healthy, so there's loads of options and support available. +Thankfully, Symfony is written in a very straight-forward and configurable manner, so this isn't too hard to do. What's more, the community around it is very healthy, so there's loads of options and support available. ###2.2 Auto-magically determine the environment and set the configuration @@ -53,63 +53,62 @@ As each environment will, likely, have different configuration settings, we also Ok, now let's get started making these changes and deploying the application. We'll begin by putting it under Git control. So run the following command to do that: cd - + git init . - + git add -A - + git commit -m "First addition of the source files" - + Now that the code's under version control, we're going to create a testing branch as well, so that we have one to test with and one for production. Run the following command and it will be done: git checkout -b testing - + If you're not familiar with Git, the previous command will checkout a copy of our existing branch, into a new branch, called ``testing``. You can confirm that you now have two branches, by running the following command: git branch - + That will show output similar to below: $ git branch master * testing -I am using the application name ``cloudcontroldlsymfony`` in this example. You will of course have to use some different name. -Now, we need to make our first deployment of both branches to the cloudControl platform. To do this we checkout the master branch, create the application in our cloudControl account and push and deploy both deployments. By running the following commands, this will all be done: +Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the CloudKilat platform. Now, we need to make our first deployment of both branches to the CloudKilat platform. To do this we checkout the master branch, create the application in our CloudKilat account and push and deploy both deployments. By running the following commands, this will all be done: // switch to the master branch git checkout master - + // create the application - cctrlapp cloudcontroldlsymfony create php - + ironcliapp APP_NAME create php + // deploy the default branch - cctrlapp cloudcontroldlsymfony/default push - cctrlapp cloudcontroldlsymfony/default deploy - + ironcliapp APP_NAME/default push + ironcliapp APP_NAME/default deploy + // deploy the testing branch - cctrlapp cloudcontroldlsymfony/testing push - cctrlapp cloudcontroldlsymfony/testing deploy + ironcliapp APP_NAME/testing push + ironcliapp APP_NAME/testing deploy ###3.1 Symfony Auto-Detected When you do this, you'll see output similar to the following: - $ cctrlapp cloudcontroldlsymfony/default push + $ ironcliapp APP_NAME/default push Counting objects: 15, done. Delta compression using up to 2 threads. Compressing objects: 100% (7/7), done. Writing objects: 100% (8/8), 1.23 KiB, done. Total 8 (delta 4), reused 0 (delta 0) - + >> Receiving push >> Compiling PHP INFO: Symfony 1.x detected INFO: No '.ccconfig.yaml' found, setting web content to '/web'. >> Building image >> Uploading image (3.0M) - - To ssh://cloudcontroldlsymfony@cloudcontrolled.com/repository.git + + To ssh://APP_NAME@kilatiron.net/repository.git d90506c..4078c78 master -> master Note the following lines: @@ -117,37 +116,36 @@ Note the following lines: INFO: Symfony 1.x detected INFO: No '.ccconfig.yaml' found, setting web content to '/web'. -In the previous version of the cloudControl platform, you would have had to have used a platform-specific config file called: ``.ccconfig.yaml`` and in it set the following: +In the previous version of the CloudKilat platform, you would have had to have used a platform-specific config file called: ``.ccconfig.yaml`` and in it set the following: BaseConfig: WebContent: /web -However, beginning with the **luigi** stack, that's a thing of the past for a number of PHP frameworks, including Symfony 1.x because it auto-detects it and handles this for us. ##4. Initialise the Required Add-ons -Now that that's done, we need to configure two add-ons, config and mysqls. The config Add-on is required for determining the active environment and mysqls for storing our session and logging information. +Now that that's done, we need to configure two add-ons, config and mysqls. The config Add-on is required for determining the active environment and mysqls for storing our session and logging information. ###4.1 Initialising mysqls To initialise mysqls, run the following commands and make a note of the output: // Initialise the mysqls.free addon for the default deployment - cctrlapp cloudcontroldlsymfony/default addon.add mysql.free - + ironcliapp APP_NAME/default addon.add mysqls.free + // Retrieve the settings - cctrlapp cloudcontroldlsymfony/default addon mysql.free + ironcliapp APP_NAME/default addon mysqls.free // Initialise the mysqls.free addon for the testing deployment - cctrlapp cloudcontroldlsymfony/testing addon.add mysql.free - + ironcliapp APP_NAME/testing addon.add mysqls.free + // Retrieve the settings - cctrlapp cloudcontroldlsymfony/testing addon mysql.free + ironcliapp APP_NAME/testing addon mysqls.free The output of the commands will be similar to that below: Addon : mysqls.free - + Settings MYSQLS_DATABASE : MYSQLS_PASSWORD : @@ -160,12 +158,12 @@ The output of the commands will be similar to that below: Now we need to configure the config addon and store the respective environment setting in it. So run the following commands to do this: // Set the default environment setting - cctrlapp cloudcontroldlsymfony/default config.add APPLICATION_ENV=production + ironcliapp APP_NAME/default config.add APPLICATION_ENV=production - // Set the testing environment setting - cctrlapp cloudcontroldlsymfony/testing config.add APPLICATION_ENV=testing + // Set the testing environment setting + ironcliapp APP_NAME/testing config.add APPLICATION_ENV=testing -Now that this is done, we're ready to make some changes to our code to make use of the new configuration. +Now that this is done, we're ready to make some changes to our code to make use of the new configuration. ##5. Environment Configuration @@ -187,7 +185,7 @@ Now you don't necessarily need to do this. I've done it because I'm more comfort In ``config/properties.ini``, look for the following line: orm=Doctrine - + Change it to: orm=Propel @@ -195,21 +193,21 @@ Change it to: ###5.3 Store Sessions in the Database Under ``apps/frontend/config`` open the file ``factories.yaml``. In that file, we need to adding in session configuration for both prod and test. These are identified by ``prod:`` and ``test:`` respectively. For each one, add in a configuration similar to that below, changing the respective details where necessary: - + storage: class: sfCacheSessionStorage param: - session_name: symfony1_cloudcontrol - session_cookie_path: / - session_cookie_domain: cloudcontroldlsymfony.cloudcontrolled.com + session_name: symfony1_CloudKilat + session_cookie_path: / + session_cookie_domain: APP_NAME.kilatiron.net session_cookie_lifetime: +30 days - session_cookie_secure: false + session_cookie_secure: false session_cookie_http_only: true cache: - class: sfAPCCache - param: ~ + class: sfAPCCache + param: ~ -What this has done is to tell Symfony to use the [sfCacheSessionStorage](http://www.symfony-project.org/api/1_4/sfCacheSessionStorage) to manage the session storage with the [sfAPCCache](http://www.symfony-project.org/api/1_4/sfAPCCache) class for physically storing the sessions. +What this has done is to tell Symfony to use the [sfCacheSessionStorage](http://www.symfony-project.org/api/1_4/sfCacheSessionStorage) to manage the session storage with the [sfAPCCache](http://www.symfony-project.org/api/1_4/sfAPCCache) class for physically storing the sessions. ###5.4 Disable Logging @@ -221,7 +219,7 @@ As we just did for session configuration, in factories.yaml, add in the followin level: err loggers: ~ -What this has done is to tell Symfony to use the [sfNoLogger](http://www.symfony-project.org/api/1_4/sfNoLogger) to manage logging, effectively throwing away the logs, like ``/dev/null`` on Linux/BSD. +What this has done is to tell Symfony to use the [sfNoLogger](http://www.symfony-project.org/api/1_4/sfNoLogger) to manage logging, effectively throwing away the logs, like ``/dev/null`` on Linux/BSD. ###5.5 Auto-Magically Determine the Environment and Set the Configuration @@ -235,30 +233,30 @@ And then replace it with the following $environment = 'prod'; $debug = false; - + if (!empty($_SERVER['HTTP_HOST']) && strpos($_SERVER['HTTP_HOST'], 'localdomain') === FALSE) { // Parse the json file with ADDONS credentials $string = file_get_contents($_ENV['CRED_FILE'], false); - + if ($string == false) { die('FATAL: Could not read credentials file'); } - + $creds = json_decode($string, true); $environment = $creds['CONFIG']['CONFIG_VARS']['CAKE_ENV']; } else { $environment = 'development'; } - + if ($environment == 'development') { $debug = true; } - + $configuration = ProjectConfiguration::getApplicationConfiguration( 'frontend', $environment, $debug ); -What that will do is, if we're not using the local development environment, determined by having ``localdomain`` in the url, then we will retrieve a copy of the credentials file from the environment settings, that comes with every cloudControl application deployment by default. +What that will do is, if we're not using the local development environment, determined by having ``localdomain`` in the url, then we will retrieve a copy of the credentials file from the environment settings, that comes with every CloudKilat application deployment by default. In there, we'll look for what the value of the **APPLICATION_ENV** config var is. If it's set, then we set the environment to be that. If it's not set, then we'll set the environment to ``prod``, so that we have a safe and sane default at all times. @@ -269,22 +267,22 @@ In ``config/databases.yml`` by default, Symfony will have the following settings all: doctrine: class: sfDoctrineDatabase - + What we're going to do is change it to have the values from our initialised mysqls.free add-on. So take the settings that you took note of earlier and change the file so that, with your settings, it looks similar to the configuration below: - + dev: propel: class: sfPropelDatabase param: classname: DebugPDO debug: { realmemoryusage: true, details: { time: { enabled: true }, slow: { enabled: true, threshold: 0.1 }, mem: { enabled: true }, mempeak: { enabled: true }, memdelta: { enabled: true } } } - dsn: 'mysql:host=localhost;dbname=cloudcontrol_symfony1' + dsn: 'mysql:host=localhost;dbname=CloudKilat_symfony1' username: cc_dev password: cc_dev encoding: utf8 persistent: true pooling: true - + test: propel: class: sfPropelDatabase @@ -297,7 +295,7 @@ What we're going to do is change it to have the values from our initialised mysq encoding: utf8 persistent: true pooling: true - + prod: propel: class: sfPropelDatabase @@ -310,7 +308,7 @@ What we're going to do is change it to have the values from our initialised mysq encoding: utf8 persistent: true pooling: true - + all: Please note that if you're using Doctrine, leave ``sfDoctrineDatabase`` in place instead of replacing it with ``sfPropelDatabase``. @@ -321,25 +319,22 @@ After this, stage all the files in Git and commit them with a suitable commit me git commit -m "changed to store log and session in mysql and auto-determine environment" // deploy the default branch - cctrlapp cloudcontroldlsymfony/default push - cctrlapp cloudcontroldlsymfony/default deploy - + ironcliapp APP_NAME/default push + ironcliapp APP_NAME/default deploy + git checkout testing git merge master - + // deploy the testing branch - cctrlapp cloudcontroldlsymfony/testing push - cctrlapp cloudcontroldlsymfony/testing deploy + ironcliapp APP_NAME/testing push + ironcliapp APP_NAME/testing deploy ##7. Review the Deployment -With that completed, then have a look at both your deployments to ensure that they're working. -You should see output similar to that below, in figure 2. - -![Successful Deployment](images/symfony1.png) +With that completed, then have a look at both your deployments to ensure that they're working. -With that, you should be up and running, ready to create your next, amazing, PHP web application, using Symfony. If you have any issues, feel free to email [support@cloudcontrol.com](mailto:support@cloudcontrol.com). +With that, you should be up and running, ready to create your next, amazing, PHP web application, using Symfony. If you have any issues, feel free to email [support@CloudKilat.ch](mailto:support@CloudKilat.ch). ##Links diff --git a/Guides/PHP/Yii 1.1.10.md b/Guides/PHP/Yii 1.1.10.md index 78effaa..f084508 100644 --- a/Guides/PHP/Yii 1.1.10.md +++ b/Guides/PHP/Yii 1.1.10.md @@ -1,6 +1,6 @@ -#Deploying Yii 1.1.10 to cloudControl +#Deploying Yii 1.1.10 to CloudKilat -![Successful Deployment](images/yii-framework-logo.png) +![Successful Deployment](/static/apps/images/yii-framework-logo.png) If you're looking for a lightning fast, light and effective PHP Framework for your projects, one without a lot of the cruft and legacy overhead of some of the other popular PHP frameworks available today, you can't go past [Yii Framework](http://www.yiiframework.com/). Now at [version 1.1.11](http://yii.googlecode.com/files/yii-1.1.11.58da45.tar.gz) it comes with a variety of features to speed up your application development, including: @@ -10,7 +10,7 @@ If you're looking for a lightning fast, light and effective PHP Framework for yo * Loads of plugins and add-ons * Easy to read documentation -In this tutorial, we're going to take you through deploying the Yii Framework v1.1.11 to [the cloudControl platform](http://www.cloudcontrol.com). +In this tutorial, we're going to take you through deploying the Yii Framework v1.1.11 to [the CloudKilat platform](http://www.cloudkilat.com/). ##Prerequisites @@ -19,85 +19,84 @@ You're going to need only a few things to following along with this tutorial. Th * A [Git client](http://git-scm.com/), whether command-line or GUI. * A MySQL client, whether command-line or GUI, such as [MySQL Workbench](http://dev.mysql.com/downloads/workbench/) or the command-line tools. -##1. Grab a Copy of the Yii Framework +##1. Grab a Copy of the Yii Framework -So now that you have the prerequisites in place, download a copy of the latest, stable, release. You can find it at: [http://yii.googlecode.com/files/yii-1.1.11.58da45.tar.gz](http://yii.googlecode.com/files/yii-1.1.11.58da45.tar.gz). After that, extract it to your local file sytem. +So now that you have the prerequisites in place, download a copy of the latest, stable, release. You can find it at: [http://yii.googlecode.com/files/yii-1.1.11.58da45.tar.gz](http://yii.googlecode.com/files/yii-1.1.11.58da45.tar.gz). After that, extract it to your local file sytem. -![Source files](images/yii-framework-source.png) +![Source files](/static/apps/images/yii-framework-source.png) ##Create a Basic Application -Ok, first things first, [follow the online tutorial](http://www.yiiframework.com/doc/guide/1.1/en/quickstart.installation) on the Yii site and create a simple application in your local development environment. Then, after you've done that, we're going to make a set of simple changes and you'll be ready to deploy your first application to cloudControl. +Ok, first things first, [follow the online tutorial](http://www.yiiframework.com/doc/guide/1.1/en/quickstart.installation) on the Yii site and create a simple application in your local development environment. Then, after you've done that, we're going to make a set of simple changes and you'll be ready to deploy your first application to CloudKilat. ##2. Amend the Code Ok, now that you have your test application created and running, we need to modify a few parts of the code. These changes are as follows: - * Store session information in APC + * Store session information in APC * Log messages in the database, not on the filesystem * Auto-magically determine the environment and set the configuration ###2.1 Store Session in the Cache Log Files in a Database, Not on the Filesystem -We need to do this because Yii Framework, by default, logs to and stores its session files on the filesystem. However, this approach isn't recommended on the cloudControl platform. +We need to do this because Yii Framework, by default, logs to and stores its session files on the filesystem. However, this approach isn't recommended on the CloudKilat platform. -What's more, storing files in a multi-server environment can lead to hard to debug issues. So what we're going to do is to store both the session and log files in a two-level cache, composed of MySQL and APC. +What's more, storing files in a multi-server environment can lead to hard to debug issues. So what we're going to do is to store both the session and log files in a two-level cache, composed of MySQL and APC. -Thankfully, Yii Framework is written in a very straight-forward and configurable manner, so this isn't too hard to do. What's more, the community around it is very healthy, so there's loads of options and support available. +Thankfully, Yii Framework is written in a very straight-forward and configurable manner, so this isn't too hard to do. What's more, the community around it is very healthy, so there's loads of options and support available. ###2.2 Auto-magically Determine the Environment and Set the Configuration -As each environment will, likely, have different configuration settings, we also need to be able to differentiate between them. Yii Framework does do this out of the box, but it's done by using different bootstrap files, such as ``index.php``, ``index-test.php`` and so on. +As each environment will, likely, have different configuration settings, we also need to be able to differentiate between them. Yii Framework does do this out of the box, but it's done by using different bootstrap files, such as ``index.php``, ``index-test.php`` and so on. -On cloudControl, an app should programmatically know where it is and set the appropriate configuration options. That way, your code will run in every environment. So we're going to be making additions to the code so this happens auto-magically. +On CloudKilat, an app should programmatically know where it is and set the appropriate configuration options. That way, your code will run in every environment. So we're going to be making additions to the code so this happens auto-magically. ##3. Put the Code Under Git Control Ok, now let's get started making these changes and deploying the application. We'll begin by putting it under Git control. So run the following command to do that: cd - + git init . - + git add -A - + git commit -m "First addition of the source files" - + Now that the code's under version control, we're going to create a testing branch as well, so that we have one to test with and one for production. Run the following command and it will be done: git checkout -b testing - + If you're not familiar with Git, the previous command will checkout a copy of our existing branch, into a new branch, called *testing*. You can confirm that you now have two branches, by running the following command: git branch - + That will show output similar to below: $ git branch master * testing -I am using the application name ``cloudcontroldlyii`` in this example. You will of course have to use some different name. -Now, we need to make our first deployment of both branches to the cloudControl platform. To do this we checkout the master branch, create the application in our cloudControl account and push and deploy both deployments. By running the following commands, this will all be done: +Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the CloudKilat platform. Now, we need to make our first deployment of both branches to the CloudKilat platform. To do this we checkout the master branch, create the application in our CloudKilat account and push and deploy both deployments. By running the following commands, this will all be done: // switch to the master branch git checkout master // create the application - cctrlapp cloudcontroldlyii create php + ironcliapp APP_NAME create php // deploy the default branch - cctrlapp cloudcontroldlyii/default push - cctrlapp cloudcontroldlyii/default deploy --stack luigi + ironcliapp APP_NAME/default push + ironcliapp APP_NAME/default deploy // deploy the testing branch - cctrlapp cloudcontroldlyii/testing push - cctrlapp cloudcontroldlyii/testing deploy --stack luigi + ironcliapp APP_NAME/testing push + ironcliapp APP_NAME/testing deploy You should see output as below: - $ cctrlapp cloudcontroldlyii/default push + $ ironcliapp APP_NAME/default push Counting objects: 2257, done. Delta compression using up to 2 threads. Compressing objects: 100% (2131/2131), done. @@ -112,28 +111,28 @@ You should see output as below: >> Building image >> Uploading image (4.1M) - To ssh://cloudcontroldlyii@cloudcontrolled.com/repository.git + To ssh://APP_NAME@kilatiron.net/repository.git * [new branch] master -> master ##4. Initialise the Required Add-ons -Now that that's done, we need to configure two add-ons, config and mysqls. The config Add-on is required for determining the active environment and mysqls for storing our session and logging information. +Now that that's done, we need to configure two add-ons, config and mysqls. The config Add-on is required for determining the active environment and mysqls for storing our session and logging information. ###4.1 Check the Add-on Configuration Now let's be sure that everything is in order by having a look at the add-on configuration output, in this case for testing. To do that, run the command below: // Initialise the mysqls.free addon for the default deployment - cctrlapp cloudcontroldlyii/default addon.add mysqls.free + ironcliapp APP_NAME/default addon.add mysqls.free // Retrieve the settings - cctrlapp cloudcontroldlyii/default addon mysqls.free + ironcliapp APP_NAME/default addon mysqls.free // Initialise the mysqls.free addon for the testing deployment - cctrlapp cloudcontroldlyii/testing addon.add mysqls.free + ironcliapp APP_NAME/testing addon.add mysqls.free // Retrieve the settings - cctrlapp cloudcontroldlyii/testing addon mysqls.free + ironcliapp APP_NAME/testing addon mysqls.free The output of the commands will be similar to that below: @@ -151,10 +150,10 @@ The output of the commands will be similar to that below: Now we need to configure the config add-on and store the respective environment setting in it. So run the following commands to do this: // Set the default environment setting - cctrlapp cloudcontroldlyii/default config.add APPLICATION_ENV=main + ironcliapp APP_NAME/default config.add APPLICATION_ENV=main // Set the testing environment setting - cctrlapp cloudcontroldlyii/testing config.add APPLICATION_ENV=testing + ironcliapp APP_NAME/testing config.add APPLICATION_ENV=testing Now that this is done, we're ready to make some changes to our code to make use of the new configuration. @@ -162,31 +161,31 @@ Now that this is done, we're ready to make some changes to our code to make use ###5.1 Bootstrap -By default, Yii comes with 3 bootstrap configuration files. Located in ``/protected/config`` the files are called ``console.php``, ``main.php`` and ``test.php``. They are the *console*, *production* and *testing* environment configurations, respectively. +By default, Yii comes with 3 bootstrap configuration files. Located in ``/protected/config`` the files are called ``console.php``, ``main.php`` and ``test.php``. They are the *console*, *production* and *testing* environment configurations, respectively. We need to change them slightly so that they'll do what we need. Have a look at the code below that will show, specifically, what we need to change. ####5.1.1 Load the Settings from the Environment - -We'll look specifically at main.php here, but you can change the other two files as well. We add the code below to the top of the file so that we are able to access the ``CRED_FILE`` variable. + +We'll look specifically at main.php here, but you can change the other two files as well. We add the code below to the top of the file so that we are able to access the ``CRED_FILE`` variable. When we configured the add ons earlier (mysqls and config) the settings were automatically persisted to the running server environments. So we’re now able to retrieve these settings and configure our database connection to use them. It’s really handy as we don’t need to do too much to make use of the options. if (!empty($_SERVER['HTTP_HOST']) && strpos($_SERVER['HTTP_HOST'], 'localdomain') === FALSE) { // Parse the json file with ADDONS credentials $string = file_get_contents($_ENV['CRED_FILE'], false); - + if ($string == false) { die('FATAL: Could not read credentials file'); } - + $creds = json_decode($string, true); } - + ####5.1.2 Enable the MySQL Database Configuration - + With the ``CRED_FILE`` information available, we set the database name, username, password and hostname automatically, as below: - + 'db'=>array( 'connectionString' => 'mysql:host=' . $creds["MYSQLS"]["MYSQLS_HOSTNAME"] . ';dbname=' . $creds["MYSQLS"]["MYSQLS_DATABASE"], 'emulatePrepare' => true, @@ -194,15 +193,15 @@ With the ``CRED_FILE`` information available, we set the database name, username 'password' => $creds["MYSQLS"]["MYSQLS_PASSWORD"], 'charset' => 'utf8', ), - + ####5.1.3 Enable Database Logging - -Now that the database is configured, we enable logging, with the CDbLogRoute class, specifying the connectionID to be that of our database, 'db'. Now, we have database logging enabled and ready. + +Now that the database is configured, we enable logging, with the CDbLogRoute class, specifying the connectionID to be that of our database, 'db'. Now, we have database logging enabled and ready. We also enable ``autoCreateLogTable``, which will create the database logging table automatically for us, if we don't initialise it with the SQL schema later. We're going to, but this way, you see that you don't have to as well as see the table schema. So whichever way you go, you're covered. -We're sticking with the default logging levels of error and warning. So if you want to have more levels enabled, please change this to suit your needs. - +We're sticking with the default logging levels of error and warning. So if you want to have more levels enabled, please change this to suit your needs. + 'log'=>array( 'class'=>'CLogRouter', 'routes'=>array( @@ -214,13 +213,13 @@ We're sticking with the default logging levels of error and warning. So if you w ), ), ), - + You can find out more about the class in [the online documentation](http://www.yiiframework.com/doc/api/1.1/CDbLogRoute/). - + ####5.1.4 Enable Caching with APC - + To enable caching of our applications, we then enable the 'cache' module using the ``system.caching.CApcCache`` class. With these done, we're just about ready to go. - + 'cache'=>array( 'class'=>'system.caching.CApcCache', ), @@ -232,38 +231,38 @@ You can find out more about the class in [the online documentation](http://www.y Initially, ``index.php`` will use the ``main.php`` configuration file as so: $config = dirname(__FILE__) . '/protected/config/main.php'; - + But we need to change that based on the environment we're in, as determined by the *APPLICATION_ENV* value we set with the configs add-on. So change ``index.php`` to be as follows: if (!empty($_SERVER['HTTP_HOST']) && strpos($_SERVER['HTTP_HOST'], 'localdomain') === FALSE) { // Parse the json file with ADDONS credentials $string = file_get_contents($_ENV['CRED_FILE'], false); - + if ($string == false) { die('FATAL: Could not read credentials file'); } - + $creds = json_decode($string, true); - + // Now getenv('APPLICATION_ENV') should work: $entryScript = $creds['CONFIG']['CONFIG_VARS']['APPLICATION_ENV']; - + } else { $entryScript = 'development'; } - + $config = dirname(__FILE__) . '/protected/config/' . $entryScript . '.php'; - + Now, ``index.php`` will load the configuration file based on *APPLICATION_ENV* automatically for us. ##6. Database Schema -Ok, next we need to create a basic database schema for storing both the session and log information. To save time, add the following to a SQL file called ``Yii Framework_cloudcontrol_init.sql``, ready to be used to initialise the database next. +Ok, next we need to create a basic database schema for storing both the session and log information. To save time, add the following to a SQL file called ``Yii Framework_CloudKilat_init.sql``, ready to be used to initialise the database next. -- -- Table structure for table `YiiLog` -- - + DROP TABLE IF EXISTS `YiiLog`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -276,11 +275,11 @@ Ok, next we need to create a basic database schema for storing both the session PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; - + -- -- Table structure for table `tbl_user` -- - + DROP TABLE IF EXISTS `tbl_user`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -297,17 +296,17 @@ Now, in the shell, we're going to load the data in to the remote mysql instance mysql -u -p \ -h mysqlsdb.co8hm2var4k9.eu-west-1.rds.amazonaws.com \ - --ssl-ca=mysql-ssl-ca-cert.pem < Yii Framework_cloudcontrol_init.sql + --ssl-ca=mysql-ssl-ca-cert.pem < Yii Framework_CloudKilat_init.sql In the command above, you can see a reference to a **.pem** file. This can be downloaded from: [http://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem](http://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem). All being well, the command will finish silently, loading the data. You can check that all's gone well with following commands: mysql -u -p \ -h mysqlsdb.co8hm2var4k9.eu-west-1.rds.amazonaws.com \ --ssl-ca=mysql-ssl-ca-cert.pem - + show tables; - -This will show you the tables from the SQL file. + +This will show you the tables from the SQL file. Now that that's done, commit the changes we made earlier and push and deploy both environments again so that the new information will be used. This can be done quickly with the following commands: @@ -315,22 +314,22 @@ Now that that's done, commit the changes we made earlier and push and deploy bot git commit -m "changed to store log and session in mysql and auto-determine environment" // deploy the default branch - cctrlapp cloudcontroldlyii/default push - cctrlapp cloudcontroldlyii/default deploy --stack luigi - + ironcliapp APP_NAME/default push + ironcliapp APP_NAME/default deploy + git checkout testing git merge master - + // deploy the testing branch - cctrlapp cloudcontroldlyii/testing push - cctrlapp cloudcontroldlyii/testing deploy --stack luigi + ironcliapp APP_NAME/testing push + ironcliapp APP_NAME/testing deploy ##7. Review the Deployment -With that completed, then have a look at both your deployments to ensure that they're working. +With that completed, then have a look at both your deployments to ensure that they're working. You should see output similar to that below, in figure 2. -![Successful Deployment](images/yii-framework-running.png) +![Successful Deployment](/static/apps/images/yii-framework-running.png) ###7.1 Deployment Problems @@ -340,22 +339,22 @@ To view the information, run the following commands respectively: ####7.1.1 Deployment - cctrlapp cloudcontroldlyii/default log deploy + ironcliapp APP_NAME/default log deploy ####7.1.1 Errors - cctrlapp cloudcontroldlyii/default log error + ironcliapp APP_NAME/default log error -The commands output information in a [UNIX tail](http://en.wikipedia.org/wiki/Tail_%28Unix%29) like fashion. So just call them and cancel the commend when you are no longer interested in the output. +The commands output information in a [UNIX tail](http://en.wikipedia.org/wiki/Tail_%28Unix%29) like fashion. So just call them and cancel the commend when you are no longer interested in the output. ##8. All done -With that, you should be up and running, ready to create your next, amazing, PHP web application, using Yii Framework. If you want to save yourself some time, you can clone a copy of the modified Yii Framework source from the cloudControl Github repository. If you have any issues, feel free to email [support@cloudcontrol.com](mailto:support@cloudcontrol.com). +With that, you should be up and running, ready to create your next, amazing, PHP web application, using Yii Framework. If you want to save yourself some time, you can clone a copy of the modified Yii Framework source from the CloudKilat Github repository. If you have any issues, feel free to email [support@cloudkilat.com](mailto:support@cloudkilat.com). ##Links - + * [Yii Framework](http://www.yiiframework.com/) * [Yii on Wikipedia](http://en.wikipedia.org/wiki/Yii) * [Yii on Twitter](https://twitter.com/yiiframework) * [Learning Yii from Larry Ullman](http://www.larryullman.com/series/learning-the-yii-framework/) - + diff --git a/Guides/PHP/Zend 2.md b/Guides/PHP/Zend 2.md index 1eb72c8..4d4725e 100644 --- a/Guides/PHP/Zend 2.md +++ b/Guides/PHP/Zend 2.md @@ -1,6 +1,6 @@ # Deploying a Zend2 Application -In this tutorial we're going to show you how to deploy a Zend2 application on [cloudControl]. +In this tutorial we're going to show you how to deploy a Zend2 application on [CloudKilat]. The [example app] is a ready to deploy fork of the official ZendSkeletonApplication available on [github](https://github.com/zendframework/ZendSkeletonApplication). @@ -87,7 +87,7 @@ function get_credentials() { $config = array(); -// If the app is running on the cloudControl PaaS read the credentials +// If the app is running on the CloudKilat PaaS read the credentials // from the environment. Local db credentials should be put in local.php if (isset($_ENV['CRED_FILE'])) { $config['db'] = get_credentials(); @@ -117,7 +117,7 @@ return $config; ### Store Sessions in the Database -Storing sessions on the local filesystem does not work well on a horizontally scaling platform like cloudControl. Additionally the filesystem on cloudControl is not persitent across deploys so all sessions are lost after each deploy. +Storing sessions on the local filesystem does not work well on a horizontally scaling platform like CloudKilat. Additionally the filesystem on CloudKilat is not persitent across deploys so all sessions are lost after each deploy. To avoid this, the app is preconfigured to store sessions using the previously configured connection in the database. @@ -143,16 +143,16 @@ class Module ~~~ ## Pushing and Deploying your App -Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the cloudControl platform: +Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the CloudKilat platform: ~~~bash -$ cctrlapp APP_NAME create php +$ ironcliapp APP_NAME create php ~~~ Push your code to the application's repository, which triggers the deployment image build process: ~~~bash -$ cctrlapp APP_NAME/default push +$ ironcliapp APP_NAME/default push Counting objects: 2208, done. Delta compression using up to 4 threads. Compressing objects: 100% (771/771), done. @@ -174,37 +174,37 @@ Total 2208 (delta 1087), reused 2208 (delta 1087) -----> Building image -----> Uploading image (3.1M) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@kilatiron.net/repository.git * [new branch] master -> master ~~~ -Last but not least deploy the latest version of the app with the cctrlapp deploy command: +Last but not least deploy the latest version of the app with the ironcliapp deploy command: ~~~bash -$ cctrlapp APP_NAME/default deploy +$ ironcliapp APP_NAME/default deploy ~~~ ## Add the Required MySQL Database Add-on and Initialize the Session Table To store the sessions we need to add a database Add-on and initialize the table. -We are going to use [the MySQLs Add-on's free plan](https://www.cloudcontrol.com/dev-center/Add-on%20Documentation/Data%20Storage/MySQLs). It provides a free shared database for testing and development. +We are going to use [the MySQLs Add-on's free plan](https://community.CloudKilat.ch/tutorial/mysqls-add-on/). It provides a free shared database for testing and development. Creating the session table is easy by executing the included init-session-table command in a run-container: ~~~bash # add the Add-on -$ cctrlapp APP_NAME/default addon.add mysqls.free +$ ironcliapp APP_NAME/default addon.add mysqls.free # initialize the session table -$ cctrlapp APP_NAME/default run "php code/public/index.php init-session-table" +$ ironcliapp APP_NAME/default run "php code/public/index.php init-session-table" Connecting... [SUCCESS] Session table created. -Connection to ssh.cloudcontrolled.net closed. +Connection to sshforwarder.kilatiron.net closed. ~~~ -Et voila, the app is now up and running at `http[s]://APP_NAME.cloudcontrolled.com`. +Et voila, the app is now up and running at `http[s]://APP_NAME.kilatiron.net`. [PHP buildpack]: https://github.com/cloudControl/buildpack-php -[cloudControl]: https://www.cloudcontrol.com/ +[CloudKilat]: http://www.cloudkilat.com/ [example app]: https://github.com/cloudControl/php-zend2-example-app.git diff --git a/Guides/PHP/Zend Framework 1.11.md b/Guides/PHP/Zend Framework 1.11.md index dafec51..feb5627 100644 --- a/Guides/PHP/Zend Framework 1.11.md +++ b/Guides/PHP/Zend Framework 1.11.md @@ -1,6 +1,6 @@ -#Deploying Zend Framework 1.11 to cloudControl +#Deploying Zend Framework 1.11 to CloudKilat -![Successful Deployment](images/ZendFramework-logo.png) +![Successful Deployment](/static/apps/images/ZendFramework-logo.png) If you're looking for a feature-rich, flexible and capable PHP Framework for your projects, you can't go past [Zend Framework](http://framework.zend.com/). Now at [version 1.11](http://framework.zend.com/download/latest) it comes with a variety of features to speed up your application development, including: @@ -10,7 +10,7 @@ If you're looking for a feature-rich, flexible and capable PHP Framework for you * Easy to read documentation * A super, shiny, new version 2 **coming soon** -In this tutorial, we're going to take you through deploying Zend Framework v1.11 to [the cloudControl platform](http://www.cloudcontrol.com). +In this tutorial, we're going to take you through deploying Zend Framework v1.11 to [the CloudKilat platform](http://www.cloudkilat.com/). ##Prerequisites @@ -19,11 +19,11 @@ You're going to need only a few things to following along with this tutorial. Th * A [Git client](http://git-scm.com/), whether command-line or GUI. * A MySQL client, whether command-line or GUI, such as [MySQL Workbench](http://dev.mysql.com/downloads/workbench/) or the command-line tools. -##1. Grab a Copy of Zend Framework +##1. Grab a Copy of Zend Framework -So now that you have the prerequisites in place, download a copy of the latest, stable, release. You can find it at: [http://framework.zend.com/download/latest](http://framework.zend.com/download/latest). After that, extract it to your local file system. +So now that you have the prerequisites in place, download a copy of the latest, stable, release. You can find it at: [http://framework.zend.com/download/latest](http://framework.zend.com/download/latest). After that, extract it to your local file system. -![Source files](images/zf-source-files.png) +![Source files](/static/apps/images/zf-source-files.png) ##Create a Basic Application @@ -36,16 +36,16 @@ With that, you'll have a basic application that can be run in a basic VHost. ##2. Amend the Code -As I mentioned before, a few changes need to be made to the default application configuration and code to accommodate cloudControl deployment. These changes are as follows: +As I mentioned before, a few changes need to be made to the default application configuration and code to accommodate CloudKilat deployment. These changes are as follows: * Store session and log files in a database, not on the filesystem * Auto-magically determine the environment and set the configuration ###2.1 Store Session and Log Files in a Database, Not on the Filesystem -Storing files in a multi-server environment can lead to hard to debug issues. So what we're going to do is to store both the session and log files in a two-level cache, composed of MySQL and APC. +Storing files in a multi-server environment can lead to hard to debug issues. So what we're going to do is to store both the session and log files in a two-level cache, composed of MySQL and APC. -Thankfully, Zend Framework is written in a very straight-forward and configurable manner, so this isn't too hard to do. What's more, the community around it is very healthy, so there's loads of options and support available. +Thankfully, Zend Framework is written in a very straight-forward and configurable manner, so this isn't too hard to do. What's more, the community around it is very healthy, so there's loads of options and support available. ###2.2 Auto-magically Determine the Environment and Set the Configuration @@ -55,91 +55,88 @@ If we were deploying the application in a simple, configurable VHost, then we'd SetEnv APPLICATION_ENV development -When using cloudControl, we need to do this in a slightly different way. It involves, for each environment, setting an environment variable with the cctrlapp config add-on, then reading that information from the environment at runtime. We'll come to this shortly. +When using CloudKilat, we need to do this in a slightly different way. It involves, for each environment, setting an environment variable with the ironcliapp config add-on, then reading that information from the environment at runtime. We'll come to this shortly. ##3. Put the Code Under Git Control Ok, now let's get started making these changes and deploying the application. We'll begin by putting it under Git control. So run the following command to do that: cd - + git init . - + git add -A - + git commit -m "First addition of the source files" - + Now that the code's under version control, we're going to create a testing branch as well, so that we have one to test with and one for production. Run the following command and it will be done: git checkout -b testing - + If you're not familiar with Git, the previous command will checkout a copy of our existing branch, into a new branch, called *testing*. You can confirm that you now have two branches, by running the following command: git branch - + That will show output similar to below: $ git branch master * testing -I am using the application name ``cloudcontroldlzf`` in this example. You will of course have to use some different name. -Now, we need to make our first deployment of both branches to the cloudControl platform. To do this we checkout the master branch, create the application in our cloudControl account and push and deploy both deployments. By running the following commands, this will all be done: +Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the CloudKilat platform. Now, we need to make our first deployment of both branches to the CloudKilat platform. To do this we checkout the master branch, create the application in our CloudKilat account and push and deploy both deployments. By running the following commands, this will all be done: // switch to the master branch git checkout master - + // create the application - cctrlapp cloudcontroldlzf create php - + ironcliapp APP_NAME create php + // deploy the default branch - cctrlapp cloudcontroldlzf/default push - cctrlapp cloudcontroldlzf/default deploy --stack luigi - + ironcliapp APP_NAME/default push + ironcliapp APP_NAME/default deploy + // deploy the testing branch - cctrlapp cloudcontroldlzf/testing push - cctrlapp cloudcontroldlzf/testing deploy --stack luigi + ironcliapp APP_NAME/testing push + ironcliapp APP_NAME/testing deploy You'll see output similar to the following: - $ cctrlapp cloudcontroldlzf/testing push + $ ironcliapp APP_NAME/testing push Total 0 (delta 0), reused 0 (delta 0) - + >> Receiving push >> Compiling PHP INFO: Zend Framework 1.x detected >> Building image >> Uploading image (3.6M) - - To ssh://cloudcontroldlzf@cloudcontrolled.com/repository.git - dde253a..7b040e2 testing -> testing -In the output above, you'll see ``INFO: Zend Framework 1.x detected``. This is the latest stack auto-identifying that the application we're deploying is based on the Zend Framework and will take care of ensuring it sees /public as the root directory to find the bootstrap file, ``index.php``, in. + To ssh://APP_NAME@kilatiron.net/repository.git + dde253a..7b040e2 testing -> testing ##4. Initialise the Required Add-ons -Now that that's done, we need to configure two add-ons, config and mysqls. The config add-on is required for determining the active environment and mysqls for storing our session and logging information. +Now that that's done, we need to configure two add-ons, config and mysqls. The config add-on is required for determining the active environment and mysqls for storing our session and logging information. ###4.1 Check the Add-on Configuration Now let's be sure that everything is in order by having a look at the add-on configuration output, in this case for testing. To do that, run the command below: // Initialise the mysqls.free addon for the default deployment - cctrlapp cloudcontroldlzf/default addon.add mysqls.free - + ironcliapp APP_NAME/default addon.add mysqls.free + // Retrieve the settings - cctrlapp cloudcontroldlzf/default addon mysqls.free + ironcliapp APP_NAME/default addon mysqls.free // Initialise the mysqls.free addon for the testing deployment - cctrlapp cloudcontroldlzf/testing addon.add mysqls.free - + ironcliapp APP_NAME/testing addon.add mysqls.free + // Retrieve the settings - cctrlapp cloudcontroldlzf/testing addon mysqls.free + ironcliapp APP_NAME/testing addon mysqls.free The output of the commands will be similar to that below: Addon : mysqls.free - + Settings MYSQLS_DATABASE : MYSQLS_PASSWORD : @@ -152,38 +149,38 @@ The output of the commands will be similar to that below: Now we need to configure the config add-on and store the respective environment setting in it. So run the following commands to do this: // Set the default environment setting - cctrlapp cloudcontroldlzf/default config.add APPLICATION_ENV=production + ironcliapp APP_NAME/default config.add APPLICATION_ENV=production // Set the testing environment setting - cctrlapp cloudcontroldlzf/testing config.add APPLICATION_ENV=testing + ironcliapp APP_NAME/testing config.add APPLICATION_ENV=testing -Now that this is done, we're ready to make some changes to our code to make use of the new configuration. +Now that this is done, we're ready to make some changes to our code to make use of the new configuration. ##5. Environment Configuration ###5.1 application.ini -In the ini file, below, we've laid out the core configuration, which will be inherited by all environments by default. You can see that the params have been left blank. This is because they're required. But you'll see in the plugin resource, later, that we set them appropriately. +In the ini file, below, we've laid out the core configuration, which will be inherited by all environments by default. You can see that the params have been left blank. This is because they're required. But you'll see in the plugin resource, later, that we set them appropriately. [production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 resources.frontController.params.displayExceptions = 1 -####5.1.1 Database - +####5.1.1 Database + ; Configure Database settings resources.db.adapter = PDO_MYSQL resources.db.isDefaultTableAdapter = true - resources.db.params.host = - resources.db.params.username = - resources.db.params.password = - resources.db.params.dbname = + resources.db.params.host = + resources.db.params.username = + resources.db.params.password = + resources.db.params.dbname = ####5.1.2 Session Storage - + In the section below, we've configured the session to be saved with the [Zend_Session_SaveHandler_DbTable](http://framework.zend.com/manual/en/zend.session.savehandler.dbtable.html) class. The table schema will be provided shortly. This uses the default database adapter to connect to the database, so no further configuration will be required on our part to make this work properly. - + ; Configure Zend_Session_SaveHandler_DbTable: resources.session.savehandler.class = "Zend_Session_SaveHandler_DbTable" resources.session.savehandler.options.name = "session" @@ -195,7 +192,7 @@ In the section below, we've configured the session to be saved with the [Zend_Se ####5.1.3 Caching In the section below, we've setup a simple cache option which we can use within the application. It has a simple set of frontend options and uses APC as the backend. As per the manual, we could also store the information in the backend, but for the purposes of this tutorial, APC will work just fine. - + ; Configure the frontend core caching option resources.cachemanager.general.frontend.name = Core resources.cachemanager.general.frontend.options.caching = true @@ -206,31 +203,31 @@ In the section below, we've setup a simple cache option which we can use within resources.cachemanager.general.frontend.options.automatic_serialization = true resources.cachemanager.general.frontend.options.automatic_cleaning_factor = 10 resources.cachemanager.general.frontend.options.ignore_user_abort = false - + ; Configure a simple APC cache resources.cachemanager.general.backend.name = Apc ###5.2 Bootstrap Plugin Resources Ok, let's start looking over the bootstrap plugin resources that will help us complete the setup of our application. - + ####5.2.1 Database - -In the database configuration, if we're **not** in the local development environment, we need to consult the ``CRED_FILE`` variable, available in all cloudControl environments, for the options for mysql. -When we configured the add ons earlier (**mysqls** and **config**) the settings were automatically persisted to the running server environments. So we’re now able to retrieve these settings and configure our database connection to make use of them. +In the database configuration, if we're **not** in the local development environment, we need to consult the ``CRED_FILE`` variable, available in all CloudKilat environments, for the options for mysql. + +When we configured the add ons earlier (**mysqls** and **config**) the settings were automatically persisted to the running server environments. So we’re now able to retrieve these settings and configure our database connection to make use of them. It’s really handy as we don’t need to do too much to make use of the options. To do this, we get a handle on the partly-configured database adapter and supplement the settings by calling the ``setParams`` method. Have a look through the code for the resource below to see how it works. - + protected function _initDb() { - // + // // Get a handle on the existing db plugin resource - // + // $dbPluginResource = $this->getPluginResource('db'); - + if (APPLICATION_ENV !=='development') { - + // // Read the environment credentials file // @@ -243,7 +240,7 @@ It’s really handy as we don’t need to do too much to make use of the options // Decode them from JSON // $creds = json_decode($string, true); - + // // Set the missing database settings with the retrieved options. // @@ -254,7 +251,7 @@ It’s really handy as we don’t need to do too much to make use of the options 'password' => $creds["MYSQLS"]["MYSQLS_PASSWORD"], )); } - + // // Set the fetch mode and store the resource in the app registry // @@ -265,36 +262,36 @@ It’s really handy as we don’t need to do too much to make use of the options Zend_Registry::set('db', $db); return $db; } - + return FALSE; } - + With this, we'll have a working database configuration. - + ####5.2.2 Logging -Despite the flexibility of the Zend Framework application.ini file, it doesn't have support for configuring database-based logging. So we need to do it in a plugin resource. You can see below that we get the application database adapter and then use it when initialising a new [Zend_Log_Writer_Db](http://framework.zend.com/manual/en/zend.log.writers.html#zend.log.writers.database) class. - - protected function _initLog() +Despite the flexibility of the Zend Framework application.ini file, it doesn't have support for configuring database-based logging. So we need to do it in a plugin resource. You can see below that we get the application database adapter and then use it when initialising a new [Zend_Log_Writer_Db](http://framework.zend.com/manual/en/zend.log.writers.html#zend.log.writers.database) class. + + protected function _initLog() { // // Get a handle on the db plugin resource // $dbPluginResource = $this->getPluginResource('db'); - + if (!is_null($dbPluginResource)) { $db = $this->getPluginResource('db')->getDbAdapter(); - - // + + // // Create a new Zend_Log_Writer_Db writer // $dbWriter = new Zend_Log_Writer_Db($db, 'log_table'); - + // // Register it with the logger // $logger = new Zend_Log($dbWriter); - + // // Store that in the registry // @@ -302,11 +299,11 @@ Despite the flexibility of the Zend Framework application.ini file, it doesn't h return $logger; } } - + ####5.2.3 Caching This is more of a utility method, for convenience within the application. We make the general ``cachemanager`` object we initialised in the application.ini file earlier available through a plugin resource. - + protected function _initCache() { try { @@ -315,17 +312,17 @@ This is more of a utility method, for convenience within the application. We mak // log error... } - if (!empty($bootstrapCacheMgr) && $bootstrapCacheMgr instanceof - Zend_Application_Bootstrap_BootstrapAbstract && - $bootstrapCacheMgr->hasResource('cachemanager')) + if (!empty($bootstrapCacheMgr) && $bootstrapCacheMgr instanceof + Zend_Application_Bootstrap_BootstrapAbstract && + $bootstrapCacheMgr->hasResource('cachemanager')) { - + // // Get a handle on the existing cache manager // $cacheManager = $bootstrapCacheMgr->getResource('cachemanager'); $generalCache = 'general'; - + if ($cacheManager->hasCache($generalCache)) { $cache = $cacheManager->getCache($generalCache); // Only attempt to cache the metadata if we have a cache available @@ -340,7 +337,7 @@ This is more of a utility method, for convenience within the application. We mak } } } - + ###5.3 index.php We then need to make an adjustment to the default ``index.php`` that comes with a standard Zend Framework installation, as created by ``zf.sh`` (or bat). @@ -350,15 +347,15 @@ Normally it looks like the below (formatted for readability): // Define path to application directory defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application')); - + // Define path to application directory defined('PROJECT_PATH') || define('PROJECT_PATH', realpath(dirname(__FILE__) . '/../')); - + // Define application environment defined('APPLICATION_ENV') - || define('APPLICATION_ENV', - (getenv('APPLICATION_ENV') + || define('APPLICATION_ENV', + (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production')); However, we need to make a small change, as highlighted below: @@ -366,30 +363,30 @@ However, we need to make a small change, as highlighted below: // Define path to application directory defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application')); - + if (!empty($_SERVER['HTTP_HOST']) && strpos($_SERVER['HTTP_HOST'], 'localdomain') === FALSE) { // Parse the json file with ADDONS credentials $string = file_get_contents($_ENV['CRED_FILE'], false); - + if ($string == false) { die('FATAL: Could not read credentials file'); } - + $creds = json_decode($string, true); - + // Now getenv('APPLICATION_ENV') should work: $environment = $creds['CONFIG']['CONFIG_VARS']['APPLICATION_ENV']; - - switch($environment) + + switch($environment) { case ('testing'): define('APPLICATION_ENV', 'testing'); break; - + case ('staging'): define('APPLICATION_ENV', 'staging'); break; - + case ('production'): default: define('APPLICATION_ENV', 'production'); @@ -397,15 +394,15 @@ However, we need to make a small change, as highlighted below: } else { define('APPLICATION_ENV', 'development'); } - + // Define application environment defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'production'); -What that does is to use the ``CRED_FILE`` settings that we configured earlier to help us determine the environment, ``APPLICATION_ENV``, that the application's operating within. +What that does is to use the ``CRED_FILE`` settings that we configured earlier to help us determine the environment, ``APPLICATION_ENV``, that the application's operating within. ##6. Database Schema -Ok, next we need to create a basic database schema for storing both the session and log information. To save time, add the following to a SQL file called ``zendframework_cloudcontrol_init.sql``, ready to be used to initialise the database next. +Ok, next we need to create a basic database schema for storing both the session and log information. To save time, add the following to a SQL file called ``zendframework_CloudKilat_init.sql``, ready to be used to initialise the database next. -- table structure CREATE TABLE `session` ( @@ -415,20 +412,20 @@ Ok, next we need to create a basic database schema for storing both the session `data` text, PRIMARY KEY (`id`) ); - + CREATE TABLE `log_table` ( `priority` varchar(50) default NULL, `message` varchar(100) default NULL, `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, `priorityName` varchar(40) default NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; - + CREATE TABLE `tbl_users` ( `first` varchar(50) default NULL, `last` varchar(100) default NULL, `username` varchar(40) default NULL ) ENGINE=InnoDB; - + -- add some records INSERT INTO tbl_users(first, last, username) VALUES('matthew', 'setter', 'settermjd'); @@ -436,17 +433,17 @@ Now, in the shell, we're going to load the data in to the remote mysql instance mysql -u -p \ -h mysqlsdb.co8hm2var4k9.eu-west-1.rds.amazonaws.com \ - --ssl-ca=mysql-ssl-ca-cert.pem < zendframework_cloudcontrol_init.sql + --ssl-ca=mysql-ssl-ca-cert.pem < zendframework_CloudKilat_init.sql In the command above, you can see a reference to a **.pem** file. This can be downloaded from: [http://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem](http://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem). All being well, the command will finish silently, loading the data. You can check that all's gone well with following commands: mysql -u -p \ -h mysqlsdb.co8hm2var4k9.eu-west-1.rds.amazonaws.com \ --ssl-ca=mysql-ssl-ca-cert.pem - + show tables; - -This will show you the tables from the SQL file. + +This will show you the tables from the SQL file. Now that that's done, commit the changes we made earlier and push and deploy both environments again so that the new information will be used. This can be done quickly with the following commands: @@ -454,23 +451,23 @@ Now that that's done, commit the changes we made earlier and push and deploy bot git commit -m "changed to store log and session in mysql and auto-determine environment" // deploy the default branch - cctrlapp cloudcontroldlzf/default push - cctrlapp cloudcontroldlzf/default deploy --stack luigi - + ironcliapp APP_NAME/default push + ironcliapp APP_NAME/default deploy + git checkout testing git merge master - + // deploy the testing branch - cctrlapp cloudcontroldlzf/testing push - cctrlapp cloudcontroldlzf/testing deploy --stack luigi + ironcliapp APP_NAME/testing push + ironcliapp APP_NAME/testing deploy ##7. Review the Deployment -With that completed, then have a look at both your deployments to ensure that they're working. +With that completed, then have a look at both your deployments to ensure that they're working. You should see output similar to that below, in figure 2. -![Successful Deployment](images/zf-deployed.png) +![Successful Deployment](/static/apps/images/zf-deployed.png) ###7.1 Deployment Problems @@ -480,15 +477,15 @@ To view the information, run the following commands respectively: ####7.1.1 Deployment - cctrlapp cloudcontroldlzf/default log deploy + ironcliapp APP_NAME/default log deploy ####7.1.1 Errors - cctrlapp cloudcontroldlzf/default log error + ironcliapp APP_NAME/default log error -The commands output information in a [UNIX tail](http://en.wikipedia.org/wiki/Tail_%28Unix%29) like fashion. So just call them and cancel the commend when you are no longer interested in the output. +The commands output information in a [UNIX tail](http://en.wikipedia.org/wiki/Tail_%28Unix%29) like fashion. So just call them and cancel the commend when you are no longer interested in the output. ##Links - + * [Zend_Log_Writer_Db - Customising table columns](http://www.webeks.net/php/zend-log-writer-db-customising-table-columns.html) * [Logging in Zend Framework (Zend_Log & Zend_Log_Writer_Db)](http://mnshankar.wordpress.com/tag/zend_log_writer_db/) diff --git a/Guides/PHP/drupal_cloudcontrol_init.sql b/Guides/PHP/drupal_cloudkilat_init.sql similarity index 99% rename from Guides/PHP/drupal_cloudcontrol_init.sql rename to Guides/PHP/drupal_cloudkilat_init.sql index 27102a2..9388758 100644 --- a/Guides/PHP/drupal_cloudcontrol_init.sql +++ b/Guides/PHP/drupal_cloudkilat_init.sql @@ -1,6 +1,6 @@ -- MySQL dump 10.13 Distrib 5.1.62, for debian-linux-gnu (x86_64) -- --- Host: localhost Database: cloudcontrol_drupal +-- Host: localhost Database: exoscale_drupal -- ------------------------------------------------------ -- Server version 5.1.62-0ubuntu0.11.10.1-log diff --git a/Guides/Python/AWS S3.md b/Guides/Python/AWS S3.md index d56846b..75f93f0 100644 --- a/Guides/Python/AWS S3.md +++ b/Guides/Python/AWS S3.md @@ -21,10 +21,10 @@ boto==2.9.8 ## Example usage: -The recommended way to provide your AWS credentials to your app is via environment variables. To do this, use the [Config Add-on](https://www.cloudcontrol.com/dev-center/Add-on%20Documentation/Deployment/Custom%20Config): +The recommended way to provide your AWS credentials to your app is via environment variables. To do this, use the [Config Add-on](/Add-on%20Documentation/Deployment/Custom%20Config.md): ~~~bash -$ cctrlapp APP_NAME/default config.add AWS_SECRET_KEY=[YOUR_SECRET_KEY] AWS_ACCESS_KEY=[YOUR_ACCESS_KEY] +$ ironcliapp APP_NAME/default config.add AWS_SECRET_KEY=[YOUR_SECRET_KEY] AWS_ACCESS_KEY=[YOUR_ACCESS_KEY] ~~~ Now let's show some operations on buckets and objects: diff --git a/Guides/Python/Add-on credentials.md b/Guides/Python/Add-on credentials.md index 3d0e0c8..5063f8c 100644 --- a/Guides/Python/Add-on credentials.md +++ b/Guides/Python/Add-on credentials.md @@ -13,7 +13,7 @@ By default, all the Add-on credentials can be found in a provided JSON file, which path is exposed in the `CRED_FILE` environment variable. You can see the format of that file locally with the command: ~~~bash -$ cctrlapp APP_NAME/DEP_NAME addon.creds +$ ironcliapp APP_NAME/DEP_NAME addon.creds ~~~ You can use the following code wherever you want to get the credentials in your @@ -43,7 +43,7 @@ Some examples for database Add-ons can be seen in the last section. The default for Python is to not expose Add-on credentials as environment variables. To overwrite this default use the following command: ~~~bash -$ cctrlapp APP_NAME/DEP_NAME config.add SET_ENV_VARS +$ ironcliapp APP_NAME/DEP_NAME config.add SET_ENV_VARS ~~~ You can look up the individual environment variable names in the respective @@ -55,13 +55,12 @@ available in your deployment containers. # Examples -cloudControl offers a number of data storage solutions via the [Add-on Marketplace]. -Below you can see how to access Add-on credentials on two examples for MySQL -and PostgreSQL. +CloudKilat offers a number of data storage solutions via the [Add-on Marketplace]. +Below you can see how to access Add-on credentials for MySQL. ## MySQL -To add a MySQL database, use the [MySQL Dedicated Add-on] or [MySQL Shared Add-on]. +To add a MySQL database, use the [MySQL Shared Add-on]. Here's a Python snippet that reads the database settings from the credentials file and stores them in the `db_config` dictionary: @@ -73,45 +72,19 @@ cred_file = open(os.environ['CRED_FILE']) creds = json.load(cred_file) db_config = { - 'database': creds['MYSQLD']['MYSQLD_DATABASE'], - 'host': creds['MYSQLD']['MYSQLD_HOST'], - 'port': creds['MYSQLD']['MYSQLD_PORT'], - 'username': creds['MYSQLD']['MYSQLD_USER'], - 'password': creds['MYSQLD']['MYSQLD_PASSWORD'] + 'database': creds['MYSQLS']['MYSQLS_DATABASE'], + 'host': creds['MYSQLS']['MYSQLS_HOST'], + 'port': creds['MYSQLS']['MYSQLS_PORT'], + 'username': creds['MYSQLS']['MYSQLS_USER'], + 'password': creds['MYSQLS']['MYSQLS_PASSWORD'] } ~~~ -The example used the MySQLd Add-on. Variable names for MySQLs differ. Remember, -you can always refer to the `addon.creds` command to see the actual variable +Remember, you can always refer to the `addon.creds` command to see the actual variable names and values. -## PostgreSQL - -To add a PostgreSQL database, use the [ElephantSQL Add-on]. - -With this Python snippet you can read the PostgreSQL settings and store them in -the `db_config` dictionary: -~~~python -import os -import json - -cred_file = open(os.environ['CRED_FILE']) -creds = json.load(cred_file) -elephant_uri = urlparse(creds['ELEPHANTSQL']['ELEPHANTSQL_URL']) - -db_config = { - 'database': elephant_uri.path[1:], - 'host': elephant_uri.hostname, - 'port': elephant_uri.port, - 'username': elephant_uri.username, - 'password': elephant_uri.password -} -~~~ - -[env-vars]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#environment-variables -[Add-on credentials]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-on-credentials -[Add-on Marketplace]: https://www.cloudcontrol.com/add-ons/ -[Custom Config Add-on]: https://www.cloudcontrol.com/add-ons/config -[MySQL Dedicated Add-on]: https://www.cloudcontrol.com/add-ons/mysqld -[MySQL Shared Add-on]: https://www.cloudcontrol.com/add-ons/mysqls -[ElephantSQL Add-on]: https://www.cloudcontrol.com/add-ons/elephantsql +[env-vars]: /Platform%20Documentation.md/#environment-variables +[Add-on credentials]: /Platform%20Documentation.md/#add-on-credentials +[Add-on Marketplace]: http://www.cloudkilat.com/ +[Custom Config Add-on]: /Add-on%20Documentation/Deployment/Custom%20Config.md +[MySQL Shared Add-on]: /Add-on%20Documentation/Data%20Storage/MySQLs.md diff --git a/Guides/Python/Celery.md b/Guides/Python/Celery.md deleted file mode 100644 index 687de82..0000000 --- a/Guides/Python/Celery.md +++ /dev/null @@ -1,219 +0,0 @@ -# Deploying Celery on cloudControl -[Celery] is an asynchronous task queue/job queue based on distributed message passing. It is focused on real-time operation, but supports scheduling as well. - -In this tutorial we're going to show you how to deploy an example Celery app using the [CloudAMQP Add-on] and the [Worker Add-on] on [cloudControl]. - -## The Example App Explained -First, lets clone the example code from Github. It is based on the official [first steps with Celery guide][celeryguide] and also includes [Flower] the Celery web interface. - -~~~bash -$ git clone git://github.com/cloudControl/python-celery-example-app.git -$ cd python-celery-example-app -~~~ - -The code from the example repository is ready to be deployed. Lets still go through the different files and their purpose real quick. - -### Dependency Tracking -The [Python buildpack] tracks dependencies via pip and the `requirements.txt` file. It needs to be placed in the root directory of your repository. Our example app requires both `celery` itself aswell as `flower` Celery's monitoring web app. The `requirements.txt` you cloned as part of the example app looks like this: - -~~~pip -celery==3.0.15 -flower==0.4.2 -~~~ - -### Process Type Definition -cloudControl uses a [Procfile] to know how to start the app's processes. - -The example code also already includes a file called `Procfile` at the top level of your repository. It looks like this: - -~~~ -web: celery flower --port=$PORT --broker=$CLOUDAMQP_URL --auth=$FLOWER_AUTH_EMAIL -worker: celery -A tasks worker --loglevel=info -~~~ - -We have specified two process types here. One called `web` to start the web interface and additionally one called `worker` used to start the actual Celery worker. - -### The Celery Task - -The task is copied from the official Celery tutorial and simply returns the sum of two numbers. It was adjusted to read the Add-on credentials from the runtime environment. - -~~~python -import json -from os import getenv - -from celery import Celery - -# read credentials from runtime environment -amqp_url = getenv('CLOUDAMQP_URL') - -celery = Celery('tasks', broker=amqp_url) - - -@celery.task -def add(x, y): - return x + y -~~~ - -## Creating the App and Adding the Required Add-ons -Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the cloudControl platform: - -~~~bash -$ cctrlapp APP_NAME create python -~~~ - -As we chose to use AMQP as a broker, we add the CloudAMQP Add-on now. - -~~~bash -$ cctrlapp APP_NAME/default addon.add cloudamqp.lemur -~~~ - -We also need to add the Worker Add-on to be able to start the workers later. - -~~~bash -$ cctrlapp APP_NAME/default addon.add worker.single -~~~ - -Since we are reading the AMQP URL for the broker from the environment in both, the `Procfile` and the Python code we have to enable providing Add-on credentials as environment variables which is disabled per default for Python apps. - -We also set another environment variable called `FLOWER_AUTH_EMAIL` that is passed to the Flower web process for authentication purposes. Without this, the web interface would be public showing your secret AMQP credentials and allowing people to stop your workers. - -~~~bash -$ cctrlapp APP_NAME/default addon.add config.free --SET_ENV_VARS --FLOWER_AUTH_EMAIL=YOUR_EMAIL_HERE -# seperate multiple emails by comma -~~~ - -This is it. The example code will now find all necessary credentials to connect to the AMQP service automatically in the runtime environment. - -## Pushing and Deploying the App -Now lets push your code to the application's repository, which triggers the deployment image build process. Your output will look similiar to the following, although we have shortened it for the sake of readability in this guide. - -The first push will take a couple of seconds, because it will download and compile and install a number of dependencies. So please be patient. Dependencies will be cached for future pushes significantly speeding up the process. - -~~~bash -$ cctrlapp APP_NAME/default push -Counting objects: 6, done. -Delta compression using up to 4 threads. -Compressing objects: 100% (4/4), done. -Writing objects: 100% (6/6), 605 bytes, done. -Total 6 (delta 0), reused 0 (delta 0) - ------> Receiving push ------> Preparing Python interpreter (2.7.2) ------> Creating Virtualenv version 1.7.2 - New python executable in .heroku/venv/bin/python2.7 - Also creating executable in .heroku/venv/bin/python - Installing distribute..................................................................................................................................................................................................done. - Installing pip................done. - Running virtualenv with interpreter /usr/bin/python2.7 ------> Activating virtualenv ------> Installing dependencies using pip version 1.2.1 - - [...] - - Successfully installed celery flower billiard python-dateutil kombu tornado anyjson amqp - Cleaning up... ------> Building image ------> Uploading image (4.3M) - -To ssh://APP_NAME@cloudcontrolled.com/repository.git - * [new branch] master -> master -~~~ - -Last but not least deploy the latest version of the app with the cctrlapp deploy command. - -~~~bash -$ cctrlapp APP_NAME/default deploy -~~~ - -At this point you can see web interface at `http://APP_NAME.cloudcontrolled.com`. But it hasn't got any workers yet. - -## Scaling Celery Workers -Scaling Celery workers on cloudControl is easy enough luckily. We have already defined how to run one in the `Procfile` earlier. So we can now go ahead and start the first one. - -### Adding Workers - -~~~bash -$ cctrlapp APP_NAME/default worker.add worker -# you can always list running workers like this -$ cctrlapp APP_NAME/default worker -# and also check the worker's log output with -$ cctrlapp APP_NAME/default log worker -[TIMESTAMP] WRK_ID Started worker (command: 'celery -A tasks worker --loglevel=info ', parameter: '') -[TIMESTAMP] WRK_ID -[TIMESTAMP] WRK_ID -------------- celery@HOSTNAME v3.0.15 (Chiastic Slide) -[TIMESTAMP] WRK_ID ---- **** ----- -[TIMESTAMP] WRK_ID --- * *** * -- [Configuration] -[TIMESTAMP] WRK_ID -- * - **** --- . broker: amqp://CLOUDAMQP_URL -[TIMESTAMP] WRK_ID - ** ---------- . app: tasks:0x1357890 -[TIMESTAMP] WRK_ID - ** ---------- . concurrency: 2 (processes) -[TIMESTAMP] WRK_ID - ** ---------- . events: OFF (enable -E to monitor this worker) -[TIMESTAMP] WRK_ID - ** ---------- -[TIMESTAMP] WRK_ID - *** --- * --- [Queues] -[TIMESTAMP] WRK_ID -- ******* ---- . celery: exchange:celery(direct) binding:celery -[TIMESTAMP] WRK_ID --- ***** ----- -[TIMESTAMP] WRK_ID -[TIMESTAMP] WRK_ID [Tasks] -[TIMESTAMP] WRK_ID . tasks.add -[TIMESTAMP] WRK_ID [TIMESTAMP: WARNING/MainProcess] celery@HOSTNAME ready. -[TIMESTAMP] WRK_ID [TIMESTAMP: INFO/MainProcess] consumer: Connected to amqp://CLOUDAMQP_URL -[TIMESTAMP] WRK_ID [TIMESTAMP: INFO/MainProcess] Events enabled by remote. -~~~ - -If you refresh the web interface at `http://APP_NAME.cloudcontrolled.com` you should be able to see the worker now. - -To handle more tasks simultaneously you can always just add more workers. (Please note that only the first worker is free, adding additional workers requires a billing account.) - -~~~bash -# call worker.add to start additional workers one at a time -$ cctrlapp APP_NAME/default worker.add worker -~~~ - -### Removing Workers - -To stop a worker you can stop it from the command line. - -~~~bash -# use the worker list command to get the WRK_ID -$ cctrlapp APP_NAME/default worker -$ cctrlapp APP_NAME/default worker.remove WRK_ID -~~~ - -You can also stop the Celery worker from the web interface, which will also stop the container. Check the worker log output for details. - -~~~bash -$ cctrlapp APP_NAME/default log worker -[...] -[TIMESTAMP] WRK_ID [TIMESTAMP: WARNING/MainProcess] Got shutdown from remote -[TIMESTAMP] WRK_ID Container stopped -[TIMESTAMP] WRK_ID Stopping worker by itself -[TIMESTAMP] WRK_ID Worker removed by itself -~~~ - -## Celery Commands - -To run Celery commands use the cctrlapp run command. It will launch an additional container and connect you via SSH. You can then use the Celery commands in the an identical environment as the web interface and the workers itself. - -~~~bash -$ cctrlapp APP_NAME/default run bash -Connecting... -USER@HOSTNAME:~/www$ celery --broker=$CLOUDAMQP_URL status --> WORKER_HOSTNAME: OK - -1 node online. -USER@HOSTNAME:~/www$ exit -Connection to ssh.cloudcontrolled.net closed. -~~~ - -## Résumé - -This guide showed how to run both Flower aswell as a Celery worker on cloudControl by specifying the commands in the `Procfile` and how to connect to a AMQP broker provided by the CloudAMQP Add-on with the credentials provided in the app's runtime environment. Additionally we learned how we can use the cctrlapp run command to use the Celery command line tool. - -[Celery]: http://celeryproject.org/ -[CloudAMQP Add-on]: https://www.cloudcontrol.com/add-ons/cloudamqp -[Worker Add-on]: https://www.cloudcontrol.com/add-ons/worker -[cloudControl]: http://www.cloudcontrol.com -[celeryguide]: http://docs.celeryproject.org/en/latest/getting-started/first-steps-with-celery.html -[Flower]: http://docs.celeryproject.org/en/latest/userguide/monitoring.html#flower-real-time-celery-web-monitor -[Python buildpack]: https://github.com/cloudControl/buildpack-python -[Procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#buildpacks-and-the-procfile - diff --git a/Guides/Python/Django notes.md b/Guides/Python/Django notes.md index eb7df02..e7a952e 100644 --- a/Guides/Python/Django notes.md +++ b/Guides/Python/Django notes.md @@ -1,11 +1,11 @@ # Notes for Django Developers -This document contains information for Django programmers deploying their applications on [cloudControl]. +This document contains information for Django programmers deploying their applications on [CloudKilat]. ## Managing Dependencies The [python buildpack] uses [pip] to manage dependencies. Specify your dependencies in a file called `requirements.txt` in the project root directory. ## Defining the Process Type -cloudControl uses a [Procfile][procfile] to know how to start your processes. This file specifies a _web_ command that will be executed to start the server once the app is deployed. It optionally also specifies [worker] types that can be used to execute long running tasks. +CloudKilat uses a [Procfile][procfile] to know how to start your processes. This file specifies a _web_ command that will be executed to start the server once the app is deployed. It optionally also specifies [worker] types that can be used to execute long running tasks. The `Procfile` for a Django app using gunicorn as web server can look like this: ~~~ @@ -16,21 +16,17 @@ manage: python manage.py ## Executing Management Tasks Use the `run` command to execute tasks like `syncdb`. This starts an interactive [SSH-session]. ~~~bash -cctrlapp APP_NAME/DEP_NAME run "python manage.py syncdb" +ironcliapp APP_NAME/DEP_NAME run "python manage.py syncdb" ~~~ ## Databases -To use a database, you should choose an Add-on from [the Data Storage category][data-storage-addons]. To get the credentials of your database, refer to the [Add-on credentials][add-on-credentials] article. +To use a database, have a look at the [Shared MySQL Add-on][Shared MySQL Add-on]. To get the credentials of your database, refer to the [Add-on credentials][add-on-credentials] article. -## Email -You can't use a local SMTP server, instead choose one of our [email Add-ons][messaging-addons]. - -[SSH-session]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#secure-shell-ssh +[SSH-session]: /Platform%20Documentation.md/#secure-shell-ssh [python buildpack]: https://github.com/cloudControl/buildpack-python [pip]: http://www.pip-installer.org/ -[procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#buildpacks-and-the-procfile -[messaging-addons]: https://www.cloudcontrol.com/dev-center/Add-on%20Documentation/Messaging%20&%20Mobile/ -[data-storage-addons]: https://www.cloudcontrol.com/dev-center/Add-on%20Documentation/Data%20Storage/ -[add-on-credentials]: https://www.cloudcontrol.com/dev-center/Guides/Python/Add-on%20credentials -[cloudControl]: https://www.cloudcontrol.com/ -[worker]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#scheduled-jobs-and-background-workers +[procfile]: /Platform%20Documentation.md/#buildpacks-and-the-procfile +[Shared MySQL Add-on]: /Add-on%20Documentation/Data%20Storage/MySQLs.md +[add-on-credentials]: /Guides/Python/Add-on%20credentials.md +[CloudKilat]: http://www.cloudkilat.com/ +[worker]: /Add-on%20Documentation/Data%20Processing/Worker.md diff --git a/Guides/Python/Django.md b/Guides/Python/Django.md index 873df06..b0ef2b6 100644 --- a/Guides/Python/Django.md +++ b/Guides/Python/Django.md @@ -1,6 +1,6 @@ # Deploying a Django Application -In this tutorial we're going to show you how to deploy a Django application on [cloudControl]. You can find the [source code on Github][example-app] and check out the [Python buildpack][python buildpack] for supported features. The application follows the official [Django tutorial] and allows you to create, use and manage simple polls. +In this tutorial we're going to show you how to deploy a Django application on [CloudKilat]. You can find the [source code on Github][example-app] and check out the [Python buildpack][python buildpack] for supported features. The application follows the official [Django tutorial] and allows you to create, use and manage simple polls. ## The Django Application Explained @@ -37,7 +37,7 @@ INSTALLED_APPS = ( ### Process Type Definition -cloudControl uses a [Procfile] to know how to start your processes. The example code already includes a file called Procfile at the top level of your repository. It looks like this: +CloudKilat uses a [Procfile] to know how to start your processes. The example code already includes a file called Procfile at the top level of your repository. It looks like this: ~~~ web: python manage.py run_gunicorn -b 0.0.0.0:$PORT @@ -47,7 +47,7 @@ Left from the colon we specified the **required** process type called `web` foll ### Production Database -The original tutorial application uses SQLite as the database in all environments, even the production one. It is not possible to use a SQLite database on cloudControl because the filesystem is [not persistent][filesystem]. To use a database, you should choose an Add-on from [the Data Storage category][data-storage-addons]. +The original tutorial application uses SQLite as the database in all environments, even the production one. It is not possible to use a SQLite database on CloudKilat because the filesystem is [not persistent][filesystem]. To use a database, you should choose a data storage Add-on from [the available addons][data-storage-addons]. In this tutorial we use the [Shared MySQL Add-on][mysqls]. Have a look at `mysite/settings.py` so you can find out how to [get the MySQL credentials][get-conf] provided by MySQLs Add-on: @@ -87,16 +87,16 @@ DATABASES = { ## Pushing and Deploying your App -Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the cloudControl platform: +Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the CloudKilat platform: ~~~bash -$ cctrlapp APP_NAME create python +$ ironcliapp APP_NAME create python ~~~ Push your code to the application's repository, which triggers the deployment image build process: ~~~bash -$ cctrlapp APP_NAME/default push +$ ironcliapp APP_NAME/default push Counting objects: 31, done. Delta compression using up to 8 threads. Compressing objects: 100% (25/25), done. @@ -115,44 +115,45 @@ Total 31 (delta 3), reused 24 (delta 0) -----> Building image -----> Uploading image (30M) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@kilatiron.net/repository.git * [new branch] master -> master ~~~ Add MySQLs Add-on with `free` plan to your deployment and deploy it: ~~~bash -$ cctrlapp APP_NAME/default addon.add mysqls.free -$ cctrlapp APP_NAME/default deploy +$ ironcliapp APP_NAME/default addon.add mysqls.free +$ ironcliapp APP_NAME/default deploy ~~~ Finally, prepare the database using the [Run command][ssh-session] (when prompted create admin user): ~~~bash -$ cctrlapp APP_NAME/default run "python manage.py syncdb" +$ ironcliapp APP_NAME/default run "python manage.py syncdb" ~~~ -You can login to the admin console at `APP_NAME.cloudcontrolled.com/admin`, create some polls and see them at `APP_NAME.cloudcontrolled.com/polls`. +You can login to the admin console at `APP_NAME.kilatiron.net/admin`, create some polls and see them at `APP_NAME.kilatiron.net/polls`. For additional information take a look at [Django Notes][django-notes] and other [python-specific documents][python-guides]. [django]: https://www.djangoproject.com/ -[cloudControl]: http://www.cloudcontrol.com -[cloudControl-doc-user]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#user-accounts -[cloudControl-doc-cmdline]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#command-line-client-web-console-and-api -[Procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#buildpacks-and-the-procfile +[CloudKilat]: http://www.cloudkilat.com/ +[CloudKilat]: http://www.cloudkilat.com/ +[CloudKilat-doc-user]: /Platform%20Documentation.md/#user-accounts +[CloudKilat-doc-cmdline]: /Platform%20Documentation.md/#command-line-client-web-console-and-api +[Procfile]: /Platform%20Documentation.md/#buildpacks-and-the-procfile [git]: https://help.github.com/articles/set-up-git -[filesystem]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#non-persistent-filesystem -[data-storage-addons]: https://www.cloudcontrol.com/dev-center/Add-on%20Documentation/Data%20Storage/ -[mysqls]: https://www.cloudcontrol.com/dev-center/Add-on%20Documentation/Data%20Storage/MySQLs +[filesystem]: /Platform%20Documentation.md/#non-persistent-filesystem +[data-storage-addons]: /Add-on%20Documentation/Data%20Storage +[mysqls]: /Add-on%20Documentation/Data%20Storage/MySQLs.md [example-app]: https://github.com/cloudControl/python-django-example-app -[django-notes]: https://www.cloudcontrol.com/dev-center/Guides/Python/Django%20notes -[get-conf]: https://www.cloudcontrol.com/dev-center/Guides/Python/Add-on%20credentials +[django-notes]: /Guides/Python/Django%20notes.md +[get-conf]: /Guides/Python/Add-on%20credentials.md [Django tutorial]: https://docs.djangoproject.com/en/1.4/intro/tutorial01/ -[python-guides]: https://www.cloudcontrol.com/dev-center/Guides/Python +[python-guides]: /Guides/Python [python buildpack]: https://github.com/cloudControl/buildpack-python [pip]: http://www.pip-installer.org/ [gunicorn]: http://gunicorn.org/ -[worker]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#scheduled-jobs-and-background-workers +[worker]: /Platform%20Documentation.md/#scheduled-jobs-and-background-workers [db-commit]: https://github.com/cloudControl/python-django-example-app/commit/983f45e46ce0707476cec167ea062e19adcb53c9 -[ssh-session]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#secure-shell-ssh +[ssh-session]: /Platform%20Documentation.md/#secure-shell-ssh [mysql-driver]: https://pypi.python.org/pypi/MySQL-python/1.2.4 diff --git a/Guides/Python/HelloWorld.md b/Guides/Python/HelloWorld.md index 14b598f..4d545f1 100644 --- a/Guides/Python/HelloWorld.md +++ b/Guides/Python/HelloWorld.md @@ -3,7 +3,7 @@ intentions. In this tutorial we're going to show you how to deploy a Flask -application on [cloudControl]. You can find the [source code on Github][example_app] and check out the [Python buildpack] for +application on [CloudKilat]. You can find the [source code on Github][example_app] and check out the [Python buildpack] for supported features. ## The Flask App Explained @@ -26,7 +26,7 @@ Flask==0.9 ~~~ ### Process Type Definition -cloudControl uses a [Procfile] to know how to start your processes. +CloudKilat uses a [Procfile] to know how to start your processes. The example code already includes a file called `Procfile` at the top level of your repository. It looks like this: @@ -37,16 +37,16 @@ web: python server.py Left from the colon we specified the **required** process type called `web` followed by the command that starts the app and listens on the port specified by the environment variable `$PORT`. ## Pushing and Deploying the App -Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the cloudControl platform: +Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the CloudKilat platform: ~~~bash -$ cctrlapp APP_NAME create python +$ ironcliapp APP_NAME create python ~~~ Push your code to the application's repository, which triggers the deployment image build process: ~~~bash -$ cctrlapp APP_NAME/default push +$ ironcliapp APP_NAME/default push Counting objects: 16, done. Delta compression using up to 4 threads. Compressing objects: 100% (10/10), done. @@ -66,21 +66,21 @@ Total 16 (delta 2), reused 16 (delta 2) -----> Building image -----> Uploading image (25M) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@kilatiron.net/repository.git * [new branch] master -> master ~~~ -Last but not least deploy the latest version of the app with the cctrlapp deploy command: +Last but not least deploy the latest version of the app with the ironcliapp deploy command: ~~~bash -$ cctrlapp APP_NAME/default deploy +$ ironcliapp APP_NAME/default deploy ~~~ -Congratulations, you can now see your Flask app running at `http[s]://APP_NAME.cloudcontrolled.com`. +Congratulations, you can now see your Flask app running at `http[s]://APP_NAME.kilatiron.net`. [Flask]: http://flask.pocoo.org/ -[cloudControl]: http://www.cloudcontrol.com +[CloudKilat]: http://www.cloudkilat.com/ [Python buildpack]: https://github.com/cloudControl/buildpack-python -[Procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#buildpacks-and-the-procfile +[Procfile]: /Platform%20Documentation.md/#buildpacks-and-the-procfile [example_app]: https://github.com/cloudControl/python-flask-example-app.git diff --git a/Guides/Python/Tornado.md b/Guides/Python/Tornado.md index 2a1c521..32ac669 100644 --- a/Guides/Python/Tornado.md +++ b/Guides/Python/Tornado.md @@ -4,7 +4,7 @@ and tools that power FriendFeed written in Python. In this tutorial we're going to show you how to deploy a simple Tornado based -application on [cloudControl]. +application on [CloudKilat]. ## The Example App Explained @@ -29,7 +29,7 @@ tornado==2.4.1 ~~~ ### Process Type Definition -cloudControl uses a [Procfile] to know how to start the app's processes. +CloudKilat uses a [Procfile] to know how to start the app's processes. The example code already includes a file called `Procfile` at the top level of your repository. It looks like this: @@ -87,15 +87,15 @@ if __name__ == "__main__": ## Pushing and Deploying the App Choose a unique name to replace the `APP_NAME` placeholder for your application -and create it on the cloudControl platform: +and create it on the CloudKilat platform: ~~~bash -$ cctrlapp APP_NAME create python +$ ironcliapp APP_NAME create python ~~~ Push your code to the application's repository, which triggers the deployment image build process: ~~~bash -$ cctrlapp APP_NAME/default push +$ ironcliapp APP_NAME/default push Counting objects: 7, done. Delta compression using up to 4 threads. Compressing objects: 100% (4/4), done. @@ -113,19 +113,19 @@ Total 7 (delta 0), reused 7 (delta 0) -----> Building image -----> Uploading image (25M) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@kilatiron.net/repository.git + [new branch] master -> master ~~~ -Last but not least deploy the latest version of the app with the cctrlapp +Last but not least deploy the latest version of the app with the ironcliapp deploy command. ~~~bash -$ cctrlapp APP_NAME/default deploy +$ ironcliapp APP_NAME/default deploy ~~~ -Congratulations, you can now see your Tornado app running at `http://APP_NAME.cloudcontrolled.com`. +Congratulations, you can now see your Tornado app running at `http://APP_NAME.kilatiron.net`. [Tornado]: http://www.tornadoweb.org -[cloudControl]: http://www.cloudcontrol.com +[CloudKilat]: http://www.cloudkilat.com/ [Python buildpack]: https://github.com/cloudControl/buildpack-python -[Procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#buildpacks-and-the-procfile +[Procfile]: /Platform%20Documentation.md/#buildpacks-and-the-procfile diff --git a/Guides/Ruby/AWS S3.md b/Guides/Ruby/AWS S3.md index 32ba7f2..55a480f 100644 --- a/Guides/Ruby/AWS S3.md +++ b/Guides/Ruby/AWS S3.md @@ -26,10 +26,10 @@ Follow the [Amazon Guide](http://docs.aws.amazon.com/AWSSdkDocsJava/latest/Devel ## Example usage: -The recommended way to provide your AWS credentials to your app is via environment variables. To do this, use the [Config Add-on](https://www.cloudcontrol.com/dev-center/Add-on%20Documentation/Deployment/Custom%20Config): +The recommended way to provide your AWS credentials to your app is via environment variables. To do this, use the [Config Add-on](https://community.CloudKilat.ch/tutorial/custom-config-add-on/): ~~~bash -$ cctrlapp APP_NAME/default config.add AWS_ACCESS_KEY_ID=[YOUR_SECRET_KEY] AWS_SECRET_ACCESS_KEY=[YOUR_ACCESS_KEY] AWS_REGION='eu-west-1' +$ ironcliapp APP_NAME/default config.add AWS_ACCESS_KEY_ID=[YOUR_SECRET_KEY] AWS_SECRET_ACCESS_KEY=[YOUR_ACCESS_KEY] AWS_REGION='eu-west-1' ~~~ Now let's show some operations on buckets and objects: diff --git a/Guides/Ruby/Add-on credentials.md b/Guides/Ruby/Add-on credentials.md index e68746d..3fb4c97 100644 --- a/Guides/Ruby/Add-on credentials.md +++ b/Guides/Ruby/Add-on credentials.md @@ -18,7 +18,7 @@ database Add-ons can be seen in the last section. In case you don't want to expose these credentials in the environment, you can disable them by executing: ~~~bash -$ cctrlapp APP_NAME/DEP_NAME config.add SET_ENV_VARS=false +$ ironcliapp APP_NAME/DEP_NAME config.add SET_ENV_VARS=false ~~~ The Add-on credentials can still be read from the credentials file, as explained in the next section. @@ -32,7 +32,7 @@ available in your deployment containers. All the [Add-on credentials] can be found in a provided JSON file as well, which path is exposed in the `CRED_FILE` environment variable. You can see the format of that file locally with the command: ~~~bash -$ cctrlapp APP_NAME/DEP_NAME addon.creds +$ ironcliapp APP_NAME/DEP_NAME addon.creds ~~~ You can use the following code wherever you want to get the credentials in your @@ -57,52 +57,28 @@ end # Examples -cloudControl offers a number of data storage solutions via the [Add-on Marketplace]. -Below you can see how to access Add-on credentials on two examples for MySQL and PostgreSQL. +CloudKilat offers a number of data storage solutions via the [Add-on Marketplace]. +Below you can see how to access Add-on credentials for MySQL. ## MySQL -To add a MySQL database, use the [MySQL Dedicated Add-on] or [MySQL Shared Add-on]. +To add a MySQL database, use the [MySQL Shared Add-on]. Here's a Ruby snippet that reads the database settings and stores them in the `db_config` hash: ~~~ruby db_config = { - database: ENV["MYSQLD_DATABASE"], - host: ENV["MYSQLD_HOST"], - port: ENV["MYSQLD_PORT"], - username: ENV["MYSQLD_USER"], - password: ENV["MYSQLD_PASSWORD"] + database: ENV["MYSQLS_DATABASE"], + host: ENV["MYSQLS_HOST"], + port: ENV["MYSQLS_PORT"], + username: ENV["MYSQLS_USER"], + password: ENV["MYSQLS_PASSWORD"] } ~~~ -The example used the MySQLd Add-on. Variable names for MySQLs differ. Remember, you can always refer to the `addon.creds` command to see the actual variable names and values. +Remember, you can always refer to the `addon.creds` command to see the actual variable names and values. -## PostgreSQL - -To add a PostgreSQL database, use the [ElephantSQL Add-on]. - -With this Ruby snippet you can read the PostgreSQL settings and store them in the -`db_config` hash: -~~~ruby -require 'uri' - -elephant_uri = URI.parse ENV['ELEPHANTSQL_URL'] -db_config = { - database: elephant_uri.path[1 .. -1], - host: elephant_uri.host, - port: elephant_uri.port, - username: elephant_uri.user, - password: elephant_uri.password -} -~~~ - -You can also find a working example application on [Github][ruby-postgresql-example]. - -[Add-on credentials]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#add-on-credentials -[environment variables]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#environment-variables -[Add-on Marketplace]: https://www.cloudcontrol.com/add-ons/?c=1 -[MySQL Dedicated Add-on]: https://www.cloudcontrol.com/add-ons/mysqld -[MySQL Shared Add-on]: https://www.cloudcontrol.com/add-ons/mysqls -[ElephantSQL Add-on]: https://www.cloudcontrol.com/add-ons/elephantsql -[ruby-postgresql-example]: https://github.com/ElephantSQL/ruby-postgresql-example +[Add-on credentials]: /Platform%20Documentation.md/#add-on-credentials +[environment variables]: /Platform%20Documentation.md/#environment-variables +[Add-on Marketplace]: http://www.cloudkilat.com/ +[MySQL Shared Add-on]: /Add-on%20Documentation/Data%20Storage/MySQLs.md diff --git a/Guides/Ruby/HelloWorld.md b/Guides/Ruby/HelloWorld.md index 507bbb7..5c25f2a 100644 --- a/Guides/Ruby/HelloWorld.md +++ b/Guides/Ruby/HelloWorld.md @@ -2,7 +2,7 @@ [Sinatra][sinatra] is a DSL for quickly creating web applications in Ruby with minimal effort. In this tutorial we're going to show you how to deploy a Sinatra application on -[cloudControl]. You can find the [source code on Github][example-app] and check out the [Ruby buildpack] for supported features. +[CloudKilat]. You can find the [source code on Github][example-app] and check out the [Ruby buildpack] for supported features. ## The Sinatra App Explained @@ -29,7 +29,7 @@ use the same versions of all the gems. ### Process Type Definition -cloudControl uses a [Procfile] to know how to start your processes. +CloudKilat uses a [Procfile] to know how to start your processes. The example code already includes a file called `Procfile` at the top level of your repository. It looks like this: ~~~ @@ -39,14 +39,14 @@ web: bundle exec ruby server.rb -e production -p $PORT Left from the colon we specified the **required** process type called `web` followed by the command that starts the app and listens on the port specified by the environment variable `$PORT`. ## Pushing and Deploying the App -Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the cloudControl platform: +Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the CloudKilat platform: ~~~bash -$ cctrlapp APP_NAME create ruby +$ ironcliapp APP_NAME create ruby ~~~ Push your code to the application's repository, which triggers the deployment image build process: ~~~bash -$ cctrlapp APP_NAME/default push +$ ironcliapp APP_NAME/default push Counting objects: 14, done. Delta compression using up to 4 threads. Compressing objects: 100% (10/10), done. @@ -73,24 +73,24 @@ Total 14 (delta 0), reused 14 (delta 0) -----> Building image -----> Uploading image (31M) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@kilatiron.net/repository.git * [new branch] master -> master ~~~ -Last but not least deploy the latest version of the app with the cctrlapp deploy command: +Last but not least deploy the latest version of the app with the ironcliapp deploy command: ~~~bash -$ cctrlapp APP_NAME/default deploy +$ ironcliapp APP_NAME/default deploy ~~~ -Congratulations, you can now see your Sinatra App running at `http[s]://APP_NAME.cloudcontrolled.com`. +Congratulations, you can now see your Sinatra App running at `http[s]://APP_NAME.kilatiron.net`. [sinatra]: http://www.sinatrarb.com/ -[cloudControl]: http://www.cloudcontrol.com -[cloudControl-doc-user]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#user-accounts -[cloudControl-doc-cmdline]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#command-line-client-web-console-and-api +[CloudKilat]: http://www.cloudkilat.com/ +[CloudKilat-doc-user]: /Platform%20Documentation.md/#user-accounts +[CloudKilat-doc-cmdline]: /Platform%20Documentation.md/#command-line-client-web-console-and-api [ruby buildpack]: https://github.com/cloudControl/buildpack-ruby -[procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#buildpacks-and-the-procfile +[procfile]: /Platform%20Documentation.md/#buildpacks-and-the-procfile [git]: https://help.github.com/articles/set-up-git [bundler]: http://gembundler.com/ [example-app]: https://github.com/cloudControl/ruby-sinatra-example-app diff --git a/Guides/Ruby/Ruby on Rails.md b/Guides/Ruby/Ruby on Rails.md index 9ea6d9a..4dca6e3 100644 --- a/Guides/Ruby/Ruby on Rails.md +++ b/Guides/Ruby/Ruby on Rails.md @@ -1,6 +1,6 @@ # Deploying a Ruby on Rails Application -In this tutorial we're going to show you how to deploy a [Ruby on Rails] application on [cloudControl]. You can find the [source code on Github][example-app] and check out the [Ruby buildpack][ruby buildpack] for supported features. The application is a fork of Michael Hartl's [Rails tutorial] sample app which is a Twitter clone. +In this tutorial we're going to show you how to deploy a [Ruby on Rails] application on [CloudKilat]. You can find the [source code on Github][example-app] and check out the [Ruby buildpack][ruby buildpack] for supported features. The application is a fork of Michael Hartl's [Rails tutorial] sample app which is a Twitter clone. ## The Rails Application Explained @@ -10,7 +10,7 @@ First, clone the Rails application from our repository on Github: ~~~bash $ git clone https://github.com/cloudControl/ruby-rails-example-app.git -$ cd ruby-rails-example-app +$ cd ruby-rails-example-app; git checkout mysql; ~~~ ### Dependency Tracking @@ -41,8 +41,8 @@ group :development, :test do end group :production do - gem 'pg' - gem 'cloudcontrol-rails', '0.0.6' + gem 'mysql2' + gem 'cloudcontrol-rails', '0.0.5' end group :assets do @@ -65,11 +65,11 @@ $ bundle exec rake db:test:prepare $ bundle exec rspec spec/ ~~~ -Now that the app is working, lets have a look at changes we have made to deploy it on cloudControl. +Now that the app is working, lets have a look at changes we have made to deploy it on CloudKilat. ### Process Type Definition -cloudControl uses a [Procfile] to know how to start your processes. The example code already includes a file called Procfile in the root of your repository. It looks like this: +CloudKilat uses a [Procfile] to know how to start your processes. The example code already includes a file called Procfile in the root of your repository. It looks like this: ~~~ web: bundle exec rails s -p $PORT @@ -98,14 +98,14 @@ end ### Production Database -By default, Rails 3 uses SQLite for all the environments. However, it is not recommended to use SQLite on cloudControl because the filesystem is [not persistent][filesystem]. To use a database, you should choose an Add-on from [Data Storage category][data-storage-addons]. +By default, Rails 3 uses SQLite for all the environments. However, it is not recommended to use SQLite on CloudKilat because the filesystem is [not persistent][filesystem]. -In this tutorial we use PostgresSQL with the [ElephantSQL Add-on][postgres-addon]. This is why we have modified the `Gemfile` by moving the `sqlite3` line to ":development, :test" block and added a new ":production" group with "pg" and ["cloudcontrol-rails"][gem itself] gems. +In this tutorial we use MySQL with the [MySQL Shared Add-on]. This is why we have modified the `Gemfile` by moving the `sqlite3` line to ":development, :test" block and added a new ":production" group with "mysql2" and ["cloudcontrol-rails"][gem itself] gems. -Additionally we have changed the "production" section of `config/database.yml` to use the postgresql adapter: +Additionally we have changed the "production" section of `config/database.yml` to use the mysql adapter: ~~~ production: - adapter: postgresql + adapter: mysql2 encoding: utf8 pool: 5 ~~~ @@ -114,16 +114,16 @@ The 'cloudcontrol-rails' gem will provide the database credentials. ## Pushing and Deploying your App -Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the cloudControl platform: +Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the CloudKilat platform: ~~~bash -$ cctrlapp APP_NAME create ruby +$ ironcliapp APP_NAME create ruby ~~~ -Push your code to the application's repository, which triggers the deployment image build process: +Push your code to the application's repository, which triggers the deployment image build process (do it with `mysql` deployment name since we use the same branch in application repo): ~~~bash -$ cctrlapp APP_NAME/default push +$ ironcliapp APP_NAME/mysql push Counting objects: 62, done. Delta compression using up to 4 threads. Compressing objects: 100% (51/51), done. @@ -162,39 +162,38 @@ Total 62 (delta 2), reused 0 (delta 0) -----> Building image -----> Uploading image (34M) -To ssh://APP_NAME@cloudcontrolled.com/repository.git - * [new branch] master -> master +To ssh://APP_NAME@kilatiron.net/repository.git + * [new branch] mysql -> mysql ~~~ -Add ElephantSQL Add-on with `turtle` plan to your deployment and deploy it: +Add MySQLs Add-on with `free` plan to your deployment and deploy it: ~~~bash -$ cctrlapp APP_NAME/default addon.add elephantsql.turtle -$ cctrlapp APP_NAME/default deploy +$ ironcliapp APP_NAME/mysql addon.add mysqls.free +$ ironcliapp APP_NAME/mysql deploy ~~~ Finally, prepare the database by running migrations using the [Run command][run command]: ~~~bash -$ cctrlapp APP_NAME/default run "rake db:migrate" +$ ironcliapp APP_NAME/mysql run "rake db:migrate" ~~~ -Congratulations, you can now access the app at http://APP_NAME.cloudcontrolled.com. +Congratulations, you can now access the app at http://mysql-APP_NAME.kilatiron.net. For additional information take a look at [Ruby on Rails notes][rails-notes] and other [ruby-specific documents][ruby-guides]. [Ruby on Rails]: http://rubyonrails.org/ -[cloudControl]: http://www.cloudcontrol.com +[CloudKilat]: http://www.cloudkilat.com/ [example-app]: https://github.com/cloudControl/ruby-rails-example-app [ruby buildpack]: https://github.com/cloudControl/buildpack-ruby [Rails tutorial]: http://ruby.railstutorial.org/ [Bundler]: http://bundler.io/ -[Procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#buildpacks-and-the-procfile -[filesystem]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#non-persistent-filesystem -[data-storage-addons]: https://www.cloudcontrol.com/dev-center/Add-on%20Documentation/Data%20Storage/ -[postgres-addon]: https://www.cloudcontrol.com/dev-center/Add-on%20Documentation/Data%20Storage/ElephantSQL -[run command]: https://www.cloudcontrol.com/dev-center/Guides/Ruby/RunCommand -[rails-notes]: https://www.cloudcontrol.com/dev-center/Guides/Ruby/RailsNotes -[ruby-guides]: https://www.cloudcontrol.com/dev-center/Guides/Ruby +[Procfile]: /Platform%20Documentation.md/#buildpacks-and-the-procfile +[filesystem]: /Platform%20Documentation.md/#non-persistent-filesystem +[run command]: /Guides/Ruby/RunCommand.md +[rails-notes]: /Guides/Ruby/RubyNotes.md +[ruby-guides]: /Guides/Ruby [gem itself]: http://rubygems.org/gems/cloudcontrol-rails +[MySQL Shared Add-on]: /Add-on%20Documentation/Data%20Storage/MySQLs.md diff --git a/Guides/Ruby/RubyNotes.md b/Guides/Ruby/RubyNotes.md index eaa7f5c..add7771 100644 --- a/Guides/Ruby/RubyNotes.md +++ b/Guides/Ruby/RubyNotes.md @@ -3,7 +3,7 @@ ## Procfile -The cloudControl platform uses a file named `Procfile` to determine how to run your +The CloudKilat platform uses a file named `Procfile` to determine how to run your application. This `Procfile` uses the YAML format to specify the desired configuration. @@ -100,10 +100,10 @@ Alternatively you can use the [cloudcontrol-rails] gem. ## Environments -Rails servers can be run in different environments. Production is the default one but you can change it by setting the `RAILS_ENV` and `RAKE_ENV` environment variables with the [Custom Config addon](https://www.cloudcontrol.com/add-ons/config). For example: +Rails servers can be run in different environments. Production is the default one but you can change it by setting the `RAILS_ENV` and `RAKE_ENV` environment variables with the [Custom Config addon](https://community.CloudKilat.ch/tutorial/custom-config-add-on/). For example: ~~~ -cctrlapp APP_NAME/DEPLOYMENT config.add RACK_ENV=some_env RAILS_ENV=some_env +ironcliapp APP_NAME/DEP_NAME config.add RACK_ENV=some_env RAILS_ENV=some_env ~~~ NOTE: Gems in development and test environments are excluded from bundle install process. @@ -111,6 +111,6 @@ NOTE: Gems in development and test environments are excluded from bundle install [cloudcontrol-rails]: https://rubygems.org/gems/cloudcontrol-rails -[procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#version-control--images +[procfile]: /Platform%20Documentation.md/#version-control-images [rails-procfile]: #rails-procfile [ruby-buildpack]: https://github.com/cloudControl/buildpack-ruby diff --git a/Guides/Ruby/RunCommand.md b/Guides/Ruby/RunCommand.md index 69e2f55..2e40bf7 100644 --- a/Guides/Ruby/RunCommand.md +++ b/Guides/Ruby/RunCommand.md @@ -5,18 +5,18 @@ Run command is really useful for the ruby programmers. Here are some examples ho To migrate database: ~~~bash -$ ctrlapp APP_NAME/DEP_NAME run "rake db:migrate" +$ ironcliapp APP_NAME/DEP_NAME run "rake db:migrate" ~~~ To run rails console: ~~~bash -$ cctrlapp APP_NAME/DEP_NAME run "rails c" +$ ironcliapp APP_NAME/DEP_NAME run "rails c" ~~~ Here is a full example in which multiple commands are run in remote bash session: ~~~ -$ cctrlapp APP_NAME/DEP_NAME run bash +$ ironcliapp APP_NAME/DEP_NAME run bash Connecting... Warning: Permanently added '[X.X.X.X]:' (RSA) to the list of known hosts. u@-:~/www$ rails g scaffold Post title:string content:text @@ -78,13 +78,13 @@ irb(main):004:0> Post.all irb(main):005:0> exit u@-:~/www$ exit Connection to X.X.X.X closed. -Connection to ssh.cloudcontrolled.net closed. +Connection to sshforwarder.kilatiron.net closed. ~~~ The same could be accomplished if the multiple individual commands were chained: ~~~ -$ cctrlapp APP_NAME/DEPLOYMENT run "rails g scaffold Post title:string content:text && rake db:migrate && rails c" +$ ironcliapp APP_NAME/DEPLOYMENT run "rails g scaffold Post title:string content:text && rake db:migrate && rails c" ~~~ The previous example is quite artificial and it's usefulness in the real world would be questionable. The changes to the database are retained, but all the generated files are lost. Nevertheless it demonstrates more complex usage of the run command and gives a bit of insight in it's power. diff --git a/Guides/Third-Party Buildpacks/Third-Party Buildpacks.md b/Guides/Third-Party Buildpacks/Third-Party Buildpacks.md index 38a1a88..b713767 100644 --- a/Guides/Third-Party Buildpacks/Third-Party Buildpacks.md +++ b/Guides/Third-Party Buildpacks/Third-Party Buildpacks.md @@ -1,17 +1,18 @@ # Third-Party Custom Buildpacks -[cloudControl] officially supports the following application types via the [Pinky Stack][PinkyStack]. +[CloudKilat] officially supports the following application types via the [Pinky Stack][PinkyStack]. - Java-based (Java with Maven, Gradle, Grails, Scala, Play! or Clojure) - Ruby - PHP - Python +- NodeJS However, you can deploy apps developed on languages and technologies beyond the officially supported ones using the third-party custom buildpacks feature. ## Verified Buildpacks -Here is a list of verified and recommended buildpacks for the cloudControl platform covering the following languages and technologies: +Here is a list of verified and recommended buildpacks for the CloudKilat platform covering the following languages and technologies: |Technology|Buildpack URL| |:---------|:----------:| @@ -28,7 +29,7 @@ Here is a list of verified and recommended buildpacks for the cloudControl platf In order to create an app using a custom buildpack you have to choose the `custom` app type and then provide the desired buildpack URL: ~~~bash -$ cctrlapp APP_NAME create custom --buildpack BUILDPACK_URL +$ ironcliapp APP_NAME create custom --buildpack BUILDPACK_URL ~~~ **Note:** `BUILDPACK_URL` has to be a non-ssh git repository. @@ -37,8 +38,8 @@ You can use any of the aforementioned buildpacks, fork them and make changes acc Before using any third party buildpack you should inspect their source code and proceed with caution. -[cloudControl]: https://www.cloudcontrol.com -[PinkyStack]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#stacks +[CloudKilat]: http://www.cloudkilat.com/ +[PinkyStack]: /Platform%20Documentation.md/#stacks [buildpack-java]: https://github.com/cloudControl/buildpack-java [buildpack-python]: https://github.com/cloudControl/buildpack-python [buildpack-ruby]: https://github.com/cloudControl/buildpack-ruby diff --git a/Platform Documentation.md b/Platform Documentation.md index 64ecc31..1da68b5 100644 --- a/Platform Documentation.md +++ b/Platform Documentation.md @@ -1,41 +1,18 @@ - - -# cloudControl Documentation +# CloudKilat Documentation ## Platform Access **TL;DR:** - * The command line client cctrl is the primary interface. + * The command line client is the primary interface. * We also offer a web console. * For full control and integration it's possible to talk directly to the RESTful API. -To control the platform we offer different interfaces. The primary way of controlling your apps and deployments is via [the command-line interface](http://en.wikipedia.org/wiki/Command-line_interface) (CLI) called *cctrl*. Additionally we also offer a [web console]. Both the CLI as well as the web console however are merely frontends to our RESTful API. For deep integration into your apps you can optionally use one of our available [API libraries]. +To control the platform we offer different interfaces. The primary way of controlling your apps and deployments is via [the command-line interface](http://en.wikipedia.org/wiki/Command-line_interface) (CLI) called *ironcliapp* and *ironcliuser*. Additionally we also offer a [web console]. Both the CLI as well as the web console however are merely frontends to our RESTful API. For deep integration into your apps you can optionally use one of our available [API libraries]. -Throughout this documentation we will use the CLI as the primary way of controlling the cloudControl platform. The CLI consists of 2 parts: *cctrlapp* and *cctrluser*. To get help for the command line client, just append --help or -h to any of the commands. +Throughout this documentation we will use the CLI as the primary way of controlling the CloudKilat platform. The CLI consists of 2 parts: *ironcliapp* and *ironcliuser*. To get help for the command line client, just append --help or -h to any of the commands. -Installing *cctrl* is easy and works on Mac/Linux as well as on Windows. +Installing the command line clients is easy and works on Mac/Linux as well as on Windows. #### Quick Installation Windows @@ -43,73 +20,49 @@ For Windows we offer an installer. Please download [the latest version] of the i #### Quick Installation Linux/Mac -On Linux and Mac OS we recommend installing and updating cctrl via pip. *cctrl* requires [Python 2.6+]. +On Linux and Mac OS we recommend installing and updating the command line clients via pip. They require [Python 2.6+]. ~~~ -$ sudo pip install -U cctrl +$ sudo pip install -U ironcli ~~~ -If you don't have pip you can install pip via easy_install (on Linux usually part of the python-setuptools package) and then install cctrl. +If you don't have pip you can install pip via easy_install (on Linux usually part of the python-setuptools package): ~~~ $ sudo easy_install pip -$ sudo pip install -U cctrl +$ sudo pip install -U ironcli ~~~ ## User Accounts -**TL;DR:** - - * Every developer has their own user account - * User accounts can be created via the *web console* or via ``cctrluser create`` - * User accounts can be deleted via the *web console* or via ``cctrluser delete`` - -To work on and manage your applications on the platform, a user account is needed. User accounts can be created via the *web console* or using the following CLI command: -~~~ -$ cctrluser create -~~~ - -After this, an activation email is sent to the given email address. Click the link in the email or use the following CLI command to activate the account: - -~~~ -$ cctrluser activate USER_NAME ACTIVATION_CODE -~~~ - -If you want to delete your user account, please use either the *web console* or the following CLI command: -~~~ -$ cctrluser delete -~~~ - -### Password Reset - -You can [reset your password], in case you forgot it. - +User accounts are created on [www.cloudkilat.com](http://www.cloudkilat.com/). -## Apps, Users and Deployments +## Apps and Deployments **TL;DR:** - * Applications (apps) have a repository, deployments and users. + * Applications (apps) have a repository and deployments. * The repository is where your code lives, organized in branches. - * A deployment is a running version of your application, based on the branch with the same name. Exception: the default deployment is based on the master (Git) / trunk (Bazaar). - * Users can be added to apps to gain access to the repository, branches and deployments. + * A deployment is a running version of your application, based on the branch with the same name. Exception: the default deployment is based on the master branch. -cloudControl PaaS uses a distinct set of naming conventions. To understand how to work with the platform effectively, it's important to understand the following few basic concepts. +CloudKilat PaaS uses a distinct set of naming conventions. To understand how to +work with the platform effectively, it's important to understand the following +few basic concepts. ### Apps -An app consists of a repository (with branches), deployments and users. Creating an app allows you to add or remove users to that app, giving them access to the source code as well as allowing them to manage the deployments. +An app consists of a repository (with branches) and deployments. Creating an app is easy. Simply specify a name and the desired type to determine which [buildpack](#buildpacks-and-the-procfile) to use. ~~~ -$ cctrlapp APP_NAME create php +$ ironcliapp APP_NAME create php ~~~ You can always list your existing apps using the command line client too. ~~~ -$ cctrlapp -l +$ ironcliapp -l Apps Nr Name Type 1 myfirstapp php @@ -117,91 +70,47 @@ Apps [...] ~~~ -### Users - -By adding users to an app you can grant fellow developers access to the source code in the repository, allow them to [deploy new versions](#deploying-new-versions) and modify the deployments including their [Add-ons](#managing-add-ons). Permissions are based on -the user's [roles](#roles). Users can be added to applications or more fine grained to deployments. - -You can list, add and remove app users using the command line client. - -~~~ -$ cctrlapp APP_NAME user - -Users - Name Email Role Deployment - user1 user1@example.com admin (app) - user2 user2@example.com readonly production - user3 user3@example.com admin staging -~~~ - - -Add a user to an app by providing their email address. If the user is already registered they will be added to the app immediately. Otherwise they will receive an invitation email first. - -~~~ -$ cctrlapp APP_NAME user.add user4@example.com -~~~ - -To remove a user, please use their email address. -~~~ -$ cctrlapp APP_NAME user.remove user3@example.com -~~~ - -On deployment level: -~~~ -$ cctrlapp APP_NAME/DEP_NAME user.add user5@example.com -$ cctrlapp APP_NAME/DEP_NAME user.remove user5@example.com -~~~ -Please note: a user can either be added to the application or to one or more deployments. - -#### Roles - - * **Owner**: Creating an app makes you the owner and gives you full access. The owner can not be removed from the app and gets charged for all their apps' consumption. - * **Admin**: The default role for users added to an app is the Admin role. Admins have full access to the repository and to all deployments. Admins can add more Admin or Read-only users or remove existing ones. They can delete deployments and even the app itself. Admins however can not change the associated billing account or remove the owner. - * **Read-only** The Read-only role allows you to see the application details, deployments and logs. Any update operation is forbidden. - -You can provide the role with the `user.add` command. +### User Keys -~~~ -$ cctrlapp APP_NAME user.add user5@example.com --role readonly -~~~ - -#### Keys - -For secure access to the app's repository, each developer needs to authenticate via public/ private key authentication. Please refer to GitHub's article on [generating SSH keys] for details on how to create a key. You can simply add your default key to your user account using the *web console* or the command line client. If no default key can be found, cctrlapp will offer to create one. +For secure access to the app's repository, each developer needs to authenticate +via public/ private key authentication. Please refer to GitHub's article on +[generating SSH keys] for details on how to create a key. You can simply add +your default key to your user account using the *web console* or the command +line client. If no default key can be found, ironcliapp will offer to create one. ~~~ -$ cctrluser key.add +$ ironcliuser key.add ~~~ You can also list the available key ids and remove existing keys using the key id. ~~~ -$ cctrluser key +$ ironcliuser key Keys Dohyoonuf7 -$ cctrluser key Dohyoonuf7 +$ ironcliuser key Dohyoonuf7 ssh-rsa AAA[...] -$ cctrluser key.remove Dohyoonuf7 +$ ironcliuser key.remove Dohyoonuf7 ~~~ ### Deployments A deployment is the running version of one of your branches made accessible via a [provided subdomain](#provided-subdomains-and-custom-domains). -It is based on the branch of the same name. Exception: the default deployment is based on the master (Git) / trunk (Bazaar). +It is based on the branch of the same name. Exception: the default deployment is based on the master branch. -Deployments run independently from each other, including separate runtime environments, file system storage and Add-ons (e.g. databases and caches). +Deployments run independently from each other, including separate runtime environments, file system storage and Add-ons (e.g. database). This allows you to have different versions of your app running at the same time without interfering with each other. Please refer to the section about [development, staging and production environments](#development-staging-and-production-environments) to understand why this is a good idea. You can list all the deployments with the *details* command. ~~~ -$ cctrlapp APP_NAME details +$ ironcliapp APP_NAME details App - Name: APP_NAME Type: php Owner: user1 - Repository: ssh://APP_NAME@cloudcontrolled.com/repository.git + Name: APP_NAME Type: php Owner: EMAIL_ADDRESS + Repository: ssh://APP_NAME@kilatiron.net/repository.git [...] @@ -216,61 +125,48 @@ App **TL;DR:** - * Git and Bazaar are supported. + * Git is the supported VCS. * When you push an updated branch, an image of your code gets built, ready to be deployed. * Image sizes are limited to 200MB (compressed). Use a `.cctrlignore` file to exclude development assets. -### Supported Version Control Systems - -The platform supports Git ([quick Git tutorial]) and Bazaar ([Bazaar in five minutes]). When you create an app we try to determine if the current working directory has a .git or .bzr directory. If it does, we create the app with the detected version control system. If we can't determine this based on the current working directory, Git is used as the default. You can always overwrite this with the --repo command line switch. - -~~~ -$ cctrlapp APP_NAME create php [--repo [git,bzr]] -~~~ - -It's easy to tell what version control system an existing app uses based on the repository URL provided as part of the app details. - -~~~ -$ cctrlapp APP_NAME details -App - Name: APP_NAME Type: php Owner: user1 - Repository: ssh://APP_NAME@cloudcontrolled.com/repository.git - [...] -~~~ -If yours starts with `ssh://` and ends with `.git` then Git is being used. If it starts with `bzr+ssh://`, Bazaar is being used. - ### Image Building Whenever you push an updated branch, a deployment image is built automatically. -This image can then be deployed with the *deploy* command to the deployment matching the branch name. -The content of the image is generated by the [buildpack](#buildpacks-and-the-procfile) including your application code in a runnable form with all the dependencies. +This image can then be deployed with the *deploy* command to the deployment +matching the branch name. The content of the image is generated by the +[buildpack](#buildpacks-and-the-procfile) including your application code in a +runnable form with all the dependencies. -You can either use the cctrlapp push command or your version control system's push command. Please remember that deployment and branch names have to match. So to push to your dev deployment the following commands are interchangeable. Also note, both require the existence of a branch called dev. +You can either use the ironcliapp push command or git's push command. Please +remember that deployment and branch names have to match. So to push to your +dev deployment the following commands are interchangeable. Also note, both +require the existence of a branch called dev. ~~~ -# with cctrlapp: -$ cctrlapp APP_NAME/dev push +# with ironcliapp: +$ ironcliapp APP_NAME/dev push -# get the REPO_URL from the output of cctrlapp APP_NAME details +# get the REPO_URL from the output of ironcliapp APP_NAME details # with git: -$ git remote add cctrl REPO_URL -$ git push cctrl dev - -# with bzr: -$ bzr push --remember REPO_URL +$ git remote add exo REPO_URL +$ git push exo dev ~~~ -The repositories support all other remote operations like pulling and cloning as well. +The repositories support all other remote operations like pulling and cloning +as well. -The compressed image size is limited to 200MB. -Smaller images can be deployed faster, so we recommend to keep the image size below 50MB. -The image size is printed at the end of the build process; if the image exceeds the limit, the push gets rejected. +The compressed image size is limited to 200MB. Smaller images can be deployed +faster, so we recommend to keep the image size below 50MB. The image size is +printed at the end of the build process; if the image exceeds the limit, the +push gets rejected. -You can decrease your image size by making sure that no unneeded files (e.g. caches, logs, backup files) are tracked -in your repository. Files that need to be tracked but are not required in the image (e.g. development assets or -source code files in compiled languages), can be added to a `.cctrlignore` file in the project root directory. -The format is similar to the `.gitignore`, but without the negation operator `!`. Here’s an example `.cctrlignore`: +You can decrease your image size by making sure that no unneeded files (e.g. +caches, logs, backup files) are tracked in your repository. Files that need to +be tracked but are not required in the image (e.g. development assets or source +code files in compiled languages), can be added to a `.cctrlignore` file in the +project root directory. The format is similar to the `.gitignore`, but without +the negation operator `!`. Here’s an example `.cctrlignore`: ~~~ *.psd @@ -281,13 +177,29 @@ spec #### Buildpacks and the Procfile -During the push a hook is fired that runs the buildpack. A buildpack is a set of scripts that determine how an app in a specific language or framework has to be prepared for deployment on the cloudControl platform. With custom buildpacks, support for new programming languages can be added or custom runtime environments can be build. To support many PaaS with one buildpack, we recommend following the [Heroku buildpack API] which is compatible with cloudControl and other platforms. +During the push a hook is fired that runs the buildpack. A buildpack is a set +of scripts that determine how an app in a specific language or framework has to +be prepared for deployment on the CloudKilat platform. With custom buildpacks, +support for new programming languages can be added or custom runtime +environments can be build. To support many PaaS with one buildpack, we +recommend following the [Heroku buildpack API] which is compatible with +CloudKilat and other platforms. -Part of the buildpack scripts is also to pull in dependencies according to the languages or frameworks native way. E.g. pip and a requirements.txt for Python, Maven for Java, npm for Node.js, Composer for PHP and so on. This allows you to fully control the libraries and versions available to your app in the final runtime environment. +Part of the buildpack scripts is also to pull in dependencies according to the +languages or frameworks native way. E.g. pip and a requirements.txt for Python, +Maven for Java, npm for Node.js, Composer for PHP and so on. This allows you to +fully control the libraries and versions available to your app in the final +runtime environment. -Which buildpack is going to be used is determined by the application type set when creating the app. +Which buildpack is going to be used is determined by the application type set +when creating the app. -A required part of the image is a file called `Procfile` in the root directory. It is used to determine how to start the actual application in the container. Some of the buildpacks can provide a default Procfile. But it is recommended to explicitly define the Procfile in your application to match your individual requirements better. For a container to be able to receive requests from the routing tier it needs at least the following content: +A required part of the image is a file called `Procfile` in the root directory. +It is used to determine how to start the actual application in the container. +Some of the buildpacks can provide a default Procfile. But it is recommended to +explicitly define the Procfile in your application to match your individual +requirements better. For a container to be able to receive requests from the +routing tier it needs at least the following content: ~~~ web: COMMAND_TO_START_THE_APP_AND_LISTEN_ON_A_PORT --port $PORT @@ -300,13 +212,13 @@ At the end of the buildpack process, the image is ready to be deployed. ## Deploying New Versions -The cloudControl platform supports zero downtime deploys for all deployments. To deploy a new version use either the *web console* or the `deploy` command. +The CloudKilat platform supports zero downtime deploys for all deployments. To deploy a new version use either the *web console* or the `deploy` command. ~~~ -$ cctrlapp APP_NAME/DEP_NAME deploy +$ ironcliapp APP_NAME/DEP_NAME deploy ~~~ -To deploy a specific version, append your version control systems identifier (full commit-SHA1 for Git or an integer for Bazaar). +To deploy a specific version, append your version control systems identifier (full commit-SHA1). If not specified, the version to be deployed defaults to the latest image available (the one built during the last successful push). For every deploy, the image is downloaded to as many of the platform’s nodes as required by the [--containers setting](#scaling) and started according to the buildpack’s default or the [Procfile](#buildpacks-and-the-procfile). @@ -324,7 +236,7 @@ first request is served. All following requests will perform normally. You can see the state of your application with the following command: ~~~ -$ cctrlapp APP_NAME/DEP_NAME details +$ ironcliapp APP_NAME/DEP_NAME details Deployment name: APP_NAME/DEP_NAME [...] @@ -340,13 +252,13 @@ any production system. If your newest version breaks unexpectedly, you can use the rollback command to revert to the previous version in a matter of seconds: ~~~ -$ cctrlapp APP_NAME/DEP_NAME rollback +$ ironcliapp APP_NAME/DEP_NAME rollback ~~~ It is also possible to deploy any other prior version. To find the version identifier you need, simply check the [deploy log](#deploy-log) for a previously deployed version, or get it directly from the version control system. You can redeploy this version using the deploy command: ~~~ -$ cctrlapp APP_NAME/DEP_NAME deploy THE_LAST_WORKING_VERSION_HASH +$ ironcliapp APP_NAME/DEP_NAME deploy THE_LAST_WORKING_VERSION_HASH ~~~ @@ -358,9 +270,14 @@ $ cctrlapp APP_NAME/DEP_NAME deploy THE_LAST_WORKING_VERSION_HASH * The filesystem is not persistent. * Don't store uploads on the filesystem. -Deployments on the cloudControl platform have access to a writable filesystem. This filesystem however is not persistent. Data written may or may not be accessible again in future requests, depending on how the [routing tier](#routing-tier) routes requests across available containers, and is deleted after each deploy. This does include deploys you trigger manually, but also re-deploys done by the platform itself during normal operation. +Deployments on the CloudKilat platform have access to a writable filesystem. This +filesystem however is not persistent. Data written may or may not be accessible +again in future requests, depending on how the [routing tier](#routing-tier) +routes requests across available containers, and is deleted after each deploy. +This does include deploys you trigger manually, but also re-deploys done by the +platform itself during normal operation. -For customer uploads (e.g. user profile pictures) we recommend object stores like Amazon S3 or the GridFS feature available as part of the [MongoLab Add-on]. +For customer uploads (e.g. user profile pictures) we recommend object stores like Amazon S3 or similar. ## Development, Staging and Production Environments @@ -373,7 +290,17 @@ For customer uploads (e.g. user profile pictures) we recommend object stores lik ### Development, Staging and Production: The Application Lifecycle -Most apps share a common application lifecycle consisting of development, staging and production phases. The cloudControl platform is designed from the ground up to support this. As we explained earlier, each app can have multiple deployments. Those deployments match the branches in the version control system. The reason for this is very simple. To work on a new feature it is advisable to create a new branch. This new version can then be deployed as its own deployment making sure the new feature development is not interfering with the existing deployments. More importantly even, these development/feature or staging deployments also help ensure that the new code will work in production because each deployment using the same [stack](#stacks) has the same runtime environment. +Most apps share a common application lifecycle consisting of development, +staging and production phases. The CloudKilat platform is designed from the +ground up to support this. As we explained earlier, each app can have multiple +deployments. Those deployments match the branches in the version control +system. The reason for this is very simple. To work on a new feature it is +advisable to create a new branch. This new version can then be deployed as its +own deployment making sure the new feature development is not interfering with +the existing deployments. More importantly even, these development/feature or +staging deployments also help ensure that the new code will work in production +because each deployment using the same [stack](#stacks) has the same runtime +environment. ### Environment Variables @@ -381,7 +308,7 @@ Sometimes you have environment specific configuration, e.g. to enable debugging * **TMPDIR**: The path to the tmp directory. * **CRED_FILE**: The path of the creds.json file containing the Add-on credentials. - * **DEP_VERSION**: The Git or Bazaar version the image was built from. + * **DEP_VERSION**: The Git version the image was built from. * **DEP_NAME**: The deployment name in the same format as used by the command line client. E.g. myapp/default. This one stays the same even when undeploying and creating a new deployment with the same name. * **DEP_ID**: The internal deployment ID. This one stays the same for the deployments lifetime but changes when undeploying and creating a new deployment with the same name. * **WRK_ID**: The internal worker ID. Only set for worker containers. @@ -396,36 +323,44 @@ Sometimes you have environment specific configuration, e.g. to enable debugging ### Managing Add-ons -Add-ons add additional services to your deployment. The [Add-on marketplace] offers a wide variety of different Add-ons. Think of it as an app store dedicated to developers. Add-ons can be different database offerings, caching, performance monitoring or logging services or even complete backend APIs or billing solutions. +Add-ons add additional services to your deployment. The [Add-on marketplace] +offers a variety of different Add-ons. Think of it as an app store +dedicated to developers. Add-ons range from database offerings to data processing services +or deployment solutions. -Each deployment has its own set of Add-ons. If your app needs a MySQL database and you have a production, a development and a staging environment, all three must have their own MySQL Add-ons. Each Add-on comes with different plans allowing you to choose a more powerful database for your high traffic production deployment and smaller ones for the development or staging environments. +Each deployment has its own set of Add-ons. If your app needs a MySQL database +and you have a production, a development and a staging environment, all three +must have their own MySQL Add-ons. Each Add-on comes with different plans +allowing you to choose a more powerful database for your high traffic +production deployment and smaller ones for the development or staging +environments. -You can see the available Add-on plans on the Add-on marketplace website or with the `cctrlapp addon.list` command. +You can see the available Add-on plans on the Add-on marketplace website or with the `ironcliapp addon.list` command. ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.list +$ ironcliapp APP_NAME/DEP_NAME addon.list [...] ~~~ Adding an Add-on is just as easy. ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add ADDON_NAME.ADDON_OPTION +$ ironcliapp APP_NAME/DEP_NAME addon.add ADDON_NAME.ADDON_OPTION ~~~ As always replace the placeholders written in uppercase with their respective values. To get the list of current Add-ons for a deployment use the addon command. ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon +$ ironcliapp APP_NAME/DEP_NAME addon Addon : alias.free -Addon : newrelic.standard +Addon : config.free [...] -Addon : blitz.250 +Addon : cron.hourly [...] -Addon : memcachier.dev +Addon : mysqls.free [...] ~~~ @@ -433,9 +368,9 @@ To upgrade or downgrade an Add-on use the respective command followed by the Add ~~~ # upgrade -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade FROM_SMALL_ADDON TO_BIG_ADDON +$ ironcliapp APP_NAME/DEP_NAME addon.upgrade FROM_SMALL_ADDON TO_BIG_ADDON # downgrade -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade FROM_BIG_ADDON TO_SMALL_ADDON +$ ironcliapp APP_NAME/DEP_NAME addon.downgrade FROM_BIG_ADDON TO_SMALL_ADDON ~~~ **Remember:** As in all examples in this documentation, replace all the uppercase placeholders with their respective values. @@ -458,20 +393,22 @@ the credentials file. Set the variable `SET_ENV_VARS` using the [Custom Config Add-on] to either `false` or `true` to explicitly enable or disable this feature. -The guides section has detailed examples about how to get the credentials in different languages ([Ruby](https://www.cloudcontrol.com/dev-center/Guides/Ruby/Add-on%20credentials), [Python](https://www.cloudcontrol.com/dev-center/Guides/Python/Add-on%20credentials), [Node.js](https://www.cloudcontrol.com/dev-center/Guides/NodeJS/Add-on%20credentials), [Java](https://www.cloudcontrol.com/dev-center/Guides/Java/Add-on%20credentials), [PHP](https://www.cloudcontrol.com/dev-center/Guides/PHP/Add-on%20credentials)). +The guides section has detailed examples about how to get the credentials in +different languages +([Ruby](/Guides/Ruby/Add-on credentials.md), +[Python](/Guides/Python/Add-on credentials.md), +[Node.js](/Guides/NodeJS/Add-on credentials.md), +[Java](/Guides/Java/Add-on credentials.md), +[PHP](/Guides/PHP/Add-on credentials.md)). To see the format and contents of the credentials file locally, use the `addon.creds` command. ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.creds +$ ironcliapp APP_NAME/DEP_NAME addon.creds { - "BLITZ": { - "BLITZ_API_KEY": "SOME_SECRET_API_KEY", - "BLITZ_API_USER": "SOME_USER_ID" - }, - "MEMCACHIER": { - "MEMCACHIER_PASSWORD": "SOME_SECRET_PASSWORD", - "MEMCACHIER_SERVERS": "SOME_HOST.eu.ec2.memcachier.com", - "MEMCACHIER_USERNAME": "SOME_USERNAME" + "CONFIG": { + "CONFIG_VARS": { + "FOO": "BAR" + } }, "MYSQLS": { "MYSQLS_DATABASE": "SOME_DB_NAME", @@ -489,10 +426,10 @@ $ cctrlapp APP_NAME/DEP_NAME addon.creds * There are four different log types (access, error, worker and deploy) available. -To see the log output in a `tail -f`-like fashion use the cctrlapp log command. The log command initially shows the last 500 log messages and then appends new messages as they arrive. +To see the log output in a `tail -f`-like fashion use the ironcliapp log command. The log command initially shows the last 500 log messages and then appends new messages as they arrive. ~~~ -$ cctrlapp APP_NAME/DEP_NAME log [access,error,worker,deploy] +$ ironcliapp APP_NAME/DEP_NAME log [access,error,worker,deploy] [...] ~~~ @@ -514,7 +451,7 @@ The `deploy` log provides detailed information about the deploy process. It show ### Customizing logging -Some Add-ons in the [Deployment category] as well as the [Custom Config Add-on] can be used to forward error and worker logs to the external logging services. +The [Custom Config Add-on] can be used to forward error and worker logs to the external logging services. #### Adding custom syslog logging with Custom Config Add-on @@ -534,7 +471,7 @@ Where "SERVER_ADDRESS" and "PORT" should be replaced with the concrete values an Use the name of the file (for example `custom_remote.cfg`) as a value for the "RSYSLOG_REMOTE" config variable: ~~~ -$ cctrlapp APP_NAME/DEP_NAME config.add RSYSLOG_REMOTE=custom_remote.cfg +$ ironcliapp APP_NAME/DEP_NAME config.add RSYSLOG_REMOTE=custom_remote.cfg ~~~ From now on all the new logs should be visible in your custom syslog remote. @@ -544,30 +481,46 @@ From now on all the new logs should be visible in your custom syslog remote. **TL;DR:** - * Each deployment is provided with both a `*.cloudcontrolled.com` and `*.cloudcontrolapp.com` subdomain. + * Each deployment is provided with both a `*.kilatiron.net` and `*.kilatiron.com` subdomain. * Custom domains are supported via the Alias Add-on. -Each deployment is provided per default with both a `*.cloudcontrolled.com` and `*.cloudcontrolapp.com` subdomain. The `APP_NAME.cloudcontrolled.com` or `APP_NAME.cloudcontrolapp.com` will point to the `default` deployment while any additional deployment can be accessed with a prefixed subdomain: `DEP_NAME-APP_NAME.cloudcontrolled.com` or `DEP_NAME-APP_NAME.cloudcontrolapp.com`. +Each deployment is provided per default with both a `*.kilatiron.net` and `*.kilatiron.com` subdomain. The `APP_NAME.kilatiron.net` or `APP_NAME.kilatiron.com` will point to the `default` deployment while any additional deployment can be accessed with a prefixed subdomain: `DEP_NAME-APP_NAME.kilatiron.net` or `DEP_NAME-APP_NAME.kilatiron.com`. -You can also use custom domains to access your deployments. To add a domain like `www.example.com`, `app.example.com` or `secure.example.com` to one of your deployments, simply add each one as an alias and add a CNAME for each pointing to your deployment's subdomain. So to point `www.example.com` to the default deployment of the app called *awesomeapp*, add a CNAME for `www.example.com` pointing to `awesomeapp.cloudcontrolled.com` or `awesomeapp.cloudcontrolapp.com`. The [Alias Add-on] also supports mapping wildcard domains like `*.example.com` to one of your deployments. +You can also use custom domains to access your deployments. To add a domain like `www.example.com`, `app.example.com` or `secure.example.com` to one of your deployments, simply add each one as an alias and add a CNAME for each pointing to your deployment's subdomain. So to point `www.example.com` to the default deployment of the app called *awesomeapp*, add a CNAME for `www.example.com` pointing to `awesomeapp.kilatiron.net` or `awesomeapp.kilatiron.com`. The [Alias Add-on] also supports mapping wildcard domains like `*.example.com` to one of your deployments. -All custom domains need to be verified before they start working. To verify a domain, it is required to also add the cloudControl verification code as a TXT record. +All custom domains need to be verified before they start working. To verify a domain, it is required to also add the CloudKilat verification code as a TXT record. Changes to DNS can take up to 24 hours until they have effect. Please refer to the Alias Add-on Documentation for detailed instructions on how to setup CNAME and TXT records. +### Root Domains + +Root domains (e.g. "example.com") can also be added but are not directly +supported. While you theoretically can add a CNAME record for your root +domain, you have to be aware that no other record for this domain can +be set then. ("A CNAME record is not allowed to coexist with any other +data", http://tools.ietf.org/html/rfc1912). From the point you set a +CNAME, all standard-compliant DNS servers will ignore any other entry you +might have set for your zone (e.g. SOA, NS or MX records). + +You can circumvent this limitation by using a DNS provider which provides +CNAME-like functionality for root domains, often called ANAME or ALIAS. + +An alternative is to use a redirection service to send users from the +root to the configured subdomain (e.g. example.org -> www.example.org). + ## Routing Tier **TL;DR:** * All HTTP requests are routed via our routing tier. - * Within the routing tier, you can choose to route requests via the `*.cloudcontrolled.com` or `*.cloudcontrolapp.com` subdomains. - * The `*.cloudcontrolled.com` subdomain provides support for HTTP caching via Varnish. - * The `*.cloudcontrolapp.com` subdomain provides WebSocket support. + * Within the routing tier, you can choose to route requests via the `*.kilatiron.net` or `*.kilatiron.com` subdomains. + * The `*.kilatiron.net` subdomain provides WebSocket support. + * The `*.kilatiron.com` subdomain provides support for HTTP caching via Varnish. * Requests are routed based on the `Host` header. * Use the `X-Forwarded-For` header to get the client IP. -All HTTP requests made to apps on the platform are routed via our routing tier. The routing tier is designed as a cluster of reverse proxy loadbalancers which orchestrate the forwarding of user requests to your applications. It takes care of routing the request to one of the application's containers based on matching the `Host` header against the list of the deployment's aliases. This is accomplished via the `*.cloudcontrolled.com` or `*.cloudcontrolapp.com` subdomains. +All HTTP requests made to apps on the platform are routed via our routing tier. The routing tier is designed as a cluster of reverse proxy loadbalancers which orchestrate the forwarding of user requests to your applications. It takes care of routing the request to one of the application's containers based on matching the `Host` header against the list of the deployment's aliases. This is accomplished via the `*.kilatiron.net` or `*.kilatiron.com` subdomains. The routing tier is designed to be robust against single node and even complete datacenter failures while still keeping the added latency as low as possible. @@ -581,27 +534,27 @@ Given that client requests don't hit your application directly, but are forwarde ### Reverse Proxy timeouts -Our routing tier uses a cluster of reverse proxy loadbalancers to manage the acceptance and forwarding of user requests to your applications. To do this in an efficient way, we set strict timeouts to the read/ write operations. The values differ slightly between the `*.cloudcontrolled.com` and `*.cloudcontrolapp.com` subdomains. You can find them below. +Our routing tier uses a cluster of reverse proxy loadbalancers to manage the acceptance and forwarding of user requests to your applications. To do this in an efficient way, we set strict timeouts to the read/ write operations. The values differ slightly between the `*.kilatiron.net` and `*.kilatiron.com` subdomains. You can find them below. * __Connect timeout__ - time within a connection to your application has to be established. If your containers are up, but hanging, then this timeout will not apply as the connection to the endpoints has already been made. * __Read timeout__ - time to retrieve a response from your application. It determines how long the routing tier will wait to get the response to a request. The timeout is established not for an entire response, but only between two operations of reading. * __Send timeout__ - maximum time between two write operations of a request. If your application does not take new data within this time, the routing tier will shut down the connection. -#### Timeouts for `*.cloudcontrolled.com` subdomain: +#### Timeouts for `*.kilatiron.net` subdomain: |Parameter|Value [s]| |:---------|:----------:| -|Connect timeout|60| -|Send timeout|60| -|Read timeout|120| +|Connect timeout|20| +|Send timeout|55| +|Read timeout|55| -#### Timeouts for `*.cloudcontrolapp.com` subdomain: +#### Timeouts for `*.kilatiron.com` subdomain: |Parameter|Value [s]| |:---------|:----------:| -|Connect timeout|20| -|Send timeout|55| -|Read timeout|55| +|Connect timeout|60| +|Send timeout|60| +|Read timeout|120| ### Requests distribution @@ -609,19 +562,19 @@ Our smart [DNS](https://en.wikipedia.org/wiki/Domain_Name_System) provides a fas ### High Availability -The routing tier provides two mechanisms to ensure high availability, depending on the provided subdomain. These are Failover (for the `*.cloudcontrolled.com` subdomain) and Health Checker (for the `*.cloudcontrolapp.com` subdomain). Because these mechanisms depend on having multiple containers available to route requests, only deployments with more than one container running (see the [scaling section](#scaling) for details) can take advantage of high availability. +The routing tier provides two mechanisms to ensure high availability, depending on the provided subdomain. These are Health Checker (for the `*.kilatiron.net` subdomain) and Failover (for the `*.kilatiron.com` subdomain). Because these mechanisms depend on having multiple containers available to route requests, only deployments with more than one container running (see the [scaling section](#scaling) for details) can take advantage of high availability. In the event of a single node or container failure, the platform will start a replacement container. Deployments running on --containers 1 will be unavailable for a few minutes while the platform starts the replacement. To avoid even short downtimes, set the --containers option to at least 2. -#### `*.cloudcontrolled.com` subdomain +#### `*.kilatiron.net` subdomain -For the `*.cloudcontrolled.com` subdomain, failed requests are automatically re-routed to alternate containers via a failover mechanism. Requests will be retried with a different container within the set timeouts. It will also ensure the next request is not sent to the slow/faulty container for a given amount of time. +For the `*.kilatiron.net` subdomain, failed requests will cause an error message to be returned to the user once, but the "unhealthy" container will be actively monitored by a health checker. This signals the routing tier to temporarily remove the unhealthy container from the list of containers receiving requests. Subsequent requests are routed to an available container of the deployment. Once the health checker notices that the container has recovered, the container will be re-included in the list to receive requests. -#### `*.cloudcontrolapp.com` subdomain +Because the health checker actively monitors containers where an application is running into timeouts or returning [http error codes](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5) `501`, `502` or `greater 503`, you may see requests to `/CloudHealthCheck` coming from a `cloudControl-HealthCheck` agent. -For the `*.cloudcontrolapp.com` subdomain, failed requests will cause an error message to be returned to the user once, but the "unhealthy" container will be actively monitored by a health checker. This signals the routing tier to temporarily remove the unhealthy container from the list of containers receiving requests. Subsequent requests are routed to an available container of the deployment. Once the health checker notices that the container has recovered, the container will be re-included in the list to receive requests. +#### `*.kilatiron.com` subdomain -Because the health checker actively monitors containers where an application is running into timeouts or returning [http error codes](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5) `501`, `502` or `greater 503`, you may see requests to `/CloudHealthCheck` coming from a `cloudControl-HealthCheck` agent. +For the `*.kilatiron.com` subdomain, failed requests are automatically re-routed to alternate containers via a failover mechanism. Requests will be retried with a different container within the set timeouts. It will also ensure the next request is not sent to the slow/faulty container for a given amount of time. ## Scaling @@ -631,7 +584,7 @@ Because the health checker actively monitors containers where an application is * You can scale up or down at any time by adding more containers (horizontal scaling) or changing the container size (vertical scaling). * Use performance monitoring and load testing to determine the optimal scaling settings for your app. -When scaling your apps you have two options. You can either scale horizontally by adding more containers, or scale vertically by changing the container size. When you scale horizontally, the cloudControl loadbalancing and [routing tier](#routing-tier) ensures efficient distribution of incoming requests accross all available containers. +When scaling your apps you have two options. You can either scale horizontally by adding more containers, or scale vertically by changing the container size. When you scale horizontally, the CloudKilat loadbalancing and [routing tier](#routing-tier) ensures efficient distribution of incoming requests accross all available containers. ### Horizontal Scaling @@ -642,11 +595,7 @@ Deployments with --containers 1 (the default) are unavailable for a few minutes ### Vertical Scaling -In addition to controlling the number of containers you can also specify the memory size of a container. Container sizes are specified using the --memory parameter, being possible to choose from 128MB to 1024MB. To determine the optimal --memory value for your deployment you can use the New Relic Add-on to analyze the memory consumption of your app. - -### Choosing Optimal Settings - -You can use the [Blitz.io] and [New Relic Add-ons] to run synthetic load tests against your deployments and analyze how well they perform with the current --containers and --memory settings under expected load to determine the optimal scaling settings and adjust accordingly. We have a [tutorial] that explains this in more detail. +In addition to controlling the number of containers you can also specify the memory size of a container. Container sizes are specified using the --memory parameter, being possible to choose from 128MB to 1024MB. ## Performance & Caching @@ -667,36 +616,28 @@ After you have reduced the total number of requests, it's recommended to cache a #### Caching Proxy -The routing tier that is in front of all deployments includes a [Varnish] caching proxy. To use this feature, it is necessary to use the `*.cloudcontrolled.com` subdomain. To have your requests cached directly in Varnish and speed up the response time through this, ensure you have set correct [cache control headers](http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html) (`Cache-Control`, `Expires`, `Age`) for the request. Also, ensure that the request does not include a cookie. Cookies are often used to keep state across requests (e.g. if a user is logged in). To avoid caching responses for logged-in users and returning them to other users, Varnish is configured to never cache requests with cookies. +The routing tier that is in front of all deployments includes a [Varnish] caching proxy. To use this feature, it is necessary to use the `*.kilatiron.com` subdomain. To have your requests cached directly in Varnish and speed up the response time through this, ensure you have set correct [cache control headers](http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html) (`Cache-Control`, `Expires`, `Age`) for the request. Also, ensure that the request does not include a cookie. Cookies are often used to keep state across requests (e.g. if a user is logged in). To avoid caching responses for logged-in users and returning them to other users, Varnish is configured to never cache requests with cookies. -To be able to cache requests in Varnish for apps that rely on cookies, we recommend using a [cookieless domain](http://www.ravelrumba.com/blog/static-cookieless-domain/). In this case, you have to register a new domain and configure your DNS database with a `CNAME` record that points to your `APP_NAME.cloudcontrolled.com` subdomain `A` record. Then you can update your web application's configuration to serve static resources from your new domain. +To be able to cache requests in Varnish for apps that rely on cookies, we recommend using a [cookieless domain](http://www.ravelrumba.com/blog/static-cookieless-domain/). In this case, you have to register a new domain and configure your DNS database with a `CNAME` record that points to your `APP_NAME.kilatiron.com` subdomain `A` record. Then you can update your web application's configuration to serve static resources from your new domain. You can check if a request was cached in Varnish by checking the response's *X-varnish-cache* header. The value HIT means the respons was answered directly from the cache, and MISS means it was not. -#### In-Memory Caching - -To speed up requests that can't use a cookieless domain, you can use in-memory caching to store arbitrary data from database query results to complete http responses. Since the cloudControl routing tier distributes requests across all available containers, it is recommended to cache data in a way that the cache is also available for requests that are routed to different containers. A battle-tested solution for this is Memcached, which is available via the [MemCachier Add-on]. Refer to the [managing Add-ons](#managing-add-ons) section on how to add it. In addition the [MemCachier Documentation] has detailed instructions on how to use it for your language and framework of choice. - ### Cache Breakers When caching requests on client side or in a caching proxy, the URL is usually used as the cache identifier. As long as the URL stays the same and the cached response has not expired, the request is answered from cache. As part of every deployment, all containers are started from a clean image. This ensures that all containers have the latest app code including templates, css, image and javascript files. However, when using far-future `expires` headers as recommended above, this doesn't change anything if the response was cached at client or loadbalancer level. To ensure clients get the latest and greatest version, it is recommend to include a changing parameter into the URL. This is commonly referred to as a cache breaker. The [environment variables](#environment-variables) of the deployment runtime environment contain the DEP_VERSION of the app. If you want to force a refresh of the cache when a new version is deployed you can use the DEP_VERSION to accomplish this. -This technique works for URLs as well as for the keys in in-memory caches like `Memcached`. -Imagine you have cached values in Memcached that you want to keep between deploys and have values in Memcached that you want refreshed for each new version. Since Memcached only allows flushing the complete cache, you would lose all cached values. -Including the DEP_VERSION in the key is an easy way to ensure that the cache is clear for a new version without flushing. - -### Caching in cloudcontrolapp.com subdomain +### Caching in kilatiron.net subdomain -Requests via the `*.cloudcontrolapp.com` subdomain cannot be cached in the routing tier. However, it is still possible to provide caching for static assets by utilizing a separate cookieless domain as a CNAME of the `*.cloudcontrolled.com`subdomain. For example, you can serve the dynamic requests of your application via www.example.com (a CNAME FOR `example.cloudcontrolapp.com`) and serve the static assets like CSS, JS and images via `static.example.com` (a CNAME for `example.cloudcontrolled.com`). +Requests via the `*.kilatiron.net` subdomain cannot be cached in the routing tier. However, it is still possible to provide caching for static assets by utilizing a separate cookieless domain as a CNAME of the `*.kilatiron.com`subdomain. For example, you can serve the dynamic requests of your application via www.example.com (a CNAME FOR `example.kilatiron.net`) and serve the static assets like CSS, JS and images via `static.example.com` (a CNAME for `example.kilatiron.com`). ## WebSockets **TL;DR:** - * WebSockets are supported via the `*.cloudcontrolapp.com` subdomain. + * WebSockets are supported via the `*.kilatiron.net` subdomain. * WebSockets allow real-time, bidirectional communication between clients and servers * Additional steps are necessary to secure WebSocket connections * It is highly recommended to use the secure `wss://` protocol rather than the insecure `ws://`. @@ -721,18 +662,18 @@ Normal connection: ws://{host}:{port}/{path to the server} Secure connection: wss://{host}:{port}/{path to the server} ~~~ -Please note that Secure WebSockets connections can only be established using `*.cloudcontrolapp.com` subdomains, not custom ones. It is highly recommended to use them, not only for data security reasons. Secure WebSockets are 100% proxy transparent, which puts your containers in full control of WebSocket `upgrade handshake` in case some of the proxies do not handle it properly. +Please note that Secure WebSockets connections can only be established using `*.kilatiron.net` subdomains, not custom ones. It is highly recommended to use them, not only for data security reasons. Secure WebSockets are 100% proxy transparent, which puts your containers in full control of WebSocket `upgrade handshake` in case some of the proxies do not handle it properly. ## Scheduled Jobs and Background Workers **TL;DR:** - * Web requests are subject to a time limit of 120s. + * Web requests are subject to a time limit of 55s. * Scheduled jobs are supported through different Add-ons. * Background workers are the recommended way of handling long running or asynchronous tasks. -Since a web request taking longer than 120s is killed by the routing tier, longer running tasks have to be handled asyncronously. +Since a web request taking longer than 55s is killed by the routing tier, longer running tasks have to be handled asyncronously. ### Cron @@ -740,21 +681,25 @@ For tasks that are guaranteed to finish within the time limit, the [Cron add-on] ### Workers -Tasks that will take longer than 120s to execute, or that are triggered by a user request and should be handled asyncronously to not keep the user waiting, are best handled by the [Worker add-on]. Workers are long-running processes started in containers. Just like the web processes but they are not listening on any port and therefore do not receive http requests. You can use workers, for example, to poll a queue and execute tasks in the background or handle long-running periodical calculations. More details on usage scenarios and available queuing Add-ons are available as part of the [Worker Add-on documentation]. +Tasks that will take longer than 55s to execute, or that are triggered by a user request and should be handled asyncronously to not keep the user waiting, are best handled by the [Worker add-on]. Workers are long-running processes started in containers. Just like the web processes but they are not listening on any port and therefore do not receive http requests. You can use workers, for example, to poll a queue and execute tasks in the background or handle long-running periodical calculations. More details on usage scenarios and available queuing Add-ons are available as part of the [Worker Add-on documentation]. ## Secure Shell (SSH) -The distributed nature of the cloudControl platform means it's not possible to SSH into the actual server. Instead, we offer the run command, that allows you to launch a new container and connect to that via SSH. +The distributed nature of the CloudKilat platform means it's not possible to SSH +into the actual server. Instead, we offer the run command, that allows you to +launch a new container and connect to that via SSH. -The container is identical to the web or worker containers but starts an SSH daemon instead of one of the Procfile commands. It's based on the same stack image and deployment image and does also provides the Add-on credentials. +The container is identical to the web or worker containers but starts an SSH +daemon instead of one of the Procfile commands. It's based on the same stack +image and deployment image and does also provides the Add-on credentials. ### Examples To start a shell (e.g. bash) use the `run` command. ~~~ -$ cctrlapp APP_NAME/DEP_NAME run bash +$ ironcliapp APP_NAME/DEP_NAME run bash Connecting... Warning: Permanently added '[10.62.45.100]:25832' (RSA) to the list of known hosts. u25832@DEP_ID-25832:~/www$ echo "interactive commands work as well" @@ -762,21 +707,21 @@ interactive commands work as well u25832@DEP_ID-25832:~/www$ exit exit Connection to 10.62.45.100 closed. -Connection to ssh.cloudcontrolled.net closed. +Connection to sshforwarder.kilatiron.net closed. ~~~ It's also possible to execute a command directly and have the container shutdown after the command is finished. This is very useful for database migrations and other one-time tasks. For example, passing the `"env | sort"` command will list the environment variables. Note that the use of the quotes is required for a command that includes spaces. ~~~ -$ cctrlapp APP_NAME/DEP_NAME run "env | sort" +$ ironcliapp APP_NAME/DEP_NAME run "env | sort" Connecting... Warning: Permanently added '[10.250.134.126]:10346' (RSA) to the list of known hosts. CRED_FILE=/srv/creds/creds.json DEP_ID=DEP_ID DEP_NAME=APP_NAME/DEP_NAME DEP_VERSION=9d5ada800eff9fc57849b3102a2f27ff43ec141f -DOMAIN=cloudcontrolled.com +DOMAIN=kilatiron.net GEM_PATH=vendor/bundle/ruby/1.9.1 HOME=/srv HOSTNAME=DEP_ID-10346 @@ -784,7 +729,7 @@ LANG=en_US.UTF-8 LOGNAME=u10346 MAIL=/var/mail/u10346 OLDPWD=/srv -PAAS_VENDOR=cloudControl +PAAS_VENDOR=CloudKilat PATH=bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin PORT=10346 PWD=/srv/www @@ -800,7 +745,7 @@ TMPDIR=/srv/tmp USER=u10346 WRK_ID=WRK_ID Connection to 10.250.134.126 closed. -Connection to ssh.cloudcontrolled.net closed. +Connection to sshforwarder.kilatiron.net closed. ~~~ ## Stacks @@ -809,57 +754,46 @@ Connection to ssh.cloudcontrolled.net closed. * Stacks define the common runtime environment. * They are based on Ubuntu and stack names match the Ubuntu release's first letter. - * Luigi supports only PHP. Pinky supports multiple languages according to the available [buildpacks](#buildpacks-and-the-procfile). + * Pinky is the current stack and supports multiple languages according to the available [buildpacks](#buildpacks-and-the-procfile). -A stack defines the common runtime environment for all deployments using it. By choosing the same stack for all your deployments, it's guaranteed that all your deployments find the same version of all OS components as well as all preinstalled libraries. +A stack defines the common runtime environment for all deployments using it. +This guarantees that all your deployments find the same version of all OS +components as well as all pre-installed libraries. -Stacks are based on Ubuntu releases and have the same first letter as the release they are based on. Each stack is named after a super hero sidekick. We try to keep them as close to the Ubuntu release as possible, but do make changes when necessary for security or performance reasons to optimize the stack for its specific purpose on our platform. +Stacks are based on Ubuntu releases and have the same first letter as the +release they are based on. Each stack is named after a super hero sidekick. We +try to keep them as close to the Ubuntu release as possible, but do make +changes when necessary for security or performance reasons to optimize the +stack for its specific purpose on our platform. ### Available Stacks - * **Luigi** based on [Ubuntu 10.04 LTS Lucid Lynx] * **Pinky** based on [Ubuntu 12.04 LTS Precise Pangolin] -You can change the stack per deployment. This is handy for testing new stacks before migrating the production deployment. Details are available via the `cctrlapp` command line interface. +Details about the current stack are available via the `ironcliapp` command line interface. ~~~ -$ cctrlapp APP_NAME/DEP_NAME details +$ ironcliapp APP_NAME/DEP_NAME details name: APP_NAME/DEP_NAME - stack: luigi + stack: pinky [...] ~~~ -To change the stack of a deployment simply append the --stack command line option to the `deploy` command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME deploy --stack [luigi,pinky] -~~~ - [generating SSH keys]: https://help.github.com/articles/generating-ssh-keys -[Custom Config Add-on]: https://www.cloudcontrol.com/dev-center/Add-on%20Documentation/Deployment/Custom%20Config -[web console]: https://www.cloudcontrol.com/console +[Custom Config Add-on]: /Add-on%20Documentation/Deployment/Custom%20Config.md +[web console]: http://www.cloudkilat.com/ [API libraries]: https://github.com/cloudControl -[the latest version]: http://cctrl.s3-website-eu-west-1.amazonaws.com/#windows/ +[the latest version]: https://www.cloudcontrol.com/download/win [Python 2.6+]: http://python.org/download/ -[reset your password]: https://api.cloudcontrol.com/reset_password/ [quick Git tutorial]: http://rogerdudler.github.com/git-guide/ -[Bazaar in five minutes]: http://doc.bazaar.canonical.com/latest/en/mini-tutorial/ [Heroku buildpack API]: https://devcenter.heroku.com/articles/buildpack-api -[guides]: https://www.cloudcontrol.com/dev-center/Guides -[MongoLab Add-on]: https://www.cloudcontrol.com/add-ons/mongolab -[Add-on marketplace]: https://www.cloudcontrol.com/add-ons -[Deployment category]: https://www.cloudcontrol.com/dev-center/Add-on%20Documentation/Deployment +[guides]: /Guides +[Add-on marketplace]: http://www.cloudkilat.com/ [rsyslog]: http://www.rsyslog.com/ [TLS]: http://en.wikipedia.org/wiki/Transport_Layer_Security -[Alias Add-on]: https://www.cloudcontrol.com/add-ons/alias -[Blitz.io]: https://www.cloudcontrol.com/dev-center/Add-on%20Documentation/Performance%20&%20Monitoring/Blitz.io -[MemCachier Add-on]: https://www.cloudcontrol.com/add-ons/memcachier +[Alias Add-on]: /Add-on%20Documentation/Deployment/Alias.md [Varnish]: https://www.varnish-cache.org/ -[MemCachier Documentation]: https://www.cloudcontrol.com/dev-center/Add-on%20Documentation/Data%20Storage/MemCachier -[New Relic Add-ons]: https://www.cloudcontrol.com/dev-center/Add-on%20Documentation/Performance%20&%20Monitoring/New%20Relic -[tutorial]: https://www.cloudcontrol.com/blog/best-practice-running-and-analyzing-load-tests-on-your-cloudcontrol-app -[Cron Add-on]: https://www.cloudcontrol.com/add-ons/cron -[Cron Add-on documentation]: https://www.cloudcontrol.com/dev-center/Add-on%20Documentation/Deployment/Cron -[Worker Add-on]: https://www.cloudcontrol.com/add-ons/worker -[Worker Add-on documentation]: https://www.cloudcontrol.com/dev-center/Add-on%20Documentation/Data%20Processing/Worker -[Ubuntu 10.04 LTS Lucid Lynx]: http://releases.ubuntu.com/lucid/ +[Cron Add-on]: /Add-on%20Documentation/Deployment/Cron.md +[Cron Add-on documentation]: /Add-on%20Documentation/Deployment/Cron.md +[Worker Add-on]: /Add-on%20Documentation/Data%20Processing/Worker.md +[Worker Add-on documentation]: /Add-on%20Documentation/Data%20Processing/Worker.md [Ubuntu 12.04 LTS Precise Pangolin]: http://releases.ubuntu.com/precise/ diff --git a/Quickstart.md b/Quickstart.md index 6121784..075400b 100644 --- a/Quickstart.md +++ b/Quickstart.md @@ -1,69 +1,60 @@ -# cloudControl Quickstart +# CloudKilat Quickstart -It's easy to start with cloudControl. Follow this 5 minute quickstart to get your first app running on cloudControl PaaS. +It's easy to start with CloudKilat. Follow this 5 minute quickstart to get your +first app running on CloudKilat PaaS. -**Note:** All examples starting with $ are supposed to be run in a terminal. For Windows we recommend using Git bash, which comes bundled with the Windows Git installer. Throughout this quickstart and the rest of the documentation placeholders are marked by being written all uppercase. +**Note:** All examples starting with $ are supposed to be run in a terminal. +For Windows we recommend using Git bash, which comes bundled with the Windows +Git installer. Throughout this quickstart and the rest of the documentation +placeholders are marked by being written all uppercase. ## Install the Required Software ### Requirements * git version control system -* cctrl command line client +* the ironcliuser/ ironcliapp command line clients ### Install git -Install Git from the [official site](http://git-scm.com/) or your package repository of choice. For Windows it's recommended to use the official installer and Git bash. Come back when you are done. +Install Git from the [official site](http://git-scm.com/) or your package +repository of choice. For Windows it's recommended to use the official +installer and Git bash. Come back when you are done. -### Install cctrl +### Install command line clients -**Linux/Mac OS X:** We recommend installing cctrl via pip. +**Linux/Mac OS X:** We recommend installing the command line clients via pip. ~~~bash # if you don't have pip yet $ sudo easy_install pip -$ sudo pip install cctrl +$ sudo pip install ironcli ~~~ -**Windows:** Please download the provided [installer](https://www.cloudcontrol.com/download/win). +**Windows:** Please download the provided [installer]. ## Create a User Account (if you haven't already) -You can register on the website or directly from the command line. Provide the required values when prompted. - -~~~bash -$ cctrluser create -Username: USERNAME -Email : EMAIL -Password: PASSWORD -Password (again): PASSWORD -User has been created. Please check you e-mail for your confirmation code. -~~~ - -Activate your user account with the activate command. - -~~~bash -$ cctrluser activate USERNAME ACTIVATION_CODE -~~~ - -Replace `USERNAME` and `ACTIVATION_CODE` with the values form the activation e-mail. If you didn't receive one, double check the spelling of your e-mail address or check your SPAM folder. +You can register on [www.cloudkilat.com](http://www.cloudkilat.com/). ## Add a Public Key ~~~bash -$ cctrluser key.add +$ ironcliuser key.add Email : EMAIL Password: PASSWORD ~~~ The command line client will determine if you already have a public key and upload that or offer to create one. -## Create the First Application on cloudControl +## Create the First Application on CloudKilat -Create a new application on the cloudControl platform by giving it an unique `APP_NAME` (the name is used as the `.cloudcontrolled.com` subdomain) and choosing the `TYPE`. +Create a new application on the CloudKilat platform by giving it an unique +`APP_NAME` (the name is used as the `.kilatiron.net` subdomain) and choosing the +`TYPE`. ~~~bash -$ cctrlapp APP_NAME create [java, php, python, ruby, nodejs] +$ ironcliapp APP_NAME create [java, php, python, ruby, nodejs] ~~~ If the `APP_NAME` is already taken, please pick another one. @@ -74,12 +65,13 @@ Change to the working directory where you want to store your source code. $ cd PATH_TO/YOUR_WORKDIR ~~~ -Clone one of the example apps in your preferred programming language and push it to the cloudControl platform. +Clone one of the example apps in your preferred programming language and push +it to the CloudKilat platform. ~~~bash # for Java -$ git clone https://github.com/cloudControl/java-jetty-example-app.git -$ cd java-jetty-example-app +$ git clone https://github.com/cloudControl/java-jetty-jsp-example-app.git +$ cd java-jetty-jsp-example-app # for PHP $ git clone https://github.com/cloudControl/php-silex-example-app.git @@ -98,29 +90,36 @@ $ git clone https://github.com/cloudControl/nodejs-express-example-app.git $ cd nodejs-express-example-app # now push -$ cctrlapp APP_NAME push +$ ironcliapp APP_NAME push ~~~ -The push fires a hook that prepares your application for deployment like pulling in requirements and more. You can see the output of the build process in your terminal. +The push fires a hook that prepares your application for deployment like +pulling in requirements and more. You can see the output of the build process +in your terminal. -## Deploy Your Application on cloudControl +## Deploy Your Application on CloudKilat Deploy your app with ~~~bash -$ cctrlapp APP_NAME deploy +$ ironcliapp APP_NAME deploy ~~~ **Congratulations, your app is now up and running.** ~~~bash -http[s]://APP_NAME.cloudcontrolled.com +http[s]://APP_NAME.kilatiron.net ~~~ ## Cheatsheet -Grab [our cheatsheet (PDF)](https://www.cloudcontrol.com/dev-center/cctrl_cheatsheet.pdf) to have the most important command line client commands handy at all times. +Grab [our cheatsheet (PDF)](/cloudkilat_cheatsheet.pdf) +to have the most important command line client commands handy at all times. ## Documentation -To learn more about all the platform features and how to integrate it seamlessly into the development life cycle please refer to the extensive [platform documentation](https://www.cloudcontrol.com/dev-center/Platform%20Documentation). +To learn more about all the platform features and how to integrate it +seamlessly into the development life cycle please refer to the extensive +[platform documentation](/Platform Documentation.md). + +[installer]: https://www.cloudcontrol.com/download/win diff --git a/README b/README index f0d2167..4bb243f 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -cloudControl Documentation +CloudKilat Documentation -Markdown source of the cloudControl documentation online at https://www.cloudcontrol.com/dev-center +Markdown source of the CloudKilat documentation online at http://www.cloudkilat.com/ For corrections or suggestions please send a pull request. diff --git a/cctrl_cheatsheet.pdf b/cloudkilat_cheatsheet.pdf similarity index 71% rename from cctrl_cheatsheet.pdf rename to cloudkilat_cheatsheet.pdf index 22b64b7..98d0a20 100644 Binary files a/cctrl_cheatsheet.pdf and b/cloudkilat_cheatsheet.pdf differ