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/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/QuotaGuardStatic.md b/Add-on Documentation/Data Processing/QuotaGuardStatic.md deleted file mode 100644 index ffe8705..0000000 --- a/Add-on Documentation/Data Processing/QuotaGuardStatic.md +++ /dev/null @@ -1,322 +0,0 @@ -# QuotaGuard Static - -QuotaGuard Static is an Add-on that allows you to route outbound traffic through a static IP address on cloudControl. You can provide this IP address to an API partner for IP based whitelisting and open your own firewall to access internal resources. - -QuotaGuard Static is accessible as an HTTP or SOCKS5 proxy so is language and platform agnostic. There is native support across Ruby, Python, Node.js, Scala, Java and every other mainstream language. - -## Adding QuotaGuard Static - -QuotaGuard Static can be added to every deployment with: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add quotaguardstatic.OPTION -~~~ - -## Upgrade QuotaGuard Static - -Upgrading to another version of QuotaGuard Static is easy and instant: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade quotaguardstatic.OPTION_OLD quotaguardstatic.OPTION_NEW -~~~ - -## Downgrade QuotaGuard Static - -Downgrading to another version of QuotaGuard Static is easy and instant and will not change your IP address: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade quotaguardstatic.OPTION_OLD quotaguardstatic.OPTION_NEW -~~~ - -## Removing QuotaGuard Static - -Removing QuotaGuard Static will instantly prevent you from accessing our proxy so use with caution. If you re-add the Add-On then you may be assigned a different IP address: - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove quotaguardstatic.OPTION -~~~ - -## Using QuotaGuard Static - -QuotaGuard Static provisioning provides you with a unique login to our proxy service exposed via a QUOTAGUARDSTATIC_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 RestClient gem: -~~~ruby -require "rest-client" - -RestClient.proxy = ENV["QUOTAGUARDSTATIC_URL"] - -res = RestClient.get("http://ip.jsontest.com/") - -puts "Your Static IP is: #{res.body}" -~~~ - -Alternatively you can read the QuotaGuard Static 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: - -~~~ -{ - "QUOTAGUARDSTATIC_URL":{ - "QUOTAGUARDSTATIC_URL":"http://username:password@static.quotaguard.com:9293/" - } -} -~~~ -## Monitoring QuotaGuard Static - -All our plans include real-time analytics and log access via our dashboard. Access this by logging in to your cloudControl console and clicking on the QuotaGuard Static Add-On from within one of your deployments. This will take you to your dashboard on QuotaGuard.com where you will be able to see your real-time and historic usage data. - -## HTTP vs. SOCKS5 proxy - -The first decision you must make is whether to target our HTTP or SOCKS proxy. SOCKS is more versatile as it handles TCP level traffic but the setup is more involved than the HTTP proxy. Our general rule of thumb is use HTTP if accessing a web service otherwise use SOCKS. - -Example use cases -1. Accessing an HTTP or HTTPS API (e.g. https://api.github.com/users/octocat/orgs) ==> **HTTP Proxy** -2. Accessing a MySQL database ==> **SOCKS Proxy** - -## QuotaGuard Static Code Examples - -###Ruby/Rails -Ruby has an excellent REST client that easily allows you to specify an HTTP proxy. You can run the below example in an irb session and verify that the final IP returned is one of your two static IPs. - -~~~ruby -require "rest-client" - -RestClient.proxy = ENV["QUOTAGUARDSTATIC_URL"] - -res = RestClient.get("http://ip.jsontest.com/") - -puts "Your Static IP is: #{res.body}" -~~~ - -### Python/Django -#### Using with the Requests library -[Requests](http://docs.python-requests.org/en/latest/) is a great HTTP library for Python. It allows you to specify an authenticated proxy on a per request basis so you can pick and choose when to route through your static IP. - -~~~python -import requests -import os - -proxies = { -"http": os.environ['QUOTAGUARDSTATIC_URL'] -} - -res = requests.get("http://ip.jsontest.com/", proxies=proxies) -print res.text -~~~ -#### Using with the urllib2 -urllib2 is a more basic library used for HTTP communication in Python and uses environment variables to set a proxy service. - -In your application initialization you should set the `http_proxy` variable to match the `QUOTAGUARDSTATIC_URL`. - -~~~python -# Assign QuotaGuard to your environment's http_proxy variable -os.environ['http_proxy'] = os.environ['QUOTAGUARDSTATIC_URL'] -~~~ - -To test in the Python interpreter - -~~~python -import urllib2, os -os.environ['http_proxy'] = os.environ['QUOTAGUARDSTATIC_URL'] -url = 'http://ip.jsontest.com/' -proxy = urllib2.ProxyHandler() -opener = urllib2.build_opener(proxy) -in_ = opener.open(url) -res = in_.read() -print res -~~~ - -###Node.js -####Accessing an HTTP API with Node.js -To access an HTTP API you can use the standard HTTP library in Node.js but must ensure you correctly set the “Host” header to your target hostname, not the proxy hostname. - -~~~javascript -var http, options, proxy, url; - -http = require("http"); - -url = require("url"); - -proxy = url.parse(process.env.QUOTAGUARDSTATIC_URL); -target = url.parse("http://ip.jsontest.com/"); - -options = { - hostname: proxy.hostname, - port: proxy.port || 80, - path: target.href, - headers: { - "Proxy-Authorization": "Basic " + (new Buffer(proxy.auth).toString("base64")), - "Host" : target.hostname - } -}; - -http.get(options, function(res) { - res.pipe(process.stdout); - return console.log("status code", res.statusCode); -}); -~~~ -####Accessing an HTTPS API with Node.js -The standard Node.js HTTPS module does not handle making requests through a proxy very well. If you need to access an HTTPS API we recommend using the Request module (npm install request). - -~~~javascript -var request = require('request'); - -var options = { - proxy: process.env.QUOTAGUARDSTATIC_URL, - url: 'https://api.github.com/repos/joyent/node', - headers: { - 'User-Agent': 'node.js' - } -}; - -function callback(error, response, body) { - if (!error && response.statusCode == 200) { - console.log(body); - } -} - -request(options, callback); -~~~ -####Accessing a MySQL Database using SOCKS Proxy in Node.js -To use a SOCKS proxy for any reason in Node.js we recommend socksjs as this is one of the only Node.js SOCKS modules to support authentication. -~~~bash -npm install socksjs -~~~ -This sample creates a connection to a SOCKS connection to our proxy and uses that for all MySQL requests. -~~~javascript -var mysql = require('mysql2'); -var url = require("url"); -var SocksConnection = require('socksjs'); -var remote_options = { -host:'mysql.db.hostname', -port: 3306 -}; -var proxy = url.parse(process.env.QUOTAGUARDSTATIC_URL); -var auth = proxy.auth; -var username = auth.split(":")[0] -var pass = auth.split(":")[1] - -var sock_options = { -host: proxy.hostname, -port: 1080, -user: username, -pass: pass -} -var sockConn = new SocksConnection(remote_options, sock_options) -var dbConnection = mysql.createConnection({ -user: 'test', -database: 'test', -password: 'testpw', -stream: sockConn -}); -dbConnection.query('SELECT 1+1 as test1;', function(err, rows, fields) { -if (err) throw err; - -console.log('Result: ', rows); -sockConn.dispose(); -}); -dbConnection.end(); -~~~ -###Using with PHP -PHP cURL is the easiest way to make HTTP requests via QuotaGuard Static. This example assumes that you have set the QUOTAGUARDSTATIC_URL environment variable which is automatically set for you when you provision the Add-On. - -The IP address printed on screen will be one of your two static IP addresses, run it a couple of times and you’ll probably see the other one too - -~~~php - -~~~ -###SOCKS proxy setup -QuotaGuard Static provides a wrapper script that transparently forwards all outbound TCP traffic through your Static IP. This is language independent but there are known issues with certain Node.js connections hanging so please contact us if you have any issues. - -####Installing the QuotaGuard Static socksify wrapper -Download and extract the wrapper in your app directory: - -~~~bash -$ curl https://s3.amazonaws.com/quotaguard/quotaguard-socksify-latest.tar.gz | tar xz -~~~ - -Now modify your app Procfile to prepend the wrapper to your standard commands: - -~~~bash - web: bin/qgsocksify bundle exec unicorn -p $PORT -c ./config/unicorn.rb -~~~ - -You should add all extracted files to your git repo except QUOTAGUARD-LICENSE.txt which can be gitignored. - -~~~bash -$ echo "QUOTAGUARD-LICENSE.txt" >> .gitignore -$ git add bin/qgsocksify vendor/dante -$ git commit -m "Add QuotaGuard Static socksify" -~~~ - -####Controlling what traffic goes through proxy -You can provide a standard subnet mask to only route traffic to certain IP subnets via the QUOTAGUARDSTATIC_MASK environment variable. - -~~~bash -$ cctrlapp app_name/dep_name config.add QUOTAGUARDSTATIC_MASK="100.30.68.0/24" -~~~ - -All outbound traffic to 100.30.68.* would be routed via your Static IPs. Multiple masks can be provided by comma separating the mask values: - -~~~bash -$ cctrlapp app_name/dep_name config.add QUOTAGUARDSTATIC_MASK="100.30.68.0/24,99.29.68.0/24" -~~~ - -###FAQs - -####Is the HTTP proxy secure when accessing HTTPS services? -Yes. You can access HTTPS services via the HTTP proxy whilst still getting full SSL/TLS security. When you make a request via the proxy to an HTTPS endpoint your client should transparently issue a CONNECT request rather than a basic GET request. - -On receipt of this CONNECT request the proxy will open a tunnel between your client and the endpoint, allowing your client to negotiate a standard SSL session with the endpoint. Once negotiated all traffic sent between your client and the endpoint will be encrypted as if you had connected directly with them. - -####What happens when I reach my usage limit? -To make sure we grow in harmony with your application QuotaGuard Static operates initially with a soft limit. When you reach your plan’s monthly usage limit your requests will continue going through but we will reach out to you via e-mail to ask that you upgrade your plan. - -If you repeatedly exceed your limits without upgrading then hard limits may be placed on your account but this is a very last resort. - -####I’ve forgotten what my Static IPs are! -Both IPs are shown on your QuotaGuard Static Dashboard which you can access by logging in to your cloudControl console and clicking on the QuotaGuard Static Add-On from within one of your deployments. - -####Why have you given me two Static IP addresses? -We believe all apps should be built for scalability and high availability. Our commitment to this means we only provide load balanced, high availability services. Load balancing our nodes allows one node to fail or be brought down for maintenance with no impact to your application. Each IP you are given represents one proxy node that is running behind a load balancer. - -####Can I access MySQL or Postgres through this? -Yes we have many users doing this. The easiest way for most languages is to use our SOCKS proxy wrapper(installation details higher up the page). If you are using Node.js you can also configure the SOCKS proxy in your Javascript code without using the wrapper (details also on this page). - -###QuotaGuard vs. QuotaGuard Static -We offer two products on cloudControl, QuotaGuard and QuotaGuard Static. - -QuotaGuard routes your traffic through a dynamic set of IP addresses that may change at any time and is intended for accessing APIs like Google Maps that restrict usage based on your IP address. It should be used if you want to access these APIs without your limit being shared with other cloudControl apps. - -QuotaGuard Static routes your traffic through a pair of static IP addresses that never change. It should be used if you need your traffic to pass through a known IP address for the purpose of firewall ingress rules or application whitelisting with a third party. - -Please [send us a mail](mailto:support@teachmatic.com) if you’d like more guidance on what service fits your needs best. - -## 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 deleted file mode 100644 index f09f866..0000000 --- a/Add-on Documentation/Data Processing/Worker.md +++ /dev/null @@ -1,151 +0,0 @@ -# Worker Add-on - -Workers are long running background processes. They are typically used for -anything from sending emails to running heavy calculations or rebuilding caches -in the background. - -Each worker started via the Worker add-on runs in a seperate isolated -container. The containers have exactly the same runtime environment defined by -the stack chosen and the buildpack used and have the same access to all of the -deployments add-ons. - -Note: Workers sometimes get interrupted and restarted on a different host for -the following reasons: - - single instances can run into issues and need to be replaced - - containers are redistributed to provide the best performance - - security updates are applied - -This means all your worker operations should be idempotent. If possible a `SIGTERM` -signal is send to your worker before the shutdown. - -## Adding the Worker Add-on - -Before you can start a worker, add the add-on with the addon.add command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add worker.single -~~~ - -## Starting a Worker - -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`. - -~~~ -$ cctrlapp 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" -~~~ - -## List Running Workers - -To get a list of currently running workers use the worker command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME worker -Workers - nr. wrk_id - 1 WRK_ID -~~~ - -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 -Worker -wrk_id : WRK_ID -command : WORKER_NAME -params : "PARAM1 PARAM2 PARAM3" -~~~ - -## Stopping Workers - -Workers can be either stopped via the command line client or by exiting the process with a zero exit code. - -### Via Command Line - -To stop a running worker via the command line use the worker.remove command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME worker.remove WRK_ID -~~~ - -To get the WRK_ID refer to the listing workers section above. - -### Via Exit Codes - -To stop a worker programatically use UNIX style exit codes. There are three distinct exit codes available. - - * exit (0); // Everything OK. Worker will be stopped. - * exit (1); // Error. Worker will be restarted. - * exit (2); // Error. Worker will be stopped. - -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. - -~~~ -$ cctrlapp 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 -[...] -~~~ - -## Removing the Worker Add-on - -To remove the Worker add-on use the addon.remove command. - -~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove worker.single -~~~ - -## PHP Worker Example - -The following example shows how to use the exit codes to restart or stop a worker. - -~~~php -// read exit code parameter -$exitCode = isset($argv[1]) && (int)$argv[1] > 0 ? (int)$argv[1] : 0; -$steps = 5; - -$counter = 1; -while(true) { - print "step: " . ($counter) . PHP_EOL; - if($counter == $steps){ - if($exitCode == 0) { - print "All O.K. Exiting." . PHP_EOL; - } else if ($exitCode == 2){ - print "An error occured. Exiting." . PHP_EOL; - } else { - print "An error occured. Restarting." . PHP_EOL; - } - print "Exitcode: " . $exitCode . PHP_EOL . PHP_EOL; - exit($exitCode); - } - sleep(1); - $counter++; -} -~~~ - -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 -[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 -[Tue Apr 12 09:15:56 2011] WRK_ID step: 3 -[Tue Apr 12 09:15:57 2011] WRK_ID step: 4 -[Tue Apr 12 09:15:58 2011] WRK_ID step: 5 -[Tue Apr 12 09:15:58 2011] WRK_ID An error occured. Exiting. -[...] -~~~ - 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/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/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/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 ae5b779..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/ Upgrade status 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 65 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/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/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/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/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 574af14..0000000 --- a/Add-on Documentation/Performance & Monitoring/New Relic.md +++ /dev/null @@ -1,47 +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, NewRelic automatically creates a new account and login configuration including an -access token. You can access NewRelic for your deployment in the web console via Single Sign-On (SSO). -Navigate to the specific deployment, choose "Add-Ons" tab, click on "Settings" link and "Login to dashboard". -It might take a little while until New Relic has collected enough data to show you the first statistics. - -With Single Sign-On, you are connecting to NewRelic as the deployment user. -If you prefer to login directly with your personal account, or you need to add more users, -simply create additional credentials once you have accessed NewRelic via SSO. - -## 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/Add-on Documentation/Deployment/Alias.md b/Add-on-Documentation/Alias.md similarity index 71% rename from Add-on Documentation/Deployment/Alias.md rename to Add-on-Documentation/Alias.md index 4057251..0a9e453 100644 --- a/Add-on Documentation/Deployment/Alias.md +++ b/Add-on-Documentation/Alias.md @@ -11,7 +11,7 @@ custom domain follow the following simple steps **for each domain**. 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 + $ dcapp APP_NAME/default alias APP_NAME.dotcloudapp.com ~~~ 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. @@ -24,29 +24,29 @@ custom domain follow the following simple steps **for each domain**. 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`. + Since we are going to use a CNAME to point the custom domain to the provided `.dotcloudapp.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. + 1. Add a CNAME pointing to the provided `.dotcloudapp.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. + In addition to the TXT record, go ahead and also add a CNAME pointing to your apps `.dotcloudapp.com` 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 + $ dcapp APP_NAME/default alias Aliases name default verified - APP_NAME.cloudcontrolled.com 1 1 + APP_NAME.dotcloudapp.com 1 1 # for any additional deployment - $ cctrlapp APP_NAME/DEP_NAME alias + $ dcapp APP_NAME/DEP_NAME alias Aliases name default verified - DEP_NAME.APP_NAME.cloudcontrolled.com 1 1 + DEP_NAME.APP_NAME.dotcloudapp.com 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.dotcloudapp.com. ~~~ 1. Add one alias per domain to your deployment. @@ -54,13 +54,13 @@ custom domain follow the following simple steps **for each domain**. 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 + $ dcapp 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 + $ dcapp APP_NAME/DEP_NAME alias Aliases name default verified www.example.com 0 0 @@ -74,7 +74,7 @@ custom domain follow the following simple steps **for each domain**. 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 + $ dcapp APP_NAME/DEP_NAME alias Aliases name default verified www.example.com 0 1 @@ -86,7 +86,7 @@ custom domain follow the following simple steps **for each domain**. To remove an alias, simply use the alias.remove command. ~~~ -$ cctrlapp APP_NAME/DEP_NAME alias.remove www.example.com +$ dcapp APP_NAME/DEP_NAME alias.remove www.example.com ~~~ ## Special Case: Wildcard Domains @@ -96,13 +96,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 +$ dcapp 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 +$ dcapp 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/Data Processing/CloudAMQP.md b/Add-on-Documentation/CloudAMQP.md similarity index 73% rename from Add-on Documentation/Data Processing/CloudAMQP.md rename to Add-on-Documentation/CloudAMQP.md index 7cede1d..e2086a1 100644 --- a/Add-on Documentation/Data Processing/CloudAMQP.md +++ b/Add-on-Documentation/CloudAMQP.md @@ -7,7 +7,7 @@ CloudAMQP is a hosted RabbitMQ service, with high availability and blazing perfo 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 +$ dcapp APP_NAME/DEP_NAME addon.add cloudamqp.OPTION ~~~ ".option" represents the plan size, e.g. cloudamqp.lemur @@ -16,7 +16,7 @@ $ cctrlapp APP_NAME/DEP_NAME addon.add cloudamqp.OPTION Upgrading to another option can easily be done: ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.upgrade cloudamqp.OPTION_OLD cloudamqp.OPTION_NEW +$ dcapp APP_NAME/DEP_NAME addon.upgrade cloudamqp.OPTION_OLD cloudamqp.OPTION_NEW ~~~ ## Downgrade the CloudAMQP Add-on @@ -24,7 +24,7 @@ $ cctrlapp APP_NAME/DEP_NAME addon.upgrade cloudamqp.OPTION_OLD cloudamqp.OPTION Downgrading to another option can easily be done: ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade cloudamqp.OPTION_OLD cloudamqp.OPTION_NEW +$ dcapp APP_NAME/DEP_NAME addon.downgrade cloudamqp.OPTION_OLD cloudamqp.OPTION_NEW ~~~ ## Removing the CloudAMQP Add-on @@ -32,12 +32,12 @@ $ cctrlapp APP_NAME/DEP_NAME addon.downgrade cloudamqp.OPTION_OLD cloudamqp.OPTI 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 +$ dcapp 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. +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://next.dotcloud.com/dev-center/platform-documentation#add-ons) in the general documentation. ## PHP AMQP Example Application diff --git a/Add-on Documentation/Deployment/Custom Config.md b/Add-on-Documentation/Config.md similarity index 86% rename from Add-on Documentation/Deployment/Custom Config.md rename to Add-on-Documentation/Config.md index 7a76432..cb7ab9a 100644 --- a/Add-on Documentation/Deployment/Custom Config.md +++ b/Add-on-Documentation/Config.md @@ -18,7 +18,7 @@ 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 +$ dcapp APP_NAME/DEP_NAME config.add KEY=VALUE ~~~ This will automatically add the Config Add-on to your deployment. @@ -30,7 +30,7 @@ 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 [...] +$ dcapp APP_NAME/DEP_NAME config.add KEY1=VALUE1 KEY2=VALUE2 [...] ~~~ Config parameters can be set using the format shown in first column of the @@ -53,7 +53,7 @@ You can list the existing set of configuration settings by invoking the config command: ~~~bash -$ cctrlapp APP_NAME/DEP_NAME config +$ dcapp APP_NAME/DEP_NAME config KEY1=VALUE1 KEY2=VALUE2 ~~~ @@ -61,7 +61,7 @@ KEY2=VALUE2 To show the value of a specific key, simply append the desired key name: ~~~bash -$ cctrlapp APP_NAME/DEP_NAME config KEY +$ dcapp APP_NAME/DEP_NAME config KEY VALUE ~~~ @@ -71,8 +71,8 @@ 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 [...] +$ dcapp APP_NAME/DEP_NAME config.add [-f|--force] NEW_PARAM=NEW_VALUE [...] +$ dcapp APP_NAME/DEP_NAME config.remove PARAM1 PARAM2 [...] ~~~ Updating the existing settings is also possible using the `add` command. This @@ -85,7 +85,7 @@ 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 +$ dcapp APP_NAME/DEP_NAME addon.remove config.free ~~~ This will remove all the custom configuration settings. diff --git a/Add-on Documentation/Deployment/Cron.md b/Add-on-Documentation/Cron.md similarity index 59% rename from Add-on Documentation/Deployment/Cron.md rename to Add-on-Documentation/Cron.md index bd1d551..b54d252 100644 --- a/Add-on Documentation/Deployment/Cron.md +++ b/Add-on-Documentation/Cron.md @@ -3,8 +3,8 @@ ## 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 +are periodically executed. On dotCloud however, there is no one node that +the cronjob can run on. Therefore cronjobs on dotCloud are periodical calls to a URL you specify. ## How does it work? @@ -14,27 +14,25 @@ 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 to the same 120s -timelimit. +Cronjobs are regular requests against your app and are subject to the same +timelimit as [HTTP-Requests](https://www.dotcloud.com/dev-center/platform-documentation#routing-tier). 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. +longer running tasks we recommend using a +[Worker](https://next.dotcloud.com/dev-center/platform-documentation#workers) +or the [CloudAMQP](https://next.dotcloud.com/add-ons/cloudamqp) message queues +that can be used to dispatch tasks to the workers. ## Adding the Cron Add-on Before you can add a Cron job, the Add-on itself has to be added: ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add cron.OPTION +$ dcapp 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. +Add-on](https://next.dotcloud.com/add-ons/cron) page. ## Adding a URL for the Cron job @@ -42,20 +40,21 @@ 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 +$ dcapp APP_NAME/DEP_NAME cron.add http[s]://[user:password@]APP_NAME.dotcloudapp.com # for any additional deployment -$ cctrlapp APP_NAME/DEP_NAME cron.add http[s]://[user:password@]DEP_NAME.APP_NAME.cloudcontrolled.com +$ dcapp APP_NAME/DEP_NAME cron.add http[s]://[user:password@]DEP_NAME.APP_NAME.dotcloudapp.com ~~~ You can only add cron jobs calling a verified alias of the deployment. It is -recommended to use https when sending credentials. Please, note that URL must be fully encoded. +recommended to use https when sending credentials. Please, note that URL must be +fully encoded. ## List Cron overview Get an overview of all your Cron jobs: ~~~ -$ cctrlapp APP_NAME/DEP_NAME cron +$ dcapp APP_NAME/DEP_NAME cron ~~~ ## Cron details @@ -63,10 +62,10 @@ $ cctrlapp APP_NAME/DEP_NAME cron Get the details of a specific Cron job: ~~~ -$ cctrlapp APP_NAME/DEP_NAME cron CRON_ID +$ dcapp APP_NAME/DEP_NAME cron CRON_ID Cronjob job_id : jobkqy7rdmg - url : http://APP_NAME.cloudcontrolled.com + url : http://APP_NAME.dotcloudapp.com next_run : 2011-05-09 19:39:39 created : 2011-05-05 19:39:39 modified : 2011-05-05 19:39:39 @@ -77,7 +76,7 @@ Cronjob You can remove a Cron job by the job_id ~~~ -$ cctrlapp APP_NAME/DEP_NAME cron.remove JOB_ID +$ dcapp APP_NAME/DEP_NAME cron.remove JOB_ID ~~~ ## Upgrading / downgrading the Cron addon @@ -86,13 +85,13 @@ 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 +$ dcapp APP_NAME/DEP_NAME addon.upgrade cron.free cron.hourly ~~~ or ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade cron.hourly cron.free +$ dcapp 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 @@ -103,8 +102,7 @@ hourly Add-on will stay hourly. Removing the Add-on itself can be done with: ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.remove cron.OPTION +$ dcapp APP_NAME/DEP_NAME addon.remove cron.OPTION ~~~ Please note: Removing the Add-on will not automatically remove all Cron jobs. - diff --git a/Add-on Documentation/Data Storage/ElephantSQL.md b/Add-on-Documentation/ElephantSQL.md similarity index 76% rename from Add-on Documentation/Data Storage/ElephantSQL.md rename to Add-on-Documentation/ElephantSQL.md index 8aeb94d..b287c5f 100644 --- a/Add-on Documentation/Data Storage/ElephantSQL.md +++ b/Add-on-Documentation/ElephantSQL.md @@ -9,18 +9,18 @@ As a full-featured, open-source relational DBMS (RDBMS), PostgreSQL boasts many To add the ElephantSQL Add-on use the addon.add command. ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.add elephantsql.OPTION +$ dcapp 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"). +When added, ElephantSQL automatically creates a new user account with your email adress. You can manage the Add-on within the [web console](https://next.dotcloud.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 +$ dcapp APP_NAME/DEP_NAME addon.upgrade elephantsql.OPTION_OLD elephantsql.OPTION_NEW ~~~ Please note: Upgrading works only between shared plans or between dedicated @@ -33,7 +33,7 @@ later. To downgrade to a smaller plan use the addon.downgrade command. ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade elephantsql.OPTION_OLD elephantsql.OPTION_NEW +$ dcapp APP_NAME/DEP_NAME addon.downgrade elephantsql.OPTION_OLD elephantsql.OPTION_NEW ~~~ ## Removing the ElephantSQL Add-on @@ -41,11 +41,11 @@ $ cctrlapp APP_NAME/DEP_NAME addon.downgrade elephantsql.OPTION_OLD elephantsql. 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 +$ dcapp 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. +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://next.dotcloud.com/dev-center/platform-documentation#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/MemCachier.md b/Add-on-Documentation/MemCachier.md similarity index 91% rename from Add-on Documentation/Data Storage/MemCachier.md rename to Add-on-Documentation/MemCachier.md index e0c75ff..15125e4 100644 --- a/Add-on Documentation/Data Storage/MemCachier.md +++ b/Add-on-Documentation/MemCachier.md @@ -2,19 +2,19 @@ [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/). +The information below will quickly get you up and running with the MemCachier Add-on for dotCloud. 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 + $ dcapp 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 + $ dcapp APP_NAME/DEP_NAME addon.add memcachier.100mb + $ dcapp 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: @@ -226,7 +226,7 @@ Memcached provided by MemCachier can be used like this: ~~~ -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. +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 dotCloud stacks. Java ---- @@ -349,9 +349,9 @@ MemCachier will work with any Memcached binding that supports [SASL authenticati 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. +To test against your dotCloud application locally, you will need to run a local Memcached process. MemCachier can only run on dotCloud 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. +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 dotCloud. On Ubuntu: @@ -378,7 +378,7 @@ $ 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). +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://next.dotcloud.com/console). Sample apps ----- @@ -398,7 +398,7 @@ Changing your plan, either by upgrading or downgrading, requires no code changes 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) +All Memcachier support and runtime issues should be submitted via one of the dotCloud Support channels](https://next.dotcloud.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/MemcachedCloud.md b/Add-on-Documentation/MemcachedCloud.md new file mode 100644 index 0000000..d74d902 --- /dev/null +++ b/Add-on-Documentation/MemcachedCloud.md @@ -0,0 +1,51 @@ +# Memcached Cloud +[Memcached Cloud] is a fully-managed service for hosting and running your Memcached +in a reliable and fail-safe manner. + +## Adding the Memcached Cloud Add-on + +To add the Memcached Cloud Add-on use the addon.add command. + +~~~ +$ dcapp APP_NAME/DEP_NAME addon.add memcachedcloud.OPTION +~~~ +Replace `memcachedcloud.OPTION` with a valid option, e.g. `memcachedcloud.25mb`. + +When added, Memcached Cloud automatically creates a new user account with your email address. You can +manage the Add-on within the [web console](/console) (go to the specific deployment and click the link "memcachedcloud.OPTION"). + +## Upgrading the Memcached Cloud Add-on + +To upgrade from a smaller to a more powerful plan use the addon.upgrade command. + +~~~ +$ dcapp APP_NAME/DEP_NAME addon.upgrade memcachedcloud.OPTION_OLD memcachedcloud.OPTION_NEW +~~~ + +## Downgrading the Memcached Cloud Add-on + +To downgrade to a smaller plan use the addon.downgrade command. + +~~~ +$ dcapp APP_NAME/DEP_NAME addon.downgrade memcachedcloud.OPTION_OLD memcachedcloud.OPTION_NEW +~~~ + +## Removing the Memcached Cloud Add-on + +The Memcached Cloud Add-on can be removed from the deployment by using the addon.remove command. + +~~~ +$ dcapp APP_NAME/DEP_NAME addon.remove memcachedcloud.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] in the general documentation. + + +[Memcached Cloud]: https://redislabs.com/memcached-cloud +[Add-on Credentials]: /dev-center/platform-documentation#add-ons diff --git a/Add-on Documentation/Data Storage/MongoSoup.md b/Add-on-Documentation/MongoSoup.md similarity index 81% rename from Add-on Documentation/Data Storage/MongoSoup.md rename to Add-on-Documentation/MongoSoup.md index 0be03a0..16c5d59 100644 --- a/Add-on Documentation/Data Storage/MongoSoup.md +++ b/Add-on-Documentation/MongoSoup.md @@ -6,25 +6,25 @@ running MongoDB database in virtually no time. ## MongoSoup -The MongoSoup Add-on can be added to any deployment from the cctrlapp command +The MongoSoup Add-on can be added to any deployment from the dcapp command line: ~~~bash -$ cctrlapp APP_NAME/DEP_NAME addon.add mongosoup.OPTION +$ dcapp 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). +[here](https://next.dotcloud.com/add-ons/mongosoup). ## For example: ~~~bash -$ cctrlapp APP_NAME/DEP_NAME addon.add mongosoup.large +$ dcapp 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 +[web console](https://next.dotcloud.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. @@ -36,7 +36,7 @@ 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. +notified through the email address you\92ve provided to dotCloud. MongoSoup's entry in your application CRED_FILE looks like this: ~~~ @@ -47,7 +47,7 @@ MongoSoup's entry in your application CRED_FILE looks like this: } ~~~ -Your app-name, password and db-name are all automatically generated by cloudControl and MongoSoup. +Your app-name, password and db-name are all automatically generated by dotCloud and MongoSoup. ## Samples @@ -70,8 +70,8 @@ Here are some snippets of code to help you get started: ### 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) +For reading dotCloud credentials you can use the Credentials class as +described in [Reading the Credentials](https://next.dotcloud.com/dev-center/guides/java/add-on-credentials) article. ```java @@ -133,9 +133,9 @@ changes are required. ## Removing MongoSoup -If you'd like to remove the MongoSoup add-on, use the cctrlapp command line: +If you'd like to remove the MongoSoup add-on, use the dcapp command line: ~~~bash -$ cctrlapp APP_NAME/DEP_NAME addon.remove mongosoup.OPTION +$ dcapp APP_NAME/DEP_NAME addon.remove mongosoup.OPTION ~~~ Note: All data in your database will be lost if you remove the MongoSoup diff --git a/Add-on Documentation/Data Storage/MySQLd.md b/Add-on-Documentation/MySQLd.md similarity index 54% rename from Add-on Documentation/Data Storage/MySQLd.md rename to Add-on-Documentation/MySQLd.md index a31457b..55cc9ce 100644 --- a/Add-on Documentation/Data Storage/MySQLd.md +++ b/Add-on-Documentation/MySQLd.md @@ -2,13 +2,9 @@ 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. +based on [Google Cloud SQL] and synchronous replication in multiple zones. -## Features of the cloudControl MySQLd Add-on +## Features of the dotCloud MySQLd Add-on The MySQLd Add-on comes with the following features: @@ -16,7 +12,7 @@ The MySQLd Add-on comes with the following features: - 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 + - Automatic Software Patching - dotCloud will make sure that the MySQL software powering your deployment stays up-to-date with the latest patches. @@ -26,33 +22,37 @@ The MySQLd Add-on comes with the following features: - 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. + - Multiple Zones Data Replication - Your data is replicated in many geographic locations + as standard. Failover between them is handled automatically by us. Your data is + safe and your database is available even in the event of a major failure in one location. 4. Dashboard - - View key operational metrics like CPU/ Memory/ Storage/ Connections/ Upgrade status for your DB Instance deployments via [Webconsole]. + - View key operational metrics like Storage or Connections for your DB Instance deployments via [Webconsole]. + - Download the SSL Certificate for encrypted external connections. + +5. Security + - All data is encrypted when on internal networks and when stored in database + tables and temporary files. + - Connections can be encrypted using SSL. ## 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 +$ dcapp APP_NAME/DEP_NAME addon.add mysqld.OPTION ~~~ -Replace `mysqld.OPTION` with a valid option, e.g. `mysqld.small`. See +Replace `mysqld.OPTION` with a valid option, e.g. `mysqld.d0`. 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. +Please note: After adding a dedicated MySQL database, it can take up to 5 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 +$ dcapp 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 65 minutes and can involve a 3 to 10 minute downtime. @@ -62,7 +62,7 @@ Please note: Upgrading the instance types is a multi step process that first upg To downgrade to a smaller plan, use the `addon.downgrade` command: ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.downgrade mysqld.OPTION_OLD mysqld.OPTION_NEW +$ dcapp 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 @@ -74,17 +74,18 @@ sizes. 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 +$ dcapp 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. +All instances replicated in multiple zones. In the unlikely event of a zone outage, +instances fail over to another, available, zone automatically. Failover is designed to +be transparent to your applications, so that after failover, an instance has the same +instance name, IP address, and firewall rules. During the failover there will typically +be a few seconds downtime as the instance starts up in a new zone. ## Database Credentials @@ -101,24 +102,24 @@ general documentation. 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. Download the SSL certificate file from the Dashboard via [Webconsole]. 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 +$ mysql -u MYSQLD_USERNAME -p --host=MYSQLD_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 mysqld.OPTION -Addon : mysqld.small +$ dcapp APP_NAME/DEP_NAME addon mysqld.OPTION +Addon : mysqld.d0 Settings MYSQLD_PASSWORD : SOME_SECRET_PASSWORD - MYSQLD_USER : SOME_SECRET_USER - MYSQLD_HOST : SOME_HOST.eu-west-1.rds.amazonaws.com + MYSQLD_USERNAME : SOME_SECRET_USERNAME + MYSQLD_HOSTNAME : SOME_HOSTNAME MYSQLD_DATABASE : SOME_DATABASE_NAME MYSQLD_PORT : 3306 MYSQLD_URL : SOME_DATABASE_URL @@ -128,19 +129,18 @@ 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 +$ mysqldump -u MYSQLD_USERNAME -p --host=MYSQLD_HOSTNAME --ssl-ca=PATH_TO_CERTIFICATE/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 +$ mysql -u MYSQLD_USERNAME -p --host=MYSQLD_HOSTNAME --ssl-ca=PATH_TO_CERTIFICATE/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 +[Google Cloud SQL]: https://developers.google.com/cloud-sql/ +[Config Add-on]: https://next.dotcloud.com/add-ons/config +[MySQLd]: https://next.dotcloud.com/add-ons/mysqld +[Add-on Credentials]: https://next.dotcloud.com/dev-center/platform-documentation#add-ons +[Email us]: mailto:support@dotcloud.com +[Webconsole]: https://next.dotcloud.com/console/login diff --git a/Add-on Documentation/Data Storage/MySQLs.md b/Add-on-Documentation/MySQLs.md similarity index 52% rename from Add-on Documentation/Data Storage/MySQLs.md rename to Add-on-Documentation/MySQLs.md index 817b3d1..07bb51e 100644 --- a/Add-on Documentation/Data Storage/MySQLs.md +++ b/Add-on-Documentation/MySQLs.md @@ -1,15 +1,15 @@ # 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/). +Every deployment can access a highly available shared MySQL Add-on based on [Google Cloud SQL](https://cloud.google.com/sql/). 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. +recommend one of the dedicated [MySQLd Add-on](https://next.dotcloud.com/add-ons/mysqld) plans. ## 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 +$ dcapp APP_NAME/DEP_NAME addon.add mysqls.OPTION ~~~ Replace `mysqls.OPTION` with a valid option, e.g. `mysqls.free`. @@ -18,7 +18,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 +$ dcapp APP_NAME/DEP_NAME addon.upgrade mysqls.OPTION_OLD mysqls.OPTION_NEW ~~~ ## Downgrading the MySQLs Add-on @@ -26,7 +26,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 +$ dcapp APP_NAME/DEP_NAME addon.downgrade mysqls.OPTION_OLD mysqls.OPTION_NEW ~~~ ## Removing the MySQLs Add-on @@ -36,46 +36,12 @@ 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 +$ dcapp 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. - -## Encoding - -All databases and tables use `latin1` as the default character set. You can find the character set -and collation of all your tables by running `SHOW STATUS TABLE;` under the `Collation` row. - -You can change the encoding of a table with this query: - -~~~ -ALTER TABLE CHARSET=; -~~~ - -Or create a new table with an explicit encoding adding a `CHARSET` value to the query: - -~~~ -CREATE TABLE ( - `id` int, - ...... - ) CHARSET=; -~~~ - -Or change the default character set for a database, so all tables created would use this enconding: - -~~~ -ALTER DATABASE CHARSET ; -~~~ - -You can find a list with all character sets supported by MySQL with this query: - -~~~ -SHOW CHARSET; -~~~ +Your data is replicated in many geographic locations as standard. Failover between them is handled automatically by us. Your data is safe and your database is available even in the event of a major failure in one location ## Database Credentials @@ -84,33 +50,33 @@ SHOW CHARSET; 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 +section about [Add-on Credentials](https://next.dotcloud.com/dev-center/platform-documentation#add-ons) in the general documentation. ### 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](https://storage.googleapis.com/dotcloudapp-ca/addon_mysqls_ca.pem) 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/addon_mysqls_ca.pem ~~~ Replace the uppercase variables with the corresponding values shown by the addon command. ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon mysqls.OPTION +$ dcapp APP_NAME/DEP_NAME addon mysqls.OPTION Addon : mysqls.512mb Settings MYSQLS_PASSWORD : SOME_SECRET_PASSWORD MYSQLS_USERNAME : SOME_SECRET_USERNAME -MYSQLS_HOSTNAME : SOME_HOST.eu-west-1.rds.amazonaws.com:3306 +MYSQLS_HOSTNAME : SOME_HOSTNAME MYSQLS_DATABASE : SOME_DATABASE_NAME ~~~ @@ -118,11 +84,11 @@ 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/addon_mysqls_ca.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/addon_mysqls_ca.pem MYSQLS_DATABASE < MYSQLS_DATABASE.sql ~~~ diff --git a/Add-on-Documentation/RedisCloud.md b/Add-on-Documentation/RedisCloud.md new file mode 100644 index 0000000..6f7c993 --- /dev/null +++ b/Add-on-Documentation/RedisCloud.md @@ -0,0 +1,51 @@ +# Redis Cloud +[Redis Cloud] is a fully-managed cloud service for hosting and running your Redis dataset in a +highly-available and scalable manner, with predictable and stable top performance. + +## Adding the Redis Cloud Add-on + +To add the Redis Cloud Add-on use the addon.add command. + +~~~ +$ dcapp APP_NAME/DEP_NAME addon.add rediscloud.OPTION +~~~ +Replace `rediscloud.OPTION` with a valid option, e.g. `rediscloud.25mb`. + +When added, Redis Cloud automatically creates a new user account with your email address. You can +manage the Add-on within the [web console](/console) (go to the specific deployment and click the link "rediscloud.OPTION"). + +## Upgrading the Redis Cloud Add-on + +To upgrade from a smaller to a more powerful plan use the addon.upgrade command. + +~~~ +$ dcapp APP_NAME/DEP_NAME addon.upgrade rediscloud.OPTION_OLD rediscloud.OPTION_NEW +~~~ + +## Downgrading the Redis Cloud Add-on + +To downgrade to a smaller plan use the addon.downgrade command. + +~~~ +$ dcapp APP_NAME/DEP_NAME addon.downgrade rediscloud.OPTION_OLD rediscloud.OPTION_NEW +~~~ + +## Removing the Redis Cloud Add-on + +The Redis Cloud Add-on can be removed from the deployment by using the addon.remove command. + +~~~ +$ dcapp APP_NAME/DEP_NAME addon.remove rediscloud.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] in the general documentation. + + +[Redis Cloud]: https://redislabs.com/redis-cloud +[Add-on Credentials]: /dev-center/platform-documentation#add-ons diff --git a/Add-on Documentation/Deployment/SSL.md b/Add-on-Documentation/SSL.md similarity index 81% rename from Add-on Documentation/Deployment/SSL.md rename to Add-on-Documentation/SSL.md index 826406f..2cf63b7 100644 --- a/Add-on Documentation/Deployment/SSL.md +++ b/Add-on-Documentation/SSL.md @@ -1,7 +1,7 @@ # SSL Add-on This add-on provides SSL support for custom domains (e.g. "www.example.com") -that you have added to your application using the [alias addon](https://www.cloudcontrol.com/dev-center/Add-on%20Documentation/Deployment/Alias). +that you have added to your application using the [alias addon](https://next.dotcloud.com/dev-center/add-on-documentation/alias). ## Overview @@ -15,7 +15,7 @@ sections, to add SSL support for custom domains to your deployment: * Set your DNS entry to point to your SSL DNS Domain. Root or naked domains like `example.com` without a subdomain are not -directly supported. For details, please see the [alias addon](https://www.cloudcontrol.com/dev-center/Add-on%20Documentation/Deployment/Alias) documentation. +directly supported. For details, please see the [alias addon](https://next.dotcloud.com/dev-center/add-on-documentation/alias) documentation. ### Acquiring an SSL Certificate @@ -46,18 +46,20 @@ depending on your platform: After you are done with the installation, use the `openssl` command line tool to proceed with generating your private RSA key: - ~~~ - $ openssl genrsa -des3 -out server.key.org 2048 - # Enter and confirm a passphrase - ~~~ + +~~~ +$ openssl genrsa -des3 -out server.key.org 2048 +# Enter and confirm a passphrase +~~~ #### Removing the passphrase The generated key is protected by a passphrase which needs to be removed so that it can be loaded by the web server. - ~~~ - $ openssl rsa -in server.key.org -out server.key - ~~~ + +~~~ +$ openssl rsa -in server.key.org -out server.key +~~~ Your private key used for the process is now saved in the file `server.key` @@ -67,20 +69,21 @@ For acquiring an SSL Certificate, you need to provide your CA with a CSR (Certificate Signing Request). This can also be used for creating self-signed certificates. The CSR contains all the information regarding your company or organization, thus prompting you to enter those: - ~~~ - $ openssl req -new -key server.key -out server.csr - Country Name (2 letter code) [AU]:DE - State or Province Name (full name) [Some-State]: - Locality Name (eg, city) []: - Organization Name (eg, company) [Internet Widgits Pty Ltd]: - Organizational Unit Name (eg, section) []:Information Technology - Common Name (eg, your name or your server's hostname) []:www.example.com - Email Address []: - Please enter the following 'extra' attributes - to be sent with your certificate request - A challenge password []: - An optional company name []: - ~~~ + +~~~ +$ openssl req -new -key server.key -out server.csr +Country Name (2 letter code) [AU]:DE +State or Province Name (full name) [Some-State]: +Locality Name (eg, city) []: +Organization Name (eg, company) [Internet Widgits Pty Ltd]: +Organizational Unit Name (eg, section) []:Information Technology +Common Name (eg, your name or your server's hostname) []:www.example.com +Email Address []: +Please enter the following 'extra' attributes +to be sent with your certificate request +A challenge password []: +An optional company name []: +~~~ The file created after this process is named `server.csr`. @@ -130,14 +133,15 @@ similar to this: ![Firefox warning](https://s3-eu-west-1.amazonaws.com/cctrl-www-production/custom_assets/attachments/000/000/038/original/ffssl.png) You should also have a file which is a bundle of certificates which succeed each other: - ~~~ - -----BEGIN CERTIFICATE----- - ... - -----END CERTIFICATE----- - -----BEGIN CERTIFICATE----- - ... - -----END CERTIFICATE----- - ~~~ + +~~~ +-----BEGIN CERTIFICATE----- +... +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +... +-----END CERTIFICATE----- +~~~ Note: If you do not have a certificate bundle but a series of `.crt` files, you have to place them in the right order starting from the intermediate @@ -148,20 +152,20 @@ 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 - ~~~ + +~~~ +$ dcapp 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 - Addon : ssl.host - Settings - SSL_CERT_EXPIRES : 2016-01-01 10:00:00 - SSL_DNS_DOMAIN : addonssl-depxxxxxxxx-1234567890.eu-west-1.elb.amazonaws.com - SSL_CERT_INCEPTS : 2013-01-01 10:00:00 - ~~~ +~~~ +$ dcapp APP_NAME/DEP_NAME addon ssl.host +Addon : ssl.host + +Settings +SSL_ENDPOINT : deppfdxjnm5.ssl.dotcloudapp.com. +~~~ ### Updating your Certificate @@ -170,10 +174,11 @@ 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 - ~~~ + +~~~ +$ dcapp APP_NAME/DEP_NAME addon.remove ssl.host +$ dcapp 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. @@ -182,7 +187,7 @@ Add-on even if those are not changed. ### Setup your DNS As a final step, create a corresponding CNAME entry and point it to the -SSL_DNS_DOMAIN shown in the configuration for your SSL add-on as seen +SSL_ENDPOINT shown in the configuration for your SSL add-on as seen above. @@ -200,6 +205,7 @@ For PHP you can either redirect via Apache's mod_rewrite using a `.htaccess` file or directly in your PHP code. #### .htaccess + ~~~ RewriteEngine On @@ -209,6 +215,7 @@ file or directly in your PHP code. ~~~ #### PHP + ~~~php Receiving push -----> Installing OpenJDK 1.7(openjdk7.b32.tar.gz)... done @@ -63,22 +63,22 @@ done -----> Building image -----> Uploading image (59M) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@dotcloudapp.com/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 dcapp deploy command: ~~~bash -$ cctrlapp APP_NAME/default deploy +$ dcapp APP_NAME/default deploy ~~~ -Congratulations, you can now see your Clojure application running at `http[s]://APP_NAME.cloudcontrolled.com`. +Congratulations, you can now see your Clojure application running at `http[s]://APP_NAME.dotcloudapp.com`. -[cloudControl]: https://www.cloudcontrol.com/ +[dotCloud]: https://next.dotcloud.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 +[dotCloud-command-line-client]: https://next.dotcloud.com/dev-center/platform-documentation#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 +[Procfile]: https://next.dotcloud.com/dev-center/platform-documentation#buildpacks-and-the-procfile [Leiningen]: http://leiningen.org/ diff --git a/Guides/Java/Gradle - HelloWorld.md b/Guides/Java/Gradle-HelloWorld.md similarity index 70% rename from Guides/Java/Gradle - HelloWorld.md rename to Guides/Java/Gradle-HelloWorld.md index 80e5294..6f8a73a 100644 --- a/Guides/Java/Gradle - HelloWorld.md +++ b/Guides/Java/Gradle-HelloWorld.md @@ -1,6 +1,6 @@ # 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. +In this tutorial we're going to show you how to deploy a Gradle Application on [dotCloud]. 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 @@ -36,7 +36,7 @@ task stage(dependsOn: ['clean', 'installApp']) ~~~ ### Process Type Definition -cloudControl uses a [Procfile] to know how to start your processes. +dotCloud 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: @@ -44,22 +44,22 @@ The example code already includes the `Procfile` at the root of your repository. 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. +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: +Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the dotCloud platform: ~~~bash -$ cctrlapp APP_NAME create java +$ dcapp 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 +$ dcapp APP_NAME/default push [...] -----> Receiving push ------> Installing OpenJDK 1.6... +-----> Installing OpenJDK 1.6... -----> Installing OpenJDK 1.6(openjdk6.b27.tar.gz)... done -----> Installing gradle-1.0-milestone-5..... done -----> Building Gradle app... @@ -79,20 +79,20 @@ $ cctrlapp APP_NAME/default push -----> Building image -----> Uploading image (39M) - To ssh://APP_NAME@cloudcontrolled.com/repository.git + To ssh://APP_NAME@dotcloudapp.com/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 dcapp deploy command: ~~~bash -$ cctrlapp APP_NAME/default deploy +$ dcapp APP_NAME/default deploy ~~~ -Congratulations, you can now see your Gradle application running at `http[s]://APP_NAME.cloudcontrolled.com`. +Congratulations, you can now see your Gradle application running at `http[s]://APP_NAME.dotcloudapp.com`. -[cloudControl]: https://www.cloudcontrol.com/ +[dotCloud]: https://next.dotcloud.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 +[dotCloud-command-line-client]: https://next.dotcloud.com/dev-center/platform-documentation#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 +[Procfile]: https://next.dotcloud.com/dev-center/platform-documentation#buildpacks-and-the-procfile diff --git a/Guides/Java/Grails.md b/Guides/Java/Grails.md index 6c2c6b4..dba8bd1 100644 --- a/Guides/Java/Grails.md +++ b/Guides/Java/Grails.md @@ -1,6 +1,6 @@ # 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. +In this tutorial we're going to show you how to deploy a Grails application on [dotCloud]. 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 @@ -17,18 +17,18 @@ Now you have a small, but fully functional Grails application. 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.servlet.version = "2.5" grails.project.target.level = 1.6 grails.project.source.level = 1.6 grails.project.dependency.resolution = { inherits("global") { } - log "error" + log "error" checksums true legacyResolve false repositories { - inherits true + inherits true grailsPlugins() grailsHome() grailsCentral() @@ -52,7 +52,7 @@ grails.project.dependency.resolution = { ~~~ ### Process Type Definition -cloudControl uses a [Procfile] to know how to start your processes. +dotCloud 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: @@ -63,16 +63,16 @@ 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: +Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the dotCloud platform: ~~~bash -$ cctrlapp APP_NAME create java +$ dcapp 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 +$ dcapp APP_NAME/default push [...] -----> Receiving push -----> Grails 2.2.0 app detected @@ -88,21 +88,21 @@ $ cctrlapp APP_NAME/default push -----> Building image -----> Uploading image (73M) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@dotcloudapp.com/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 dcapp deploy command: ~~~bash -$ cctrlapp APP_NAME/default deploy +$ dcapp APP_NAME/default deploy ~~~ -Congratulations, you can now see your Grails application running at `http[s]://APP_NAME.cloudcontrolled.com`. +Congratulations, you can now see your Grails application running at `http[s]://APP_NAME.dotcloudapp.com`. -[cloudControl]: https://www.cloudcontrol.com/ +[dotCloud]: https://next.dotcloud.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 +[dotCloud-command-line-client]: https://next.dotcloud.com/dev-center/platform-documentation#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 +[Procfile]: https://next.dotcloud.com/dev-center/platform-documentation#buildpacks-and-the-procfile [Ivy]: http://ant.apache.org/ivy/ diff --git a/Guides/Java/Java - HelloWorld.md b/Guides/Java/Java-HelloWorld.md similarity index 81% rename from Guides/Java/Java - HelloWorld.md rename to Guides/Java/Java-HelloWorld.md index 0c2582e..d710979 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 [dotCloud]. 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. ## The Jetty Application Explained @@ -50,7 +50,7 @@ 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. +dotCloud 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: @@ -62,17 +62,17 @@ The `web` process type is required and specifies the command that will be execut The java command starts the 'com.cloudcontrolled.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 dotCloud platform: ~~~bash -$ cctrlapp APP_NAME create java +$ dcapp 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 +$ dcapp APP_NAME/default push -----> Receiving push -----> Installing OpenJDK 1.7(openjdk7.b32.tar.gz)... done @@ -94,22 +94,22 @@ $ cctrlapp APP_NAME/default push -----> Building image -----> Uploading image (39M) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@dotcloudapp.com/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 dcapp deploy command: ~~~bash -$ cctrlapp APP_NAME/default deploy +$ dcapp 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.dotcloudapp.com`. [Jetty]: http://jetty.codehaus.org/jetty/ -[cloudControl]: https://www.cloudcontrol.com/ +[dotCloud]: https://next.dotcloud.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 +[dotCloud-command-line-client]: https://next.dotcloud.com/dev-center/platform-documentation#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]: https://next.dotcloud.com/dev-center/platform-documentation#buildpacks-and-the-procfile diff --git a/Guides/Java/Java - Play 2.md b/Guides/Java/Java-Play-2.md similarity index 81% rename from Guides/Java/Java - Play 2.md rename to Guides/Java/Java-Play-2.md index 26f3e4c..b63806e 100644 --- a/Guides/Java/Java - Play 2.md +++ b/Guides/Java/Java-Play-2.md @@ -1,7 +1,7 @@ # Deploying a Play 2 application In this tutorial we're going to show you how to deploy a [Play 2.3.x] application on -[cloudControl]. You can find the [source code on Github](https://github.com/cloudControl/java-play2-example-app) +[dotCloud]. You can find the [source code on Github](https://github.com/cloudControl/java-play2-example-app) and check out the [Scala buildpack] for supported features. The application comes from the official Play framework templates that can be found at https://github.com/playframework/playframework/tree/2.3.x/templates/play-java-intro, @@ -46,7 +46,7 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-mocha" % "1.0.0") ### Process Type Definition -cloudControl uses a [Procfile] to know how to start your processes. +dotCloud 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: @@ -61,16 +61,16 @@ the required database magritions to happen. ## 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 dotCloud platform: ~~~bash -$ cctrlapp APP_NAME create java +$ dcapp 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 +$ dcapp APP_NAME/default push Counting objects: 5, done. Delta compression using up to 8 threads. Compressing objects: 100% (3/3), done. @@ -90,27 +90,27 @@ done -----> Building image -----> Uploading image (0.1 GB) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@dotcloudapp.com/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 dcapp deploy command: ~~~bash -$ cctrlapp APP_NAME/default deploy +$ dcapp APP_NAME/default deploy ~~~ -Congratulations, you can now see your Play 2 application running at `http[s]://APP_NAME.cloudcontrolled.com`. +Congratulations, you can now see your Play 2 application running at `http[s]://APP_NAME.dotcloudapp.com`. Note: This app uses an in-memory database, which is not persistent. After a redeploy all changes will be lost. If you want a production database you should use one of our available [Data Storage Add-ons]. [Play 2.3.x]: https://www.playframework.com/documentation/2.3.x/Home -[cloudControl]: https://www.cloudcontrol.com/ +[dotCloud]: https://next.dotcloud.com/ [Scala buildpack]: https://github.com/cloudControl/buildpack-scala -[cloudControl-command-line-client]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#command-line-client-web-console-and-api +[dotCloud-command-line-client]: https://next.dotcloud.com/dev-center/platform-documentation#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 +[Procfile]: https://next.dotcloud.com/dev-center/platform-documentation#buildpacks-and-the-procfile [sbt]: http://www.scala-sbt.org/ -[Data Storage Add-ons]: https://www.cloudcontrol.com/add-ons?c=1 +[Data Storage Add-ons]: https://next.dotcloud.com/add-ons?c=1 diff --git a/Guides/Java/Java - Spring-Boot.md b/Guides/Java/Java-Spring-Boot.md similarity index 81% rename from Guides/Java/Java - Spring-Boot.md rename to Guides/Java/Java-Spring-Boot.md index d5be53c..16f37fe 100644 --- a/Guides/Java/Java - Spring-Boot.md +++ b/Guides/Java/Java-Spring-Boot.md @@ -2,7 +2,7 @@ With [Spring Boot] you can create stand-alone, Spring based applications without most of the boilerplate configuration that was needed before. -In this guide we are going to show you how to deploy a Spring/Hibernate/MySQL/Jetty application on [cloudControl]. The example app is a ready to deploy project based on the Spring-Boot [examples]. +In this guide we are going to show you how to deploy a Spring/Hibernate/MySQL/Jetty application on [dotCloud]. The example app is a ready to deploy project based on the Spring-Boot [examples]. ## The Spring-Boot Application Explained @@ -30,7 +30,7 @@ Spring-Boot can be easily configured to start with an embedded [Jetty server]. W ... ~~~ -The server port is provided by the cloudControl platform via environment variable and is configured in `src/main/resources/application.properties`: +The server port is provided by the dotCloud platform via environment variable and is configured in `src/main/resources/application.properties`: ~~~ server.port = ${PORT} @@ -71,7 +71,7 @@ spring.datasource.driverClassName=com.mysql.jdbc.Driver ### Process Type Definition -cloudControl uses the `Procfile` to start the application. The `Procfile` in the project root therefore specifies the command which executes the Spring-Boot app: +dotCloud uses the `Procfile` to start the application. The `Procfile` in the project root therefore specifies the command which executes the Spring-Boot app: ~~~ web: java -jar target/spring-boot-example-app-*.jar @@ -79,16 +79,16 @@ web: java -jar target/spring-boot-example-app-*.jar ## 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 dotCloud platform: ~~~bash -$ cctrlapp APP_NAME create java +$ dcapp APP_NAME create java ~~~ Push your code to the application's repository: ~~~bash -$ cctrlapp APP_NAME/default push +$ dcapp APP_NAME/default push Counting objects: 47, done. Delta compression using up to 8 threads. @@ -118,27 +118,27 @@ Total 47 (delta 15), reused 0 (delta 0) -----> Building image -----> Uploading image (70.0 MB) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@dotcloudapp.com/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 +$ dcapp APP_NAME/default addon.add mysqls.free +$ dcapp 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.dotcloudapp.com` . [Jetty server]: http://www.eclipse.org/jetty/ [Spring Boot]: http://projects.spring.io/spring-boot/ [examples]: https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples -[Database credentials]: Add-on%20credentials -[cloudControl]: / -[MySQLs Add-on]: ../../Add-on%20Documentation/Data%20Storage/MySQLs +[Database credentials]: add-on-credentials +[dotCloud]: / +[MySQLs Add-on]: ../../add-on-documentation/mysqls [hsqlDB]: http://hsqldb.org/ diff --git a/Guides/Java/Java - Spring.md b/Guides/Java/Java-Spring.md similarity index 81% rename from Guides/Java/Java - Spring.md rename to Guides/Java/Java-Spring.md index c1f4e32..51809f0 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 [dotCloud]. 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 dotCloud 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: +dotCloud 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 dotCloud platform: ~~~bash -$ cctrlapp APP_NAME create java +$ dcapp APP_NAME create java ~~~ Push your code to the application's repository: ~~~bash -$ cctrlapp APP_NAME/default push +$ dcapp 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@dotcloudapp.com/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 +$ dcapp APP_NAME/default addon.add mysqls.free +$ dcapp 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.dotcloudapp.com` . [Spring Roo petclinic]: http://static.springsource.org/spring-roo/reference/html/intro.html#intro-exploring-sample -[Database credentials]: Add-on%20credentials +[Database credentials]: add-on-credentials [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 +[dotCloud]: / +[file system]: ../../platform-documentation#non-persistent-filesystem +[log command]: ../../platform-documentation#logging +[Shared MySQL Add-on]: ../../add-on-documentation/mysqls diff --git a/Guides/Java/Java - Tomcat.md b/Guides/Java/Java-Tomcat.md similarity index 87% rename from Guides/Java/Java - Tomcat.md rename to Guides/Java/Java-Tomcat.md index 0bd920a..2878cbd 100644 --- a/Guides/Java/Java - Tomcat.md +++ b/Guides/Java/Java-Tomcat.md @@ -5,7 +5,7 @@ you definitely have heard of [Tomcat]. Tomcat offers an implementation of the Java Servlet and JavaServer Pages (JSP) technologies. In this tutorial we're going to show you how to deploy a JSP application running on embedded Tomcat on -[cloudControl]. You can find the [source code on Github](https://github.com/cloudControl/java-tomcat-example-app) +[dotCloud]. You can find the [source code on Github](https://github.com/cloudControl/java-tomcat-example-app) and check out the [Java buildpack] for supported features. @@ -93,14 +93,14 @@ the `pom.xml`: ### Java Version We are using the latest version of Apache Tomcat 8 which requires Java 7+ in -order to run. The default Java version on cloudControl is 7 but you can +order to run. The default Java version on dotCloud is 7 but you can explicitly define it in the `system.properties` file like this: ~~~ java.runtime.version=1.7 ~~~ ### Process Type Definition -cloudControl uses a [Procfile] to know how to start your processes. +dotCloud 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: @@ -114,14 +114,14 @@ commands to start your servlet using the built classes. ## 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 dotCloud platform: ~~~bash -$ cctrlapp APP_NAME create java +$ dcapp 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 +$ dcapp APP_NAME/default push Counting objects: 2, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. @@ -152,22 +152,22 @@ Total 2 (delta 1), reused 0 (delta 0) -----> Building image -----> Uploading image (50.2 MB) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@dotcloudapp.com/repository.git db605ac...6a884f1 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 dcapp deploy command: ~~~bash -$ cctrlapp APP_NAME/default deploy +$ dcapp APP_NAME/default deploy ~~~ -Congratulations, you can now see your JSP Application running on Tomcat at `http[s]://APP_NAME.cloudcontrolled.com`. +Congratulations, you can now see your JSP Application running on Tomcat at `http[s]://APP_NAME.dotcloudapp.com`. [Tomcat]: https://tomcat.apache.org/ -[cloudControl]: https://www.cloudcontrol.com/ +[dotCloud]: https://next.dotcloud.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 +[dotCloud-command-line-client]: https://next.dotcloud.com/dev-center/platform-documentation#command-line-client-web-console-and-api [Git client]: http://git-scm.com/ [Application Assembler Maven Plugin]: http://mojo.codehaus.org/appassembler/appassembler-maven-plugin/ -[Procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#buildpacks-and-the-procfile +[Procfile]: https://next.dotcloud.com/dev-center/platform-documentation#buildpacks-and-the-procfile diff --git a/Guides/Java/Play - HelloWorld.md b/Guides/Java/Play-HelloWorld.md similarity index 71% rename from Guides/Java/Play - HelloWorld.md rename to Guides/Java/Play-HelloWorld.md index 31f97ee..f45290a 100644 --- a/Guides/Java/Play - HelloWorld.md +++ b/Guides/Java/Play-HelloWorld.md @@ -1,6 +1,6 @@ # 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. +In this tutorial we're going to show you how to deploy a Play! application on [dotCloud]. 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 [Play 2 Tutorial]. @@ -24,7 +24,7 @@ require: ~~~ ### Process Type Definition -cloudControl uses a [Procfile] to know how to start your processes. +dotCloud 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: @@ -35,16 +35,16 @@ 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: +Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the dotCloud platform: ~~~bash -$ cctrlapp APP_NAME create java +$ dcapp 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 +$ dcapp APP_NAME/default push [...] -----> Receiving push -----> Installing OpenJDK 1.6... @@ -66,22 +66,22 @@ $ cctrlapp APP_NAME/default push -----> Building image -----> Uploading image (65M) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@dotcloudapp.com/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 dcapp deploy command: ~~~bash -$ cctrlapp APP_NAME/default deploy +$ dcapp APP_NAME/default deploy ~~~ -Congratulations, you can now see your Play! application running at `http[s]://APP_NAME.cloudcontrolled.com`. +Congratulations, you can now see your Play! application running at `http[s]://APP_NAME.dotcloudapp.com`. -[cloudControl]: https://www.cloudcontrol.com/ +[dotCloud]: https://next.dotcloud.com/ [Play buildpack]: https://github.com/cloudControl/buildpack-play -[Play 2 tutorial]: https://www.cloudcontrol.com/dev-center/Guides/Java/Java%20-%20Play%202 -[cloudControl-command-line-client]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#command-line-client-web-console-and-api +[Play 2 tutorial]: https://next.dotcloud.com/dev-center/guides/java/java-play-2 +[dotCloud-command-line-client]: https://next.dotcloud.com/dev-center/platform-documentation#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 +[Procfile]: https://next.dotcloud.com/dev-center/platform-documentation#buildpacks-and-the-procfile [Ivy]: http://ant.apache.org/ivy/ diff --git a/Guides/Java/Scala - HelloWorld.md b/Guides/Java/Scala-HelloWorld.md similarity index 74% rename from Guides/Java/Scala - HelloWorld.md rename to Guides/Java/Scala-HelloWorld.md index 31ab403..c1792c5 100644 --- a/Guides/Java/Scala - HelloWorld.md +++ b/Guides/Java/Scala-HelloWorld.md @@ -1,6 +1,6 @@ # 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. +In this tutorial we're going to show you how to deploy a Scala application on [dotCloud]. 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 @@ -45,7 +45,7 @@ resolvers += "Sonatype OSS Snapshots" at "http://oss.sonatype.org/content/reposi%20~~~%20%20###%20Process%20Type%20Definition-cloudControl%20uses%20a%20[Procfile]%20to%20know%20how%20to%20start%20your%20processes.+dotCloud%20uses%20a%20[Procfile]%20to%20know%20how%20to%20start%20your%20processes.%20%20The%20example%20code%20already%20includes%20the%20%60Procfile%60%20at%20the%20top%20level%20of%20your%20repository.%20It%20looks%20like%20this:%20@@%20-56,16%20+56,16%20@@%20web:%20target/start%20The%20%60web%60%20process%20type%20is%20required%20and%20specifies%20the%20command%20that%20will%20be%20executed%20when%20the%20app%20is%20deployed.%20%20##%20Pushing%20and%20Deploying%20your%20App-Choose%20a%20unique%20name%20to%20replace%20the%20%60APP_NAME%60%20placeholder%20for%20your%20application%20and%20create%20it%20on%20the%20cloudControl%20platform:%20+Choose%20a%20unique%20name%20to%20replace%20the%20%60APP_NAME%60%20placeholder%20for%20your%20application%20and%20create%20it%20on%20the%20dotCloud%20platform:%20%20%20~~~bash-$%20cctrlapp%20APP_NAME%20create%20java+$%20dcapp%20APP_NAME%20create%20java%20~~~%20%20Push%20your%20code%20to%20the%20application's repository, which triggers the deployment image build process: ~~~bash -$ cctrlapp APP_NAME/default push +$ dcapp APP_NAME/default push [...] -----> Receiving push @@ -76,22 +76,22 @@ $ cctrlapp APP_NAME/default push -----> Building image -----> Uploading image (80M) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@dotcloudapp.com/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 dcapp deploy command: ~~~bash -$ cctrlapp APP_NAME/default deploy +$ dcapp APP_NAME/default deploy ~~~ -Congratulations, you can now see your Scala application running at `http[s]://APP_NAME.cloudcontrolled.com`. +Congratulations, you can now see your Scala application running at `http[s]://APP_NAME.dotcloudapp.com`. -[cloudControl]: https://www.cloudcontrol.com/ +[dotCloud]: https://next.dotcloud.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 +[dotCloud-command-line-client]: https://next.dotcloud.com/dev-center/platform-documentation#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 +[Procfile]: https://next.dotcloud.com/dev-center/platform-documentation#buildpacks-and-the-procfile [sbt]: http://www.scala-sbt.org/ diff --git a/Guides/NodeJS/AWS S3.md b/Guides/NodeJS/AWS-S3.md similarity index 95% rename from Guides/NodeJS/AWS S3.md rename to Guides/NodeJS/AWS-S3.md index e913fe8..f3efe86 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 +dcapp 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]: https://next.dotcloud.com/dev-center/add-on-documentation/config diff --git a/Guides/NodeJS/Add-on credentials.md b/Guides/NodeJS/Add-on-credentials.md similarity index 80% rename from Guides/NodeJS/Add-on credentials.md rename to Guides/NodeJS/Add-on-credentials.md index 8818889..b0e0073 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 +$ dcapp 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 +$ dcapp 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,7 +44,7 @@ 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. +dotCloud 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. ##MySQL To add a MySQL database, use the [MySQL Dedicated Add-on] or [MySQL Shared Add-on]. @@ -90,9 +90,9 @@ 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]: https://next.dotcloud.com/add-ons +[environment variables]: https://next.dotcloud.com/dev-center/platform-documentation#environment-variables +[MySQL Dedicated Add-on]: https://next.dotcloud.com/add-ons/mysqld +[MySQL Shared Add-on]: https://next.dotcloud.com/add-ons/mysqls +[Add-on credentials]:https://next.dotcloud.com/dev-center/platform-documentation#add-on-credentials +[ElephantSQL Add-on]: https://next.dotcloud.com/add-ons/elephantsql diff --git a/Guides/NodeJS/Express.md b/Guides/NodeJS/Express.md index 1cb13cc..a2ebec4 100644 --- a/Guides/NodeJS/Express.md +++ b/Guides/NodeJS/Express.md @@ -1,6 +1,6 @@ # Deploying an Express Application -This example demonstrates how to build a simple Express app on [cloudControl]. The +This example demonstrates how to build a simple Express app on [dotCloud]. The app uses [Express], which is a [Node.js] web framework, and MongoDB as the backend database. @@ -41,7 +41,7 @@ in the root of your repository. The one you cloned as part of the example app lo ### Process Type Definition -A [Procfile] is required to start processes on the cloudControl platform. There +A [Procfile] is required to start processes on the dotCloud 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: @@ -55,11 +55,11 @@ Left of the colon, we specified the **required** process type called `web` follo 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 +retrieval of the objects very simple. MongoDB is provided by [MongoSoup] +which can be found in dotCloud's Add-on Marketplace under the category [Data Storage]. -This example uses the MongoLab Add-on. In the +This example uses the MongoSoup Add-on. In the `employeeprovider.js` file, you can find how the connection to the database is established: @@ -78,7 +78,7 @@ var Db = require('mongodb').Db, EmployeeProvider = function() { var that = this; - mongodbUri = process.env.MONGOLAB_URI || 'mongodb://localhost'; + mongodbUri = process.env.MONGOSOUP_URL || 'mongodb://localhost'; MongoClient.connect(mongodbUri, function(err, db){ if(err) { return console.dir(err); } that.db = db; @@ -93,17 +93,17 @@ 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: +and create it on the dotCloud platform: ~~~bash -$ cctrlapp APP_NAME create nodejs +$ dcapp 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 +$ dcapp APP_NAME/default push Counting objects: 73, done. Delta compression using up to 8 threads. Compressing objects: 100% (35/35), done. @@ -130,20 +130,20 @@ 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@dotcloudapp.com/repository.git * [new branch] master -> master ~~~ -Finally, don’t forget to add the MongoLab Add-on for cloudControl and deploy the +Finally, don’t forget to add the MongoSoup Add-on for dotCloud and deploy the latest version of the app: ~~~bash -$ cctrlapp APP_NAME/default addon.add mongolab.free -$ cctrlapp APP_NAME/default deploy +$ dcapp APP_NAME/default addon.add mongosoup.sandbox +$ dcapp APP_NAME/default deploy ~~~ Congratulations, you can now see your Express app running with MongoDB at -`http[s]://APP_NAME.cloudcontrolled.com`. +`http[s]://APP_NAME.dotcloudapp.com`. ## Next Steps @@ -155,11 +155,10 @@ applications. [Node.js]: http://nodejs.org/ [Express]: http://expressjs.com/ [npm]: https://npmjs.org/ -[cloudControl]: http://www.cloudcontrol.com +[dotCloud]: http://next.dotcloud.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 +[get-conf]: https://next.dotcloud.com/dev-center/guides/nodejs/add-on-credentials +[Procfile]: https://next.dotcloud.com/dev-center/platform-documentation#buildpacks-and-the-procfile +[platform documentation]: https://next.dotcloud.com/dev-center/platform-documentation +[Data Storage]: https://next.dotcloud.com/add-ons?c=1 +[MongoSoup]: https://next.dotcloud.com/add-ons/mongosoup diff --git a/Guides/NodeJS/HelloWorld.md b/Guides/NodeJS/HelloWorld.md index ad724bf..b5ada65 100644 --- a/Guides/NodeJS/HelloWorld.md +++ b/Guides/NodeJS/HelloWorld.md @@ -5,7 +5,7 @@ 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 +application on [dotCloud]. Check out the [Node.js buildpack] for supported features. ## The Node.js App Explained @@ -47,7 +47,7 @@ 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. +A [Procfile] is required to start processes on the dotCloud 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: @@ -60,17 +60,17 @@ followed by the command that starts the app. ## 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 dotCloud platform: ~~~bash -$ cctrlapp APP_NAME create nodejs +$ dcapp APP_NAME create nodejs ~~~ Push your code to the application's repository, which triggers the deployment image build process: ~~~bash -$ cctrlapp APP_NAME push +$ dcapp APP_NAME push Counting objects: 344, done. Delta compression using up to 8 threads. Compressing objects: 100% (294/294), done. @@ -115,28 +115,28 @@ Total 344 (delta 24), reused 337 (delta 20) -----> Uploading image (5.9 MB) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@dotcloudapp.com/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 dcapp deploy command: ~~~bash -$ cctrlapp APP_NAME deploy +$ dcapp APP_NAME deploy ~~~ Congratulations, you can now see your Node.js app running at -`http[s]://APP_NAME.cloudcontrolled.com`. +`http[s]://APP_NAME.dotcloudapp.com`. ## 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. +Good luck building your apps using Node.js and dotCloud. -[example on how to use Node.js with MongoDB]: https://www.cloudcontrol.com/dev-center/Guides/NodeJS/Express +[example on how to use Node.js with MongoDB]: https://next.dotcloud.com/dev-center/guides/nodejs/express [Node.js]: http://nodejs.org/ [npm]: https://npmjs.org/ -[cloudControl]: http://www.cloudcontrol.com +[dotCloud]: http://next.dotcloud.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]: https://next.dotcloud.com/dev-center/platform-documentation#buildpacks-and-the-procfile +[platform documentation]: https://next.dotcloud.com/dev-center/platform-documentation diff --git a/Guides/NodeJS/Sailsjs.md b/Guides/NodeJS/Sailsjs.md index 2065dd9..4d56590 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 [dotCloud]. 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. @@ -19,7 +19,7 @@ Now you have a small, but fully functional Sails.js application. ### Dependency Tracking -Dependencies are tracked using [npm] and specified in a `package.json`-file in your project's root directory. +Dependencies are tracked using [npm] and specified in a `package.json`-file in your project's root directory. The one you cloned as part of the example app looks like this: ~~~json @@ -48,9 +48,9 @@ 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. +dotCloud 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: +To start the sails server, you need to use the `sails lift` command. This command is included in the procfile definition as shown below: ~~~ web: export NODE_ENV=production; sails lift @@ -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 dotCloud [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 [dotCloud 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 dotCloud platform: ~~~bash -$ cctrlapp APP_NAME create nodejs +$ dcapp 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 +$ dcapp 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@dotcloudapp.com/repository.git * [new branch] master -> master ~~~ Add the [Shared MySQL Add-on]: ~~~bash -$ cctrlapp APP_NAME/default addon.add mysqls.free +$ dcapp APP_NAME/default addon.add mysqls.free ~~~ Finally, deploy the Sails.js application: ~~~bash -$ cctrlapp APP_NAME/default deploy +$ dcapp APP_NAME/default deploy ~~~ Congratulations, you can now see your Sails.js application running at -`http://APP_NAME.cloudcontrolapp.com`. +`http://APP_NAME.dotcloudapp.com`. [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 +[dotCloud]: http://next.dotcloud.com +[Procfile]: https://next.dotcloud.com/dev-center/platform-documentation#buildpacks-and-the-procfile +[get the MySQL credentials]: https://next.dotcloud.com/dev-center/guides/nodejs/add-on-credentials [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 +[dotCloud websockets documentation]: https://next.dotcloud.com/dev-center/platform-documentation#websockets +[Shared MySQL Add-on]: https://next.dotcloud.com/dev-center/add-on-documentation/mysqls diff --git a/Guides/PHP/Add-on credentials.md b/Guides/PHP/Add-on-credentials.md similarity index 82% rename from Guides/PHP/Add-on credentials.md rename to Guides/PHP/Add-on-credentials.md index 1d521b9..95eeef7 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 +$ dcapp APP_NAME/DEPLOYMENT_NAME addon.creds ~~~ You can use the following code wherever you want to get the credentials in your @@ -35,7 +35,7 @@ $var3_name = $creds['ADDON_NAME']['ADDON_NAME_PARAMETER3']; # Examples -cloudControl offers a number of data storage solutions via the [Add-on Marketplace]. +dotCloud 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. ## MySQL @@ -80,9 +80,9 @@ $db_config = array( ); ~~~ -[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]: https://next.dotcloud.com/dev-center/platform-documentation#environment-variables +[Add-on credentials]: https://next.dotcloud.com/dev-center/platform-documentation#add-on-credentials +[Add-on Marketplace]: https://next.dotcloud.com/add-ons/ +[MySQL Dedicated Add-on]: https://next.dotcloud.com/add-ons/mysqld +[MySQL Shared Add-on]: https://next.dotcloud.com/add-ons/mysqls +[ElephantSQL Add-on]: https://next.dotcloud.com/add-ons/elephantsql diff --git a/Guides/PHP/CakePHP 2.2.1.md b/Guides/PHP/CakePHP.md similarity index 82% rename from Guides/PHP/CakePHP 2.2.1.md rename to Guides/PHP/CakePHP.md index c237f33..d2ded4c 100644 --- a/Guides/PHP/CakePHP 2.2.1.md +++ b/Guides/PHP/CakePHP.md @@ -1,6 +1,6 @@ #Deploying CakePHP 2.2.1 -![Successful Deployment](images/cake-homepage.png) +![Successful Deployment](https://raw.githubusercontent.com/cloudControl/documentation/master/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 dotCloud platform](http://next.dotcloud.com). ##Prerequisites @@ -19,103 +19,103 @@ 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 CakePHP +##1. Grab a Copy of CakePHP -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. +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](https://raw.githubusercontent.com/cloudControl/documentation/master/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 dotCloud 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 dotCloud. -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, CakePHP is written in a very straight-forward and configurable manner, so this is easy to do. What's more, the community around it is very healthy, so there's loads of options and support available. +Thankfully, CakePHP is written in a very straight-forward and configurable manner, so this is easy 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. 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. +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 dotCloud, 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 ``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. +I am using the application name ``dotcloudcakephp`` 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 dotCloud platform. To do this we checkout the master branch, create the application in our dotCloud 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 - + dcapp dotcloudcakephp create php + // deploy the default branch - cctrlapp cloudcontrolledcakephp/default push - cctrlapp cloudcontrolledcakephp/default deploy - + dcapp dotcloudcakephp/default push + dcapp dotcloudcakephp/default deploy + // deploy the testing branch - cctrlapp cloudcontrolledcakephp/testing push - cctrlapp cloudcontrolledcakephp/testing deploy + dcapp dotcloudcakephp/testing push + dcapp dotcloudcakephp/testing deploy ##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 to determine the active environment and mysqls is used 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 to determine the active environment and mysqls is used 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 cloudcontrolledcakephp/default addon.add mysql.free - + dcapp dotcloudcakephp/default addon.add mysql.free + // Retrieve the settings - cctrlapp cloudcontrolledcakephp/default addon mysql.free + dcapp dotcloudcakephp/default addon mysql.free // Initialise the mysqls.free addon for the testing deployment - cctrlapp cloudcontrolledcakephp/testing addon.add mysql.free - + dcapp dotcloudcakephp/testing addon.add mysql.free + // Retrieve the settings - cctrlapp cloudcontrolledcakephp/testing addon mysql.free + dcapp dotcloudcakephp/testing addon mysql.free The output of the commands will be similar to that below: Addon : mysqls.free - + Settings MYSQLS_DATABASE : MYSQLS_PASSWORD : @@ -128,12 +128,12 @@ 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 + dcapp dotcloudcakephp/default config.add CAKE_ENV=production - // Set the testing environment setting - cctrlapp cloudcontrolledcakephp/testing config.add CAKE_ENV=testing + // Set the testing environment setting + dcapp dotcloudcakephp/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. +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 @@ -141,21 +141,21 @@ So firstly, we're going to extend the bootstrap process to be able to determine ###5.1 Lib/BaseConfig.php -We then create a new class, **BASE_CONFIG**, that the database config, will later inherit from, and indicate that we have 4 environments: **default, development, testing** and **production**. - +We then create a new class, **BASE_CONFIG**, that the database config, will later inherit from, and indicate that we have 4 environments: **default, development, testing** and **production**. + class BASE_CONFIG { - + var $environments = array('default', 'development', 'testing', 'production'); 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 dotCloud 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. getEnvironmentName(); if ($environment && isset($this->{$environment})) { - + if ($environment !== 'development') { // read the credentials file $string = file_get_contents($_ENV['CRED_FILE'], false); @@ -207,9 +207,9 @@ When we configured the add ons earlier (*mysqls* and *config*) the settings were 'encoding' => 'utf8', ); } else { - $this->default = array_merge($this->default, $this->{$environment}); + $this->default = array_merge($this->default, $this->{$environment}); } - + if ($environment == 'testing') { Configure::write('debug', 2); } @@ -221,21 +221,21 @@ When we configured the add ons earlier (*mysqls* and *config*) the settings were Now, we need to configure the development environment database settings, using the settings. So open up ``app/Config/database.php`` and change the class to extend from our newly created **BASE_CONFIG** class. Then add in the database settings for your local development environment database. With these files in place, we have configurations for development and the running configurations. -An example is provided below: +An example is provided below: 'Database/Mysql', 'persistent' => false, 'host' => 'localhost', 'login' => 'cc_dev', 'password' => 'cc _dev', - 'database' => 'cloudcontrol_cakephp', + 'database' => 'dotcloud_cakephp', 'prefix' => '', 'encoding' => 'utf8', ); @@ -244,7 +244,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 dotCloud 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: @@ -254,34 +254,34 @@ Go down in the file until you find a line similar to below: Then replace it with the configuration below Cache::config('default', array( - 'engine' => 'APC', - 'duration'=> 3600, - 'probability'=> 100, - 'prefix' => Inflector::slug(APP_DIR) . '_', + 'engine' => 'APC', + 'duration'=> 3600, + 'probability'=> 100, + 'prefix' => Inflector::slug(APP_DIR) . '_', )); - + After that, head on down further until you find a line similar to below: - CakeLog::config('default', + CakeLog::config('default', array( - 'engine' => 'File', + 'engine' => 'File', Change it so that it instead looks like the code below: - + /** * Configures default file logging options */ App::uses('CakeLog', 'Log'); - CakeLog::config('default', + CakeLog::config('default', array( - 'engine' => 'DatabaseLogger', + 'engine' => 'DatabaseLogger', 'model' => 'LogEntry' )); -This will tell it to use a class called DatabaseLogger and form the basis of telling it to store log information in the database. Now, clone a copy of the DatabaseLogger library by running the following commands: +This will tell it to use a class called DatabaseLogger and form the basis of telling it to store log information in the database. Now, clone a copy of the DatabaseLogger library by running the following commands: cd app/Plugin; - + git clone https://github.com/webtechnick/CakePHP-DatabaseLogger-Plugin database_logger Now you'll have a copy of the files, ready to go. @@ -298,27 +298,27 @@ To get the session information to be stored in the database, open up app/Config/ 'cache' => 'APC' ) )); - + // Make sure to add a APC cache config Cache::config('APC', array('Engine' => 'APC')); -What this does is to have a two-level cache. The information is stored in both APC and the database. This allows us to retrieve the information from APC, which is far faster than MySQL, but has less available space. If the information's not there, then we search for it in MySQL. +What this does is to have a two-level cache. The information is stored in both APC and the database. This allows us to retrieve the information from APC, which is far faster than MySQL, but has less available space. If the information's not there, then we search for it in MySQL. ###5.4 Model/Datasource/Session/ComboSession.php -Next, create the file ``ComboSession.php`` in ``Model/Datasource/Session``. And set it up as below. +Next, create the file ``ComboSession.php`` in ``Model/Datasource/Session``. And set it up as below. cacheKey = Configure::read('Session.handler.cache'); parent::__construct(); } - + // read data from the session. public function read($id) { $result = Cache::read($id, $this->cacheKey); @@ -327,7 +327,7 @@ Next, create the file ``ComboSession.php`` in ``Model/Datasource/Session``. And } return parent::read($id); } - + // write data into the session. public function write($id, $data) { $result = Cache::write($id, $data, $this->cacheKey); @@ -336,7 +336,7 @@ Next, create the file ``ComboSession.php`` in ``Model/Datasource/Session``. And } return false; } - + // destroy a session. public function destroy($id) { $result = Cache::delete($id, $this->cacheKey); @@ -345,18 +345,18 @@ Next, create the file ``ComboSession.php`` in ``Model/Datasource/Session``. And } return false; } - + // removes expired sessions. public function gc($expires = null) { return Cache::gc($this->cacheKey) && parent::gc($expires); } } -What this does is to extend the DatabaseSession class so that we can use both APC and MySQL to store session information. With these file amendments in place, we're just about ready to go. So in your Git client, stage the files ready to be committed. +What this does is to extend the DatabaseSession class so that we can use both APC and MySQL to store session information. With these file amendments in place, we're just about ready to go. So in your Git client, stage the files ready to be committed. ##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_dotcloud_init.sql``, ready to be used to initialise the database next. CREATE TABLE `cake_sessions` ( `id` varchar(255) NOT NULL DEFAULT '', @@ -364,7 +364,7 @@ Ok, next we need to create a basic database schema for storing both the session `expires` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; - + CREATE TABLE `log_entries` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `type` varchar(45) DEFAULT NULL, @@ -380,7 +380,7 @@ Ok, next we need to create a basic database schema for storing both the session KEY `time` (`time`), KEY `datetime` (`datetime`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; - + CREATE TABLE `logs` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `type` varchar(20) NOT NULL, @@ -393,17 +393,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 < cakephp_cloudcontrol_init.sql + --ssl-ca=mysql-ssl-ca-cert.pem < cakephp_dotcloud_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: @@ -411,34 +411,34 @@ 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 - + dcapp dotcloudcakephp/default push + dcapp dotcloudcakephp/default deploy + git checkout testing git merge master - + // deploy the testing branch - cctrlapp cloudcontrolledcakephp/testing push - cctrlapp cloudcontrolledcakephp/testing deploy + dcapp dotcloudcakephp/testing push + dcapp dotcloudcakephp/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/cake-deployed-successfully.png) +![Successful Deployment](https://raw.githubusercontent.com/cloudControl/documentation/master/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) +![Misconfigured Database](https://raw.githubusercontent.com/cloudControl/documentation/master/images/misconfigured-database.png) -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 cloudControl Github repository. If you have any issues, feel free to email [support@dotcloud.com](mailto:support@dotcloud.com). ##Links - + * [http://www.dereuromark.de/2010/08/17/development-vs-productive-setup/](http://www.dereuromark.de/2010/08/17/development-vs-productive-setup/) * [http://book.cakephp.org/2.0/en/development/sessions.html](http://book.cakephp.org/2.0/en/development/sessions.html) * [http://php.refulz.com/cakephp-error-the-requested-address-was-not-found-on-this-server/](http://php.refulz.com/cakephp-error-the-requested-address-was-not-found-on-this-server/) diff --git a/Guides/PHP/Drupal 7.md b/Guides/PHP/Drupal-7.md similarity index 81% rename from Guides/PHP/Drupal 7.md rename to Guides/PHP/Drupal-7.md index 62f28d7..6d34c87 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](https://raw.githubusercontent.com/cloudControl/documentation/master/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 dotCloud platform](http://next.dotcloud.com). ##Prerequisites @@ -18,13 +18,13 @@ 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 Drupal 7. +##1. Grab a Copy of Drupal 7. -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. +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](https://raw.githubusercontent.com/cloudControl/documentation/master/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). +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). ##2. Amend the Code @@ -34,7 +34,7 @@ A few changes need to be made to the default Drupal 7 configuration. These chang As is quite common in modern application development, we deploy to multiple environments, such as testing, staging and production. And each of these environments will, likely, have different configuration settings for the *database*, *caching* etc, so we need to be able to differentiate between them. Drupal does not automatically do this out of the box, but it's not that hard to adjust it to make it happen. -And luckily for us, Drupal 7, by default, stores most of its logging and session information automatically in the database. So we don't need to make many configuration changes there to make sure that it works. +And luckily for us, Drupal 7, by default, stores most of its logging and session information automatically in the database. So we don't need to make many configuration changes there to make sure that it works. What is not being covered in this tutorial is connecting the installation to a writeable filesystem, such as [Amazon S3](http://aws.amazon.com/s3/). That will be done in a follow up to this tutorial. @@ -43,63 +43,63 @@ What is not being covered in this tutorial is connecting the installation to a w 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 ``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: +I am using the application name ``dotclouddrupal`` 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 dotCloud platform. To do this we checkout the master branch, create the application in our dotCloud 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 - + dcapp dotclouddrupal create php + // deploy the default branch - cctrlapp cloudcontroldldrupal/default push - cctrlapp cloudcontroldldrupal/default deploy - + dcapp dotclouddrupal/default push + dcapp dotclouddrupal/default deploy + // deploy the testing branch - cctrlapp cloudcontroldldrupal/testing push - cctrlapp cloudcontroldldrupal/testing deploy + dcapp dotclouddrupal/testing push + dcapp dotclouddrupal/testing deploy ##4. Initialise the Required Addons -Now that that's done, we need to configure two add-ons, config and mysqls. The config add-on is required to determine 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 to determine 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 cloudcontroldldrupal/default addon.add mysql.free + dcapp dotclouddrupal/default addon.add mysql.free // Retrieve the settings - cctrlapp cloudcontroldldrupal/default addon mysql.free + dcapp dotclouddrupal/default addon mysql.free // Initialise the mysqls.free addon for the testing deployment - cctrlapp cloudcontroldldrupal/testing addon.add mysql.free + dcapp dotclouddrupal/testing addon.add mysql.free // Retrieve the settings - cctrlapp cloudcontroldldrupal/testing addon mysql.free + dcapp dotclouddrupal/testing addon mysql.free The output of the commands will be similar to that below: @@ -117,52 +117,52 @@ 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 + dcapp dotclouddrupal/default config.add APPLICATION_ENV=production // Set the testing environment setting - cctrlapp cloudcontroldldrupal/testing config.add APPLICATION_ENV=testing + dcapp dotclouddrupal/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. ##5. Environment Configuration -Now we're going to extend the Drupal 7 bootstrap process to be able to determine which environment is being used, which we talked about earlier. To do that, open up ``sites/default/settings.php`` and add in the code below right at the end of the file. +Now we're going to extend the Drupal 7 bootstrap process to be able to determine which environment is being used, which we talked about earlier. To do that, open up ``sites/default/settings.php`` and add in the code below right at the end of the file. Have a look at it and we'll go through it together. $env = 'production'; - + if (!empty($_SERVER['HTTP_HOST']) && strpos($_SERVER['HTTP_HOST'], 'localdomain') !== FALSE) { - $env = 'development'; + $env = '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: $env = $creds['CONFIG']['CONFIG_VARS']['APPLICATION_ENV']; } - - - $local_settings = __DIR__ . "/settings.{$env}.inc"; + + + $local_settings = __DIR__ . "/settings.{$env}.inc"; include($local_settings); 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 dotCloud 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,. ##6. Configuring the Database -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 automatically. +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 automatically. It’s really handy as we don’t need to do too much to make use of the options. @@ -172,23 +172,23 @@ Under **sites/default** create three new files: * ``settings.testing.inc`` * ``settings.production.inc`` -In there, past the respective database settings for your different environments that you can retrieve from the database add-on configuration or your local development environment. +In there, past the respective database settings for your different environments that you can retrieve from the database add-on configuration or your local development environment. -Two examples are provided below: +Two examples are provided below: ###6.1 Production array ( 'default' => array ( @@ -206,16 +206,16 @@ Two examples are provided below: ###6.2 Testing array ( 'default' => array ( @@ -232,22 +232,22 @@ 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](drupal_dotcloud_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_dotcloud_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. @@ -270,7 +270,7 @@ Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. | watchdog | +-----------------------------+ 74 rows in set (0.06 sec) - + mysql> ##7. Commit the Code Changes @@ -281,23 +281,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 cloudcontroldlDrupal 7/default push - cctrlapp cloudcontroldlDrupal 7/default deploy - + dcapp dotclouddrupal/default push + dcapp dotclouddrupal/default deploy + git checkout testing git merge master - + // deploy the testing branch - cctrlapp cloudcontroldlDrupal 7/testing push - cctrlapp cloudcontroldlDrupal 7/testing deploy + dcapp dotclouddrupal/testing push + dcapp dotclouddrupal/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. +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). +![Successful Deployment](https://raw.githubusercontent.com/cloudControl/documentation/master/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@dotcloud.com](mailto:support@dotcloud.com). diff --git a/Guides/PHP/HelloWorld.md b/Guides/PHP/HelloWorld.md index 3e1c4cc..952b973 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 dotCloud [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 +[dotCloud]. You can find the [source code on Github][example-app] and check out the [php buildpack] for supported features. @@ -42,7 +42,7 @@ you should run the `composer.phar update` command to update the `composer.lock`. This file must be in your repository and ensures that all the developers always use the same versions of all the libraries. It also makes the changes visible in git. Also note that your `.gitignore` should contain -`vendor` as proposed in the +`vendor` as proposed in the [Composer documentation](http://getcomposer.org/doc/01-basic-usage.md#installing-dependencies), since you don't need all that code in your repository. @@ -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 dotCloud platform: ~~~bash -$ cctrlapp APP_NAME create php +$ dcapp APP_NAME create php ~~~ Push your code to the application's repository, which triggers the deployment image build process: ~~~ -$ cctrlapp APP_NAME/default push +$ dcapp 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@dotcloudapp.com/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 dcapp deploy command: ~~~bash -$ cctrlapp APP_NAME/default deploy +$ dcapp 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.dotcloudapp.com`. [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" +[dotCloud]: http://next.dotcloud.com +[dotCloud-doc-user]: https://next.dotcloud.com/dev-center/platform-documentation#user-accounts +[dotCloud-doc-cmdline]: https://next.dotcloud.com/dev-center/platform-documentation#command-line-client-web-console-and-api "documentation of the dotCloud-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]: https://next.dotcloud.com/dev-center/platform-documentation#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.md similarity index 82% rename from Guides/PHP/Joomla 2.5.md rename to Guides/PHP/Joomla.md index 0bd7a5c..0503c22 100644 --- a/Guides/PHP/Joomla 2.5.md +++ b/Guides/PHP/Joomla.md @@ -1,6 +1,6 @@ -#Deploying Joomla 2.5 to cloudControl +#Deploying Joomla 2.5 to dotCloud -![Successful Deployment](images/joomla-logo.png) +![Successful Deployment](https://raw.githubusercontent.com/cloudControl/documentation/master/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 dotCloud platform](http://next.dotcloud.com). ##Prerequisites @@ -19,20 +19,20 @@ 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 Joomla +##1. Grab a Copy of Joomla -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. +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](https://raw.githubusercontent.com/cloudControl/documentation/master/images/joomla-source.png) ##Create a Basic Application -Once you have a copy of the Joomla source available locally, setup a VHost (or equivalent) in your web server of choice and install a copy of it, accepting the default options and inserting your details as appropriate. If you're not that familiar with Joomla, the first time that you view it as a site it will run the installer. +Once you have a copy of the Joomla source available locally, setup a VHost (or equivalent) in your web server of choice and install a copy of it, accepting the default options and inserting your details as appropriate. If you're not that familiar with Joomla, the first time that you view it as a site it will run the installer. ##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 dotCloud deployment. These changes are as follows: * Store sessions in the database * Store Cache Information in APC @@ -44,7 +44,7 @@ Unless something goes awry, you won't have to do anything here as Joomla should * Under **Session Settings**: * ensure **Session Handler** is set to **Database** - + Click Save. ###2.2 Store Cache Information in APC @@ -55,13 +55,13 @@ By default, caching in Joomla is turned off. So from "Global Configuration" -> " * set **Cache** to **On** * set **Cache Handler** to **Alternative PHP Cache** -Click **Save & Close**. +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 dotCloud 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. +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. We do this by updating ``libraries/joomla/registry/format/php.php``. Have a look at the modified version of the file below: @@ -85,10 +85,10 @@ We do this by updating ``libraries/joomla/registry/format/php.php``. Have a look $vars .= "\tpublic $" . $k . " = " . $this->getArrayString((array) $v) . ";\n"; } } - + $str = "password = $creds["MYSQLS"]["MYSQLS_PASSWORD"]; } }' . "\n"; - + $str .= "}"; - + // Use the closing tag if it not set to false in parameters. if (!isset($params['closingtag']) || $params['closingtag'] !== false) { $str .= "\n?>"; } - + return $str; } - + ##3. Put the Code Under Git Control @@ -132,63 +132,63 @@ We do this by updating ``libraries/joomla/registry/format/php.php``. Have a look 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 ``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: +I am using the application name ``dotcloudjoomla`` 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 dotCloud platform. To do this we checkout the master branch, create the application in our dotCloud 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 + dcapp dotcloudjoomla create php // deploy the default branch - cctrlapp cloudcontroldljoomla/default push - cctrlapp cloudcontroldljoomla/default deploy + dcapp dotcloudjoomla/default push + dcapp dotcloudjoomla/default deploy // deploy the testing branch - cctrlapp cloudcontroldljoomla/testing push - cctrlapp cloudcontroldljoomla/testing deploy + dcapp dotcloudjoomla/testing push + dcapp dotcloudjoomla/testing deploy ##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's 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's 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 cloudcontroldljoomla/default addon.add mysql.free + dcapp dotcloudjoomla/default addon.add mysql.free // Retrieve the settings - cctrlapp cloudcontroldljoomla/default addon mysql.free + dcapp dotcloudjoomla/default addon mysql.free // Initialise the mysqls.free addon for the testing deployment - cctrlapp cloudcontroldljoomla/testing addon.add mysql.free + dcapp dotcloudjoomla/testing addon.add mysql.free // Retrieve the settings - cctrlapp cloudcontroldljoomla/testing addon mysql.free + dcapp dotcloudjoomla/testing addon mysql.free The output of the commands will be similar to that below: @@ -206,12 +206,12 @@ 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 + dcapp dotcloudjoomla/default config.add APPLICATION_ENV=production // Set the testing environment settings - cctrlapp cloudcontroldljoomla/testing config.add APPLICATION_ENV=testing + dcapp dotcloudjoomla/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. A Note About Logging & Temp Directories @@ -222,43 +222,43 @@ 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_dotcloud_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_dotcloud_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. 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: // commit the changes 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 - + dcapp dotcloudjoomla/default push + dcapp dotcloudjoomla/default deploy + git checkout testing git merge master - + // deploy the testing branch - cctrlapp cloudcontroldljoomla/testing push - cctrlapp cloudcontroldljoomla/testing deploy + dcapp dotcloudjoomla/testing push + dcapp dotcloudjoomla/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/joomla-running.png) +![Successful Deployment](https://raw.githubusercontent.com/cloudControl/documentation/master/images/joomla-running.png) ###7.1 Deployment Problems @@ -268,18 +268,18 @@ To view the information, run the following commands respectively: ####7.1.1 Deployment - cctrlapp cloudcontroldljoomla/default log deploy + dcapp dotcloudjoomla/default log deploy ####7.1.1 Errors - cctrlapp cloudcontroldljoomla/default log error + dcapp dotcloudjoomla/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. ###7.2 Deployment Considerations As was mentioned earlier, this isn't the most perfect solution as when you upgrade Joomla, the changes made to php.php will be overwritten and JLog still writes to the filesystem. We are working on a more permanent solution to this situation. ##Links - + * [Joomla](http://www.joomla.org/) diff --git a/Guides/PHP/Kohana 3.2.0.md b/Guides/PHP/Kohana.md similarity index 85% rename from Guides/PHP/Kohana 3.2.0.md rename to Guides/PHP/Kohana.md index b3ae78c..ffe9b01 100644 --- a/Guides/PHP/Kohana 3.2.0.md +++ b/Guides/PHP/Kohana.md @@ -1,6 +1,6 @@ #Deploying Kohana 3.2.0 -![Successful Deployment](images/kohana-homepage.png) +![Successful Deployment](https://raw.githubusercontent.com/cloudControl/documentation/master/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 dotCloud platform](http://next.dotcloud.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](https://raw.githubusercontent.com/cloudControl/documentation/master/images/kohana-files.png) ##2. Amend the Code @@ -36,72 +36,72 @@ 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 dotCloud 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 dotCloud, 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: +I am using the application name ``dotcloudkohana`` 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 dotCloud platform. To do this we checkout the master branch, create the application in our dotCloud 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 - + dcapp dotcloudkohana create php + // deploy the default branch - cctrlapp cloudcontroldlkohana/default push - cctrlapp cloudcontroldlkohana/default deploy - + dcapp dotcloudkohana/default push + dcapp dotcloudkohana/default deploy + // deploy the testing branch - cctrlapp cloudcontroldlkohana/testing push - cctrlapp cloudcontroldlkohana/testing deploy - + dcapp dotcloudkohana/testing push + dcapp dotcloudkohana/testing deploy + ###3.1 Kohana Auto-Detected When you do this, you'll see output similar to the following: - - $ cctrlapp cloudcontroldlkohana/default push + + $ dcapp dotcloudkohana/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 +109,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://dotcloudkohana@dotcloudapp.com/repository.git f98a87c..a685cd6 master -> master Note the following lines: @@ -118,53 +118,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 + dcapp dotcloudkohana/default addon.add mysqls.free // Initialise the mysqls.free addon for the testing deployment - cctrlapp cloudcontroldlkohana/testing addon.add mysqls.free + dcapp dotcloudkohana/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 + dcapp dotcloudkohana/default config.add APPLICATION_ENV=production // Add the APPLICATION_ENV variable to testing - cctrlapp cloudcontroldlkohana/testing config.add APPLICATION_ENV=testing + dcapp dotcloudkohana/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 + dcapp dotcloudkohana/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 +173,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 dotCloud 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 +243,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 +309,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' => 'dotcloud_kohana', ), 'table_prefix' => '', 'charset' => 'utf8', @@ -326,7 +325,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 +347,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](https://raw.githubusercontent.com/cloudControl/documentation/master/images/kohana application-config dir.png) ##6. Database Schema @@ -365,20 +364,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,18 +389,18 @@ 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``. @@ -409,20 +408,20 @@ Now, in the shell, we're going to load the schema in to the remote mysql instanc 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_dotcloud_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 +429,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 + dcapp dotcloudkohana/default push + dcapp dotcloudkohana/default deploy // push the code to the testing branch - cctrlapp cloudcontroldlkohana/testing push - cctrlapp cloudcontroldlkohana/testing deploy - + dcapp dotcloudkohana/testing push + dcapp dotcloudkohana/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 +519,11 @@ Now create a file called ``site.php`` under ``application/views/``. In it, add t -

Welcome to Kohana on cloudControl

+

Welcome to Kohana on dotCloud

@@ -535,18 +534,18 @@ 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) - +![Successful Deployment](https://raw.githubusercontent.com/cloudControl/documentation/master/images/kohana-success-output.png) + ##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 dotCloud. If you have any issues, feel free to email [support@dotcloud.com](mailto:support@dotcloud.com). diff --git a/Guides/PHP/Symfony 1.4.md b/Guides/PHP/Symfony.md similarity index 80% rename from Guides/PHP/Symfony 1.4.md rename to Guides/PHP/Symfony.md index b5f6419..f3c13c9 100644 --- a/Guides/PHP/Symfony 1.4.md +++ b/Guides/PHP/Symfony.md @@ -1,6 +1,6 @@ -#Deploying Symfony 1.4 to cloudControl +#Deploying Symfony 1.4 to dotCloud -![Successful Deployment](images/symfony1.4-homepage.png) +![Successful Deployment](https://raw.githubusercontent.com/cloudControl/documentation/master/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 dotCloud platform](http://next.dotcloud.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](https://raw.githubusercontent.com/cloudControl/documentation/master/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 dotCloud 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,63 @@ 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: +I am using the application name ``dotcloudsymfony`` 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 dotCloud platform. To do this we checkout the master branch, create the application in our dotCloud 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 - + dcapp dotcloudsymfony create php + // deploy the default branch - cctrlapp cloudcontroldlsymfony/default push - cctrlapp cloudcontroldlsymfony/default deploy - + dcapp dotcloudsymfony/default push + dcapp dotcloudsymfony/default deploy + // deploy the testing branch - cctrlapp cloudcontroldlsymfony/testing push - cctrlapp cloudcontroldlsymfony/testing deploy + dcapp dotcloudsymfony/testing push + dcapp dotcloudsymfony/testing deploy ###3.1 Symfony Auto-Detected When you do this, you'll see output similar to the following: - $ cctrlapp cloudcontroldlsymfony/default push + $ dcapp dotcloudsymfony/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://dotcloudsymfony@dotcloudapp.com/repository.git d90506c..4078c78 master -> master Note the following lines: @@ -117,37 +117,35 @@ 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 dotCloud 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 - + dcapp dotcloudsymfony/default addon.add mysql.free + // Retrieve the settings - cctrlapp cloudcontroldlsymfony/default addon mysql.free + dcapp dotcloudsymfony/default addon mysql.free // Initialise the mysqls.free addon for the testing deployment - cctrlapp cloudcontroldlsymfony/testing addon.add mysql.free - + dcapp dotcloudsymfony/testing addon.add mysql.free + // Retrieve the settings - cctrlapp cloudcontroldlsymfony/testing addon mysql.free + dcapp dotcloudsymfony/testing addon mysql.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 + dcapp dotcloudsymfony/default config.add APPLICATION_ENV=production - // Set the testing environment setting - cctrlapp cloudcontroldlsymfony/testing config.add APPLICATION_ENV=testing + // Set the testing environment setting + dcapp dotcloudsymfony/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_dotcloud + session_cookie_path: / + session_cookie_domain: dotcloudsymfony.dotcloudapp.com 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 dotCloud 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=dotcloud_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,25 @@ 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 - + dcapp dotcloudsymfony/default push + dcapp dotcloudsymfony/default deploy + git checkout testing git merge master - + // deploy the testing branch - cctrlapp cloudcontroldlsymfony/testing push - cctrlapp cloudcontroldlsymfony/testing deploy + dcapp dotcloudsymfony/testing push + dcapp dotcloudsymfony/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/symfony1.png) +![Successful Deployment](https://raw.githubusercontent.com/cloudControl/documentation/master/images/symfony1.png) -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@dotcloud.com](mailto:support@dotcloud.com). ##Links diff --git a/Guides/PHP/Yii 1.1.10.md b/Guides/PHP/Yii.md similarity index 83% rename from Guides/PHP/Yii 1.1.10.md rename to Guides/PHP/Yii.md index 4aae5f4..d637c6c 100644 --- a/Guides/PHP/Yii 1.1.10.md +++ b/Guides/PHP/Yii.md @@ -1,6 +1,6 @@ -#Deploying Yii 1.1.10 to cloudControl +#Deploying Yii 1.1.10 to dotCloud -![Successful Deployment](images/yii-framework-logo.png) +![Successful Deployment](https://raw.githubusercontent.com/cloudControl/documentation/master/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 * Lots 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 dotCloud platform](http://next.dotcloud.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](https://raw.githubusercontent.com/cloudControl/documentation/master/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 dotCloud. ##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 dotCloud 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 dotCloud, 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: +I am using the application name ``dotcloudyii`` 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 dotCloud platform. To do this we checkout the master branch, create the application in our dotCloud 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 + dcapp dotcloudyii create php // deploy the default branch - cctrlapp cloudcontroldlyii/default push - cctrlapp cloudcontroldlyii/default deploy --stack luigi + dcapp dotcloudyii/default push + dcapp dotcloudyii/default deploy // deploy the testing branch - cctrlapp cloudcontroldlyii/testing push - cctrlapp cloudcontroldlyii/testing deploy --stack luigi - + dcapp dotcloudyii/testing push + dcapp dotcloudyii/testing deploy You should see output as below: - $ cctrlapp cloudcontroldlyii/default push + $ dcapp dotcloudyii/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://dotcloudyii@dotcloudapp.com/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 + dcapp dotcloudyii/default addon.add mysqls.free // Retrieve the settings - cctrlapp cloudcontroldlyii/default addon mysqls.free + dcapp dotcloudyii/default addon mysqls.free // Initialise the mysqls.free addon for the testing deployment - cctrlapp cloudcontroldlyii/testing addon.add mysqls.free + dcapp dotcloudyii/testing addon.add mysqls.free // Retrieve the settings - cctrlapp cloudcontroldlyii/testing addon mysqls.free + dcapp dotcloudyii/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 + dcapp dotcloudyii/default config.add APPLICATION_ENV=main // Set the testing environment setting - cctrlapp cloudcontroldlyii/testing config.add APPLICATION_ENV=testing + dcapp dotcloudyii/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_dotcloud_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_dotcloud_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 - + dcapp dotcloudyii/default push + dcapp dotcloudyii/default deploy + git checkout testing git merge master - + // deploy the testing branch - cctrlapp cloudcontroldlyii/testing push - cctrlapp cloudcontroldlyii/testing deploy --stack luigi + dcapp dotcloudyii/testing push + dcapp dotcloudyii/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](https://raw.githubusercontent.com/cloudControl/documentation/master/images/yii-framework-running.png) ###7.1 Deployment Problems @@ -340,22 +339,21 @@ To view the information, run the following commands respectively: ####7.1.1 Deployment - cctrlapp cloudcontroldlyii/default log deploy + dcapp dotcloudyii/default log deploy ####7.1.1 Errors - cctrlapp cloudcontroldlyii/default log error + dcapp dotcloudyii/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 dotCloud Github repository. If you have any issues, feel free to email [support@dotcloud.com](mailto:support@dotcloud.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 Framework 1.11.md b/Guides/PHP/Zend-1.md similarity index 83% rename from Guides/PHP/Zend Framework 1.11.md rename to Guides/PHP/Zend-1.md index dafec51..dc5dec0 100644 --- a/Guides/PHP/Zend Framework 1.11.md +++ b/Guides/PHP/Zend-1.md @@ -1,6 +1,6 @@ -#Deploying Zend Framework 1.11 to cloudControl +#Deploying Zend Framework 1.11 to dotCloud -![Successful Deployment](images/ZendFramework-logo.png) +![Successful Deployment](https://raw.githubusercontent.com/cloudControl/documentation/master/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 dotCloud platform](http://next.dotcloud.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](https://raw.githubusercontent.com/cloudControl/documentation/master/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 dotCloud 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,91 @@ 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 dotCloud, we need to do this in a slightly different way. It involves, for each environment, setting an environment variable with the dcapp 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: +I am using the application name ``dotcloudzf`` 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 dotCloud platform. To do this we checkout the master branch, create the application in our dotCloud 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 - + dcapp dotcloudzf create php + // deploy the default branch - cctrlapp cloudcontroldlzf/default push - cctrlapp cloudcontroldlzf/default deploy --stack luigi - + dcapp dotcloudzf/default push + dcapp dotcloudzf/default deploy + // deploy the testing branch - cctrlapp cloudcontroldlzf/testing push - cctrlapp cloudcontroldlzf/testing deploy --stack luigi + dcapp dotcloudzf/testing push + dcapp dotcloudzf/testing deploy You'll see output similar to the following: - $ cctrlapp cloudcontroldlzf/testing push + $ dcapp dotcloudzf/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 + + To ssh://dotcloudzf@dotcloudapp.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. ##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 - + dcapp dotcloudzf/default addon.add mysqls.free + // Retrieve the settings - cctrlapp cloudcontroldlzf/default addon mysqls.free + dcapp dotcloudzf/default addon mysqls.free // Initialise the mysqls.free addon for the testing deployment - cctrlapp cloudcontroldlzf/testing addon.add mysqls.free - + dcapp dotcloudzf/testing addon.add mysqls.free + // Retrieve the settings - cctrlapp cloudcontroldlzf/testing addon mysqls.free + dcapp dotcloudzf/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 +152,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 + dcapp dotcloudzf/default config.add APPLICATION_ENV=production // Set the testing environment setting - cctrlapp cloudcontroldlzf/testing config.add APPLICATION_ENV=testing + dcapp dotcloudzf/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 +195,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 +206,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 dotCloud 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 +243,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 +254,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 +265,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 +302,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 +315,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 +340,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 +350,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 +366,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 +397,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_dotcloud_init.sql``, ready to be used to initialise the database next. -- table structure CREATE TABLE `session` ( @@ -415,20 +415,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 +436,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_dotcloud_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 +454,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 - + dcapp dotcloudzf/default push + dcapp dotcloudzf/default deploy + git checkout testing git merge master - + // deploy the testing branch - cctrlapp cloudcontroldlzf/testing push - cctrlapp cloudcontroldlzf/testing deploy --stack luigi + dcapp dotcloudzf/testing push + dcapp dotcloudzf/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](https://raw.githubusercontent.com/cloudControl/documentation/master/images/zf-deployed.png) ###7.1 Deployment Problems @@ -480,15 +480,15 @@ To view the information, run the following commands respectively: ####7.1.1 Deployment - cctrlapp cloudcontroldlzf/default log deploy + dcapp dotcloudzf/default log deploy ####7.1.1 Errors - cctrlapp cloudcontroldlzf/default log error + dcapp dotcloudzf/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/Zend 2.md b/Guides/PHP/Zend-2.md similarity index 86% rename from Guides/PHP/Zend 2.md rename to Guides/PHP/Zend-2.md index 1eb72c8..64023cd 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 [dotCloud]. 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 dotCloud 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 dotCloud. Additionally the filesystem on dotCloud 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 dotCloud platform: ~~~bash -$ cctrlapp APP_NAME create php +$ dcapp 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 +$ dcapp 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@dotcloudapp.com/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 dcapp deploy command: ~~~bash -$ cctrlapp APP_NAME/default deploy +$ dcapp 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://next.dotcloud.com/dev-center/add-on-documentation/mysqls). 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 +$ dcapp APP_NAME/default addon.add mysqls.free # initialize the session table -$ cctrlapp APP_NAME/default run "php code/public/index.php init-session-table" +$ dcapp 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.dotcloudapp.com 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.dotcloudapp.com`. [PHP buildpack]: https://github.com/cloudControl/buildpack-php -[cloudControl]: https://www.cloudcontrol.com/ +[dotCloud]: https://next.dotcloud.com/ [example app]: https://github.com/cloudControl/php-zend2-example-app.git diff --git a/Guides/Python/AWS S3.md b/Guides/Python/AWS-S3.md similarity index 90% rename from Guides/Python/AWS S3.md rename to Guides/Python/AWS-S3.md index d56846b..ad87e90 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](https://next.dotcloud.com/dev-center/add-on-documentation/config): ~~~bash -$ cctrlapp APP_NAME/default config.add AWS_SECRET_KEY=[YOUR_SECRET_KEY] AWS_ACCESS_KEY=[YOUR_ACCESS_KEY] +$ dcapp 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 similarity index 79% rename from Guides/Python/Add-on credentials.md rename to Guides/Python/Add-on-credentials.md index 3d0e0c8..aa75150 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 +$ dcapp 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 +$ dcapp APP_NAME/DEP_NAME config.add SET_ENV_VARS ~~~ You can look up the individual environment variable names in the respective @@ -55,7 +55,7 @@ available in your deployment containers. # Examples -cloudControl offers a number of data storage solutions via the [Add-on Marketplace]. +dotCloud 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. @@ -74,9 +74,9 @@ creds = json.load(cred_file) db_config = { 'database': creds['MYSQLD']['MYSQLD_DATABASE'], - 'host': creds['MYSQLD']['MYSQLD_HOST'], + 'host': creds['MYSQLD']['MYSQLD_HOSTNAME'], 'port': creds['MYSQLD']['MYSQLD_PORT'], - 'username': creds['MYSQLD']['MYSQLD_USER'], + 'username': creds['MYSQLD']['MYSQLD_USERNAME'], 'password': creds['MYSQLD']['MYSQLD_PASSWORD'] } ~~~ @@ -108,10 +108,10 @@ db_config = { } ~~~ -[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]: https://next.dotcloud.com/dev-center/platform-documentation#environment-variables +[Add-on credentials]: https://next.dotcloud.com/dev-center/platform-documentation#add-on-credentials +[Add-on Marketplace]: https://next.dotcloud.com/add-ons/ +[Custom Config Add-on]: https://next.dotcloud.com/add-ons/config +[MySQL Dedicated Add-on]: https://next.dotcloud.com/add-ons/mysqld +[MySQL Shared Add-on]: https://next.dotcloud.com/add-ons/mysqls +[ElephantSQL Add-on]: https://next.dotcloud.com/add-ons/elephantsql diff --git a/Guides/Python/Celery.md b/Guides/Python/Celery.md index 687de82..1200358 100644 --- a/Guides/Python/Celery.md +++ b/Guides/Python/Celery.md @@ -1,7 +1,7 @@ -# Deploying Celery on cloudControl +# Deploying Celery on dotCloud [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]. +In this tutorial we're going to show you how to deploy an example Celery app using the [CloudAMQP Add-on] and a [Worker] on [dotCloud]. ## 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. @@ -22,7 +22,7 @@ flower==0.4.2 ~~~ ### Process Type Definition -cloudControl uses a [Procfile] to know how to start the app's processes. +dotCloud 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: @@ -55,22 +55,16 @@ def add(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: +Choose a unique name to replace the `APP_NAME` placeholder for your application and create it on the dotCloud platform: ~~~bash -$ cctrlapp APP_NAME create python +$ dcapp 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 +$ dcapp APP_NAME/default addon.add cloudamqp.lemur ~~~ 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. @@ -78,7 +72,7 @@ Since we are reading the AMQP URL for the broker from the environment in both, t 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 +$ dcapp APP_NAME/default addon.add config.free --SET_ENV_VARS --FLOWER_AUTH_EMAIL=YOUR_EMAIL_HERE # seperate multiple emails by comma ~~~ @@ -90,13 +84,13 @@ Now lets push your code to the application's repository, which triggers the depl 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 +$ dcapp 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 @@ -107,39 +101,39 @@ Total 6 (delta 0), reused 0 (delta 0) 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 + +To ssh://APP_NAME@dotcloudapp.com/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 dcapp deploy command. ~~~bash -$ cctrlapp APP_NAME/default deploy +$ dcapp 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. +At this point you can see web interface at `http://APP_NAME.dotcloudapp.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. +Scaling Celery workers on dotCloud 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 +$ dcapp APP_NAME/default worker.add worker # you can always list running workers like this -$ cctrlapp APP_NAME/default worker +$ dcapp APP_NAME/default worker # and also check the worker's log output with -$ cctrlapp APP_NAME/default log worker +$ dcapp APP_NAME/default log worker [TIMESTAMP] WRK_ID Started worker (command: 'celery -A tasks worker --loglevel=info ', parameter: '') -[TIMESTAMP] WRK_ID +[TIMESTAMP] WRK_ID [TIMESTAMP] WRK_ID -------------- celery@HOSTNAME v3.0.15 (Chiastic Slide) [TIMESTAMP] WRK_ID ---- **** ----- [TIMESTAMP] WRK_ID --- * *** * -- [Configuration] @@ -151,7 +145,7 @@ $ cctrlapp APP_NAME/default log worker [TIMESTAMP] WRK_ID - *** --- * --- [Queues] [TIMESTAMP] WRK_ID -- ******* ---- . celery: exchange:celery(direct) binding:celery [TIMESTAMP] WRK_ID --- ***** ----- -[TIMESTAMP] WRK_ID +[TIMESTAMP] WRK_ID [TIMESTAMP] WRK_ID [Tasks] [TIMESTAMP] WRK_ID . tasks.add [TIMESTAMP] WRK_ID [TIMESTAMP: WARNING/MainProcess] celery@HOSTNAME ready. @@ -159,13 +153,13 @@ $ cctrlapp APP_NAME/default log worker [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. +If you refresh the web interface at `http://APP_NAME.dotcloudapp.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 +$ dcapp APP_NAME/default worker.add worker ~~~ ### Removing Workers @@ -174,14 +168,14 @@ 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 +$ dcapp APP_NAME/default worker +$ dcapp 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 +$ dcapp APP_NAME/default log worker [...] [TIMESTAMP] WRK_ID [TIMESTAMP: WARNING/MainProcess] Got shutdown from remote [TIMESTAMP] WRK_ID Container stopped @@ -191,29 +185,28 @@ $ cctrlapp APP_NAME/default log worker ## 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. +To run Celery commands use the dcapp 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 +$ dcapp 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. +Connection to sshforwarder.dotcloudapp.com 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. +This guide showed how to run both Flower aswell as a Celery worker on dotCloud 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 dcapp 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 +[CloudAMQP Add-on]: https://next.dotcloud.com/add-ons/cloudamqp +[Worker]: https://next.dotcloud.com/dev-center/platform-documentation#workers +[dotCloud]: http://next.dotcloud.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 - +[Procfile]: https://next.dotcloud.com/dev-center/platform-documentation#buildpacks-and-the-procfile diff --git a/Guides/Python/Django notes.md b/Guides/Python/Django-notes.md similarity index 50% rename from Guides/Python/Django notes.md rename to Guides/Python/Django-notes.md index eb7df02..20831a3 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 [dotCloud]. ## 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. +dotCloud 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,7 +16,7 @@ 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" +dcapp APP_NAME/DEP_NAME run "python manage.py syncdb" ~~~ ## Databases @@ -25,12 +25,12 @@ To use a database, you should choose an Add-on from [the Data Storage category][ ## 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]: https://next.dotcloud.com/dev-center/platform-documentation#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]: https://next.dotcloud.com/dev-center/platform-documentation#buildpacks-and-the-procfile +[messaging-addons]: https://next.dotcloud.com/dev-center/add-on-documentation#messaging-mobile +[data-storage-addons]: https://next.dotcloud.com/dev-center/add-on-documentation#data-storage +[add-on-credentials]: https://next.dotcloud.com/dev-center/guides/python/add-on-credentials +[dotCloud]: https://next.dotcloud.com/ +[worker]: https://next.dotcloud.com/dev-center/platform-documentation#scheduled-jobs-and-background-workers diff --git a/Guides/Python/Django.md b/Guides/Python/Django.md index bfef983..1862ae4 100644 --- a/Guides/Python/Django.md +++ b/Guides/Python/Django.md @@ -1,7 +1,7 @@ # 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 +[dotCloud]. 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. @@ -48,7 +48,7 @@ INSTALLED_APPS = ( ### Process Type Definition -cloudControl uses a [Procfile] to know how to start your processes. The example +dotCloud 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: @@ -64,7 +64,7 @@ by the environment variable `$PORT`. 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 +database on dotCloud 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]. @@ -109,22 +109,22 @@ 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: +application and create it on the dotCloud platform: ~~~bash -$ cctrlapp APP_NAME create python +$ dcapp APP_NAME create python ~~~ Push your code to the application's repository, which triggers the deployment image build process: ~~~bash -$ cctrlapp APP_NAME push +$ dcapp APP_NAME push Counting objects: 49, done. Delta compression using up to 8 threads. Compressing objects: 100% (33/33), done. Writing objects: 100% (49/49), 8.80 KiB | 0 bytes/s, done. Total 49 (delta 11), reused 38 (delta 8) - + -----> Receiving push -----> No runtime.txt provided; assuming python-2.7.3. -----> Preparing Python runtime (python-2.7.3) @@ -137,47 +137,47 @@ Total 49 (delta 11), reused 38 (delta 8) -----> Building image -----> Uploading image (29.9 MB) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@dotcloudapp.com/repository.git * [new branch] master -> master ~~~ Add MySQLs Add-on with `free` plan to your deployment and deploy it: ~~~bash -$ cctrlapp APP_NAME addon.add mysqls.free -$ cctrlapp APP_NAME deploy +$ dcapp APP_NAME addon.add mysqls.free +$ dcapp APP_NAME deploy ~~~ Finally, prepare the database using the [Run command][ssh-session] (when prompted create admin user): ~~~bash -$ cctrlapp APP_NAME run "python manage.py syncdb" +$ dcapp APP_NAME 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.dotcloudapp.com/admin`, +create some polls and see them at `APP_NAME.dotcloudapp.com/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 +[dotCloud]: http://next.dotcloud.com +[dotCloud-doc-user]: https://next.dotcloud.com/dev-center/platform-documentation#user-accounts +[dotCloud-doc-cmdline]: https://next.dotcloud.com/dev-center/platform-documentation#command-line-client-web-console-and-api +[Procfile]: https://next.dotcloud.com/dev-center/platform-documentation#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]: https://next.dotcloud.com/dev-center/platform-documentation#non-persistent-filesystem +[data-storage-addons]: https://next.dotcloud.com/dev-center/add-on-documentation#data-storage +[mysqls]: https://next.dotcloud.com/dev-center/add-on-documentation/mysqls [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]: https://next.dotcloud.com/dev-center/guides/python/django-notes +[get-conf]: https://next.dotcloud.com/dev-center/guides/python/add-on-credentials [Django tutorial]: https://docs.djangoproject.com/en/1.4/intro/tutorial01/ -[python-guides]: https://www.cloudcontrol.com/dev-center/Guides/Python +[python-guides]: https://next.dotcloud.com/dev-center/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]: https://next.dotcloud.com/dev-center/platform-documentation#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]: https://next.dotcloud.com/dev-center/platform-documentation#secure-shell-ssh [mysql-driver]: https://pypi.python.org/pypi/MySQL-python/1.2.5 diff --git a/Guides/Python/HelloWorld.md b/Guides/Python/HelloWorld.md index 14b598f..6754ada 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 [dotCloud]. 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. +dotCloud 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 dotCloud platform: ~~~bash -$ cctrlapp APP_NAME create python +$ dcapp 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 +$ dcapp 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@dotcloudapp.com/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 dcapp deploy command: ~~~bash -$ cctrlapp APP_NAME/default deploy +$ dcapp 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.dotcloudapp.com`. [Flask]: http://flask.pocoo.org/ -[cloudControl]: http://www.cloudcontrol.com +[dotCloud]: http://next.dotcloud.com [Python buildpack]: https://github.com/cloudControl/buildpack-python -[Procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#buildpacks-and-the-procfile +[Procfile]: https://next.dotcloud.com/dev-center/platform-documentation#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..659e986 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 [dotCloud]. ## 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. +dotCloud 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 dotCloud platform: ~~~bash -$ cctrlapp APP_NAME create python +$ dcapp 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 +$ dcapp 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@dotcloudapp.com/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 dcapp deploy command. ~~~bash -$ cctrlapp APP_NAME/default deploy +$ dcapp 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.dotcloudapp.com`. [Tornado]: http://www.tornadoweb.org -[cloudControl]: http://www.cloudcontrol.com +[dotCloud]: http://next.dotcloud.com [Python buildpack]: https://github.com/cloudControl/buildpack-python -[Procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#buildpacks-and-the-procfile +[Procfile]: https://next.dotcloud.com/dev-center/platform-documentation#buildpacks-and-the-procfile diff --git a/Guides/Ruby/AWS S3.md b/Guides/Ruby/AWS-S3.md similarity index 87% rename from Guides/Ruby/AWS S3.md rename to Guides/Ruby/AWS-S3.md index 32ba7f2..b815bb2 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://next.dotcloud.com/dev-center/add-on-documentation/config): ~~~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' +$ dcapp 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 similarity index 80% rename from Guides/Ruby/Add-on credentials.md rename to Guides/Ruby/Add-on-credentials.md index e68746d..de5701b 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 +$ dcapp 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 +$ dcapp APP_NAME/DEP_NAME addon.creds ~~~ You can use the following code wherever you want to get the credentials in your @@ -57,7 +57,7 @@ end # Examples -cloudControl offers a number of data storage solutions via the [Add-on Marketplace]. +dotCloud 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. ## MySQL @@ -69,9 +69,9 @@ Here's a Ruby snippet that reads the database settings and stores them in the ~~~ruby db_config = { database: ENV["MYSQLD_DATABASE"], - host: ENV["MYSQLD_HOST"], + host: ENV["MYSQLD_HOSTNAME"], port: ENV["MYSQLD_PORT"], - username: ENV["MYSQLD_USER"], + username: ENV["MYSQLD_USERNAME"], password: ENV["MYSQLD_PASSWORD"] } ~~~ @@ -99,10 +99,10 @@ db_config = { 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 +[Add-on credentials]: https://next.dotcloud.com/dev-center/platform-documentation#add-on-credentials +[environment variables]: https://next.dotcloud.com/dev-center/platform-documentation#environment-variables +[Add-on Marketplace]: https://next.dotcloud.com/add-ons/?c=1 +[MySQL Dedicated Add-on]: https://next.dotcloud.com/add-ons/mysqld +[MySQL Shared Add-on]: https://next.dotcloud.com/add-ons/mysqls +[ElephantSQL Add-on]: https://next.dotcloud.com/add-ons/elephantsql [ruby-postgresql-example]: https://github.com/ElephantSQL/ruby-postgresql-example diff --git a/Guides/Ruby/HelloWorld.md b/Guides/Ruby/HelloWorld.md index 507bbb7..2167628 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. +[dotCloud]. 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. +dotCloud 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 dotCloud platform: ~~~bash -$ cctrlapp APP_NAME create ruby +$ dcapp 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 +$ dcapp 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@dotcloudapp.com/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 dcapp deploy command: ~~~bash -$ cctrlapp APP_NAME/default deploy +$ dcapp 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.dotcloudapp.com`. [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 +[dotCloud]: http://next.dotcloud.com +[dotCloud-doc-user]: https://next.dotcloud.com/dev-center/platform-documentation#user-accounts +[dotCloud-doc-cmdline]: https://next.dotcloud.com/dev-center/platform-documentation#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]: https://next.dotcloud.com/dev-center/platform-documentation#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 similarity index 72% rename from Guides/Ruby/Ruby on Rails.md rename to Guides/Ruby/Ruby-on-Rails.md index 9ea6d9a..afca87b 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 [dotCloud]. 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 @@ -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 dotCloud. ### 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: +dotCloud 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,7 +98,7 @@ 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 dotCloud because the filesystem is [not persistent][filesystem]. To use a database, you should choose an Add-on from [Data Storage category][data-storage-addons]. 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. @@ -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 dotCloud platform: ~~~bash -$ cctrlapp APP_NAME create ruby +$ dcapp 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 +$ dcapp APP_NAME/default push Counting objects: 62, done. Delta compression using up to 4 threads. Compressing objects: 100% (51/51), done. @@ -162,39 +162,37 @@ Total 62 (delta 2), reused 0 (delta 0) -----> Building image -----> Uploading image (34M) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@dotcloudapp.com/repository.git * [new branch] master -> master ~~~ Add ElephantSQL Add-on with `turtle` plan to your deployment and deploy it: ~~~bash -$ cctrlapp APP_NAME/default addon.add elephantsql.turtle -$ cctrlapp APP_NAME/default deploy +$ dcapp APP_NAME/default addon.add elephantsql.turtle +$ dcapp APP_NAME/default deploy ~~~ Finally, prepare the database by running migrations using the [Run command][run command]: ~~~bash -$ cctrlapp APP_NAME/default run "rake db:migrate" +$ dcapp APP_NAME/default 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://APP_NAME.dotcloudapp.com. -For additional information take a look at [Ruby on Rails notes][rails-notes] and -other [ruby-specific documents][ruby-guides]. +For additional information take a look at [Ruby notes][rubynotes]. [Ruby on Rails]: http://rubyonrails.org/ -[cloudControl]: http://www.cloudcontrol.com +[dotCloud]: http://next.dotcloud.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]: https://next.dotcloud.com/dev-center/platform-documentation#buildpacks-and-the-procfile +[filesystem]: https://next.dotcloud.com/dev-center/platform-documentation#non-persistent-filesystem +[data-storage-addons]: https://next.dotcloud.com/dev-center/add-on-documentation#data-storage +[postgres-addon]: https://next.dotcloud.com/dev-center/add-on-documentation/elephantsql +[run command]: https://next.dotcloud.com/dev-center/guides/ruby/runcommand +[rubynotes]: https://next.dotcloud.com/dev-center/guides/ruby/rubynotes [gem itself]: http://rubygems.org/gems/cloudcontrol-rails diff --git a/Guides/Ruby/RubyNotes.md b/Guides/Ruby/RubyNotes.md index 3629735..872c677 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 dotCloud 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 `RACK_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 `RACK_ENV` environment variables with the [Custom Config addon](https://next.dotcloud.com/add-ons/config). For example: ~~~ -cctrlapp APP_NAME/DEPLOYMENT config.add RACK_ENV=some_env RAILS_ENV=some_env +dcapp APP_NAME/DEPLOYMENT 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]: https://next.dotcloud.com/dev-center/platform-documentation#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 1f57520..c9e7ecc 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 -$ cctrlapp APP_NAME/DEP_NAME run "rake db:migrate" +$ dcapp APP_NAME/DEP_NAME run "rake db:migrate" ~~~ To run rails console: ~~~bash -$ cctrlapp APP_NAME/DEP_NAME run "rails c" +$ dcapp 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 +$ dcapp 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.dotcloudapp.com 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" +$ dcapp 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/Go HelloWorld.md b/Guides/Third-Party-Buildpacks/Go-HelloWorld.md similarity index 82% rename from Guides/Third-Party Buildpacks/Go HelloWorld.md rename to Guides/Third-Party-Buildpacks/Go-HelloWorld.md index e7f7976..463dca8 100644 --- a/Guides/Third-Party Buildpacks/Go HelloWorld.md +++ b/Guides/Third-Party-Buildpacks/Go-HelloWorld.md @@ -1,7 +1,7 @@ # Deploying a Go Application The [Go] language standard library comes with a full working web server that we used to build our *Hello world* example application -In this tutorial we're going to show you how to deploy this simple Go app on [cloudControl]. +In this tutorial we're going to show you how to deploy this simple Go app on [dotCloud]. ## The Go App Explained @@ -32,7 +32,7 @@ The `Godeps.json` you cloned as part of the example app looks like this: ### Process Type Definition -cloudControl uses a [Procfile] to know how to start your processes. +dotCloud 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: ~~~ @@ -43,7 +43,7 @@ Left from the colon we specified the **required** process type called `web` foll ### The Actual Application Code -The example app has two request handlers registered in the `main` function. The `http.FileServer` returns the static content while the other serves the default page. To start the web server `http.ListenAndServe` is called with the server port passed. The app listens on the port specified in the `$PORT` environment variable as is required on cloudControl. +The example app has two request handlers registered in the `main` function. The `http.FileServer` returns the static content while the other serves the default page. To start the web server `http.ListenAndServe` is called with the server port passed. The app listens on the port specified in the `$PORT` environment variable as is required on dotCloud. ~~~go @@ -60,7 +60,7 @@ import ( func defaultHandler(w http.ResponseWriter, r *http.Request) { t := template.Must(template.ParseFiles("templates/hello.html")) pageModel := make(map[string]interface{}) - pageModel["Domain"] = getEnv("DOMAIN", "cloudcontrolled.com") + pageModel["Domain"] = getEnv("DOMAIN", "dotcloudapp.com") if err := t.Execute(w, pageModel); err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) } @@ -85,16 +85,16 @@ func getEnv(key, defaultValue string) string { ## Pushing and Deploying the 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 dotCloud platform: ~~~bash -$ cctrlapp APP_NAME create custom --buildpack https://github.com/cloudControl/buildpack-go +$ dcapp APP_NAME create custom --buildpack https://github.com/cloudControl/buildpack-go ~~~ Push your code to the application's repository: ~~~bash -$ cctrlapp APP_NAME/default push +$ dcapp APP_NAME/default push Counting objects: 17, done. Delta compression using up to 8 threads. @@ -110,19 +110,19 @@ Total 17 (delta 0), reused 0 (delta 0) -----> Custom buildpack provided -----> Uploading image (2.2 MB) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@dotcloudapp.com/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 dcapp deploy command: ~~~bash -$ cctrlapp APP_NAME/default deploy +$ dcapp APP_NAME/default deploy ~~~ -Congratulations, you can now see your Go app running at `http[s]://APP_NAME.cloudcontrolled.com`. +Congratulations, you can now see your Go app running at `http[s]://APP_NAME.dotcloudapp.com`. [Go]: http://golang.org/ -[cloudControl]: http://www.cloudcontrol.com +[dotCloud]: http://next.dotcloud.com [godep]: https://github.com/tools/godep -[Procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#buildpacks-and-the-procfile +[Procfile]: https://next.dotcloud.com/dev-center/platform-documentation#buildpacks-and-the-procfile diff --git a/Guides/Third-Party Buildpacks/Go Martini.md b/Guides/Third-Party-Buildpacks/Go-Martini.md similarity index 79% rename from Guides/Third-Party Buildpacks/Go Martini.md rename to Guides/Third-Party-Buildpacks/Go-Martini.md index 08cb4a5..409541e 100644 --- a/Guides/Third-Party Buildpacks/Go Martini.md +++ b/Guides/Third-Party-Buildpacks/Go-Martini.md @@ -3,7 +3,7 @@ [Martini] is an open source web framework for Go. In this tutorial we're going to show you how to deploy a simple Martini based -application on [cloudControl]. +application on [dotCloud]. ## The Example App Explained @@ -54,7 +54,7 @@ as part of the example app looks like this: ~~~ ### Process Type Definition -cloudControl uses a [Procfile] to know how to start the app's processes. +dotCloud 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: @@ -63,11 +63,11 @@ your repository. It looks like this: web: MARTINI_ENV=production go-martini-example-app ~~~ -Left from the colon we specify the **required** process type called `web` and then set the `$MARTINI_ENV` environment variable to `production` and run the application binary. All web processes on the cloudControl platform are required to listen on the port specified by the `$PORT` environment variable. Martini does this by default. +Left from the colon we specify the **required** process type called `web` and then set the `$MARTINI_ENV` environment variable to `production` and run the application binary. All web processes on the dotCloud platform are required to listen on the port specified by the `$PORT` environment variable. Martini does this by default. ### The Actual Application Code -The actual application code is really straight forward. It simply uses the Martini framework to render the HTML output and return it to the client. The `m.Run()` automatically binds to the port specified in the `$PORT` environment variable as is required on [cloudControl]. +The actual application code is really straight forward. It simply uses the Martini framework to render the HTML output and return it to the client. The `m.Run()` automatically binds to the port specified in the `$PORT` environment variable as is required on [dotCloud]. ~~~go package main @@ -94,17 +94,17 @@ func 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 using the custom Go buildpack: +and create it on the dotCloud platform using the custom Go buildpack: ~~~bash -$ cctrlapp APP_NAME create custom --buildpack https://github.com/cloudControl/buildpack-go +$ dcapp APP_NAME create custom --buildpack https://github.com/cloudControl/buildpack-go ~~~ Push your code to the application's repository, which triggers the deployment image build process: ~~~bash -$ cctrlapp APP_NAME/default push +$ dcapp APP_NAME/default push Counting objects: 73, done. Delta compression using up to 4 threads. Compressing objects: 100% (52/52), done. @@ -118,24 +118,24 @@ Total 73 (delta 3), reused 0 (delta 0) remote: -----> Custom buildpack provided -----> Uploading image (2.5 MB) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@dotcloudapp.com/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 dcapp deploy command. ~~~bash -$ cctrlapp APP_NAME/default deploy +$ dcapp APP_NAME/default deploy ~~~ -Congratulations, you can now see your Martini app running at `http://APP_NAME.cloudcontrolled.com`. The command line client provides the `open` command to quickly open the app in your default browser. +Congratulations, you can now see your Martini app running at `http://APP_NAME.dotcloudapp.com`. The command line client provides the `open` command to quickly open the app in your default browser. ~~~bash -$ cctrlapp APP_NAME/default open +$ dcapp APP_NAME/default open ~~~ [Martini]: http://martini.codegangsta.io/ -[cloudControl]: https://www.cloudcontrol.com +[dotCloud]: https://next.dotcloud.com [Go buildpack]: https://github.com/cloudControl/buildpack-go -[Procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#buildpacks-and-the-procfile +[Procfile]: https://next.dotcloud.com/dev-center/platform-documentation#buildpacks-and-the-procfile diff --git a/Guides/Third-Party Buildpacks/Go Revel.md b/Guides/Third-Party-Buildpacks/Go-Revel.md similarity index 76% rename from Guides/Third-Party Buildpacks/Go Revel.md rename to Guides/Third-Party-Buildpacks/Go-Revel.md index 56ab579..576097d 100644 --- a/Guides/Third-Party Buildpacks/Go Revel.md +++ b/Guides/Third-Party-Buildpacks/Go-Revel.md @@ -3,7 +3,7 @@ [Revel] is an open source web framework for Go. In this tutorial we're going to show you how to deploy a simple Revel based -application on [cloudControl]. +application on [dotCloud]. ## The Example App Explained @@ -23,7 +23,7 @@ through the different files and their purpose real quick. The [Revel buildpack] handles the Revel dependencies automatically. ### Process Type Definition -cloudControl uses a [Procfile] to know how to start the app's processes. The example app provides a Procfile. It runs the revel app in production mode and listens on the port specified by the `$PORT` environment variable. +dotCloud uses a [Procfile] to know how to start the app's processes. The example app provides a Procfile. It runs the revel app in production mode and listens on the port specified by the `$PORT` environment variable. ~~~ web: revel run github.com/cloudControl/go-revel-example-app prod $PORT @@ -73,17 +73,17 @@ GET /public/*filepath Static.Serve("public") ## 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 using the custom Go buildpack: +and create it on the dotCloud platform using the custom Go buildpack: ~~~bash -$ cctrlapp APP_NAME create custom --buildpack https://github.com/revel/heroku-buildpack-go-revel +$ dcapp APP_NAME create custom --buildpack https://github.com/revel/heroku-buildpack-go-revel ~~~ Push your code to the application's repository, which triggers the deployment image build process: ~~~bash -$ cctrlapp APP_NAME/default push +$ dcapp APP_NAME/default push Counting objects: 463, done. Delta compression using up to 4 threads. Compressing objects: 100% (334/334), done. @@ -102,24 +102,24 @@ cat: /srv/tmp/builddir/.godir: No such file or directory remote: -----> Custom buildpack provided -----> Uploading image (57.0 MB) -To ssh://APP_NAME@cloudcontrolled.com/repository.git +To ssh://APP_NAME@dotcloudapp.com/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 dcapp deploy command. ~~~bash -$ cctrlapp APP_NAME/default deploy +$ dcapp APP_NAME/default deploy ~~~ -Congratulations, you can now see your Revel app running at `http://APP_NAME.cloudcontrolled.com`. The command line client provides the `open` command to quickly open the app in your default browser. +Congratulations, you can now see your Revel app running at `http://APP_NAME.dotcloudapp.com`. The command line client provides the `open` command to quickly open the app in your default browser. ~~~bash -$ cctrlapp APP_NAME/default open +$ dcapp APP_NAME/default open ~~~ [Revel]: http://revel.github.io -[cloudControl]: https://www.cloudcontrol.com +[dotCloud]: https://next.dotcloud.com [Revel buildpack]: https://github.com/revel/heroku-buildpack-go-revel -[Procfile]: https://www.cloudcontrol.com/dev-center/Platform%20Documentation#buildpacks-and-the-procfile +[Procfile]: https://next.dotcloud.com/dev-center/platform-documentation#buildpacks-and-the-procfile diff --git a/Guides/Third-Party Buildpacks/Third-Party Buildpacks.md b/Guides/Third-Party-Buildpacks/Third-Party-Buildpacks.md similarity index 86% rename from Guides/Third-Party Buildpacks/Third-Party Buildpacks.md rename to Guides/Third-Party-Buildpacks/Third-Party-Buildpacks.md index affd8bd..a780758 100644 --- a/Guides/Third-Party Buildpacks/Third-Party Buildpacks.md +++ b/Guides/Third-Party-Buildpacks/Third-Party-Buildpacks.md @@ -1,6 +1,6 @@ # Third-Party Custom Buildpacks -[cloudControl] officially supports the following application types via the [Pinky Stack][PinkyStack]. +[dotCloud] officially supports the following application types via the [Pinky Stack][PinkyStack]. - Java-based (Java with Maven, Gradle, Grails, Scala, Play! or Clojure) - Ruby @@ -11,7 +11,7 @@ However, you can deploy apps developed on languages and technologies beyond the ## 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 dotCloud platform covering the following languages and technologies: |Technology|Buildpack URL| |:---------|:----------:| @@ -28,7 +28,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 +$ dcapp APP_NAME create custom --buildpack BUILDPACK_URL ~~~ **Note:** `BUILDPACK_URL` has to be a non-ssh git repository. @@ -37,8 +37,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 +[dotCloud]: https://next.dotcloud.com +[PinkyStack]: https://next.dotcloud.com/dev-center/platform-documentation#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 similarity index 50% rename from Platform Documentation.md rename to Platform-Documentation.md index 67d159d..30fea74 100644 --- a/Platform Documentation.md +++ b/Platform-Documentation.md @@ -1,59 +1,36 @@ - - -# cloudControl Documentation +# dotCloud Documentation ## Platform Access **TL;DR:** - * The command line client cctrl is the primary interface. + * The command line client dotcloudng 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 *dotcloudng*. 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 dotCloud platform. The CLI consists of 2 parts: *dcapp* and *dcuser*. 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 *dotcloudng* is easy and works on Mac/Linux as well as on Windows. #### Quick Installation Windows -For Windows we offer an installer. Please download [the latest version] of the installer from S3. The file is named cctrl-x.x-setup.exe. +For Windows we offer an installer. Please download [the latest version] of the installer from Cloud Storage. The file is named dotcloudng-x.x-setup.exe. #### 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 dotcloudng via pip. *dotcloudng* requires [Python 2.6+]. ~~~ -$ sudo pip install -U cctrl +$ sudo pip install -U dotcloudng ~~~ -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) and then install dotcloudng. ~~~ $ sudo easy_install pip -$ sudo pip install -U cctrl +$ sudo pip install -U dotcloudng ~~~ ## User Accounts @@ -61,29 +38,89 @@ $ sudo pip install -U cctrl **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`` + * User accounts can be created via the *web console* or via ``dcuser create`` + * User accounts can be deleted via the *web console* or via ``dcuser delete`` + * The CLI can be configured via ``dcuser setup`` 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 +$ dcuser 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 +$ dcuser activate USER_NAME ACTIVATION_CODE ~~~ If you want to delete your user account, please use either the *web console* or the following CLI command: + +~~~ +$ dcuser delete +~~~ + +### Setup CLI + +With the `dcuser setup` command you can create or modify your CLI configuration whenever you need to. We do not ask for configurations changes anymore, instead you will have explicit control over this by using this command. + +Usually you only need to run `dcuser setup` to get this job done. In the first run you will be asked for your email. For all other options, e.g. ssh-key-path, the default values are taken. + +The command has three different options to modify each of the existing values on the user configuration: + +- `--email` will set the email on your configuration. This email is used to login on the platform. + +- `--ssh-auth` will enable the ssh public key authentication if set to `yes` and disable it when `no` (it defaults to `yes`). See more for [ssh public key authentication](#ssh-public-key-authentication). + +- `--ssh-key-path` specifies the path of your ssh public key used for the authentication. If the flag is not set, it defaults to `HOME_DIR/.ssh/id_rsa.pub`. The CLI will try to upload the public key to the platform. We only support RSA keys. Details can be found under [Keys](#keys). + +The whole command as example: + ~~~ -$ cctrluser delete +dcuser setup --email user1@example.com --ssh-auth yes --ssh-key-path /path/to/your/publickey.pub ~~~ ### Password Reset You can [reset your password], in case you forgot it. +## CLI Authentication + +At the moment our CLI allows users to authenticate to the platform with two methods. + +### SSH Public Key Authentication + +With this method you can authenticate to the platform in a more convenient way than using [email / password authentication](#email--password-authentication). After adding your SSH key to the platform, its location is remembered by the CLI and will be used in the future requests. You can add a public key to the platform and/or change the public key used for the authentication by [setup the CLI](#setup-cli). + +~~~bash +dcuser setup --ssh-key-path /path/to/your/publickey.pub +~~~ + +If you set a passphrase for your SSH key, which is strongly recommended, than you have to add the key to your ssh-agent by: + +~~~bash +# start ssh-agent +eval `ssh-agent` +ssh-add /path/to/your/privatekey +~~~ + +### Email / Password Authentication + +The email / password authentication is an alternative to SSH public key authentication. To enable it, simply [setup the CLI](#setup-cli), setting the `--ssh-auth` parameter to `no`. + +~~~ +dcuser setup --ssh-auth no +~~~ + +From now, whenever you want to authenticate to the platform you have to put your password. + +Alternatively, to get this process less verbose, you can set the password as shell environment variable: + +~~~bash +export DC_PASSWORD=yourpassword +~~~ + +Disadvantage of this approach is the fact that your password is exposed to your environment, that is why we encourage using SSH public key authentication instead. ## Apps, Users and Deployments @@ -91,10 +128,10 @@ You can [reset your password], in case you forgot it. * Applications (apps) have a repository, deployments and users. * 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). + * 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. * Users can be added to apps to gain access to the repository, branches and deployments. -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. +dotCloud 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 @@ -103,13 +140,13 @@ An app consists of a repository (with branches), deployments and users. Creating 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 +$ dcapp APP_NAME create php ~~~ You can always list your existing apps using the command line client too. ~~~ -$ cctrlapp -l +$ dcapp -l Apps Nr Name Type 1 myfirstapp php @@ -119,13 +156,12 @@ 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. +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 +$ dcapp APP_NAME user Users Name Email Role Deployment @@ -138,19 +174,22 @@ Users 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 +$ dcapp APP_NAME user.add user4@example.com ~~~ To remove a user, please use their email address. + ~~~ -$ cctrlapp APP_NAME user.remove user3@example.com +$ dcapp 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 +$ dcapp APP_NAME/DEP_NAME user.add user5@example.com +$ dcapp 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 @@ -162,46 +201,45 @@ Please note: a user can either be added to the application or to one or more dep You can provide the role with the `user.add` command. ~~~ -$ cctrlapp APP_NAME user.add user5@example.com --role readonly +$ dcapp 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, dcapp will offer to create one. + +We only support RSA ssh keys. The key must be a one-liner and start with "ssh-rsa AAAAB3NzaC1yc2E" (OpenSSH compatible). ~~~ -$ cctrluser key.add +$ dcuser key.add ~~~ You can also list the available key ids and remove existing keys using the key id. ~~~ -$ cctrluser key +$ dcuser key Keys Dohyoonuf7 -$ cctrluser key Dohyoonuf7 +$ dcuser key Dohyoonuf7 ssh-rsa AAA[...] -$ cctrluser key.remove Dohyoonuf7 +$ dcuser 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). +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 branch. -Deployments run independently from each other, including separate runtime environments, file system storage and Add-ons (e.g. databases and caches). -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. +Deployments run independently from each other, including separate runtime environments, file system storage and Add-ons (e.g. databases and caches). 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 +$ dcapp APP_NAME details App Name: APP_NAME Type: php Owner: user1 - Repository: ssh://APP_NAME@cloudcontrolled.com/repository.git + Repository: ssh://APP_NAME@dotcloudapp.com/repository.git [...] @@ -211,66 +249,36 @@ App APP_NAME/stage ~~~ - ## Version Control & Images **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. +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. -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 dcapp 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. ~~~ -# with cctrlapp: -$ cctrlapp APP_NAME/dev push +# with dcapp: +$ dcapp APP_NAME/dev push -# get the REPO_URL from the output of cctrlapp APP_NAME details +# get the REPO_URL from the output of dcapp 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 dotcloudng REPO_URL +$ git push dotcloudng dev ~~~ 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,7 +289,7 @@ 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 dotCloud 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 dotCloud 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. @@ -300,31 +308,32 @@ 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 dotCloud 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 +$ dcapp 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). -If not specified, the version to be deployed defaults to the latest image available (the one built during the last successful push). +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). After the new containers are up and running the load balancing tier stops sending requests to the old containers and instead sends them to the new version. A log message in the [deploy log](#deploy-log) appears when this process has finished. -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). -After the new containers are up and running the load balancing tier stops sending requests to the old containers and instead sends them to the new version. -A log message in the [deploy log](#deploy-log) appears when this process has finished. +Running [workers](#workers) have to be redeployed separately by initiating a [manual restart](#restarting-workers) or by adding the `--restart-workers` option to the `deploy` command. + +~~~ +$ dcapp APP_NAME/DEP_NAME deploy --restart-workers +~~~ ### Container Idling -Deployments running on a single web container with one unit of memory (128MB/h) are automatically idled when they are not receiving HTTP requests for 1 hour or more. This -results in a temporary suspension of the container where the application is -running. It does not affect the Add-ons or workers related to this deployment. +Deployments running on a single web container with one unit of memory (128MB/h) are automatically idled when they are not receiving HTTP requests for 1 hour or more. This results in a temporary suspension of the container where the application is running. It does not affect the Add-ons or workers related to this deployment. -Once a new HTTP request is sent to this deployment, the application is automatically re-engaged. This process causes a slight delay until the -first request is served. All following requests will perform normally. +Once a new HTTP request is sent to this deployment, the application is automatically re-engaged. This process causes a slight delay until the 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 +$ dcapp APP_NAME/DEP_NAME details Deployment name: APP_NAME/DEP_NAME [...] @@ -332,21 +341,20 @@ Deployment [...] ~~~ -Scaling your deployment will prevent idling, which is recommended for -any production system. +Scaling your deployment will prevent idling, which is recommended for any production system. ## Emergency Rollback 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 +$ dcapp 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 +$ dcapp APP_NAME/DEP_NAME deploy THE_LAST_WORKING_VERSION_HASH ~~~ @@ -358,9 +366,9 @@ $ 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 dotCloud 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 the GridFS feature available as part of the [MongoSoup Add-on]. ## Development, Staging and Production Environments @@ -373,7 +381,7 @@ 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 dotCloud 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 +389,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. @@ -400,29 +408,31 @@ Add-ons add additional services to your deployment. The [Add-on marketplace] off 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 `dcapp addon.list` command. ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.list +$ dcapp 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 +$ dcapp 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 +$ dcapp APP_NAME/DEP_NAME addon Addon : alias.free -Addon : newrelic.standard +Addon : sendgrid.free [...] -Addon : blitz.250 +Addon : mysqls.free [...] Addon : memcachier.dev @@ -433,40 +443,34 @@ 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 +$ dcapp 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 +$ dcapp 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. ### Add-on Credentials -For many Add-ons you require credentials to connect to their service. The credentials are exported to the deployment in -a JSON formatted config file. The path to the file can be found in the `CRED_FILE` environment variable. Never -hardcode these credentials in your application, because they differ over deployments and can change after any redeploy -without notice. + +For many Add-ons you require credentials to connect to their service. The credentials are exported to the deployment in a JSON formatted config file. The path to the file can be found in the `CRED_FILE` environment variable. Never hardcode these credentials in your application, because they differ over deployments and can change after any redeploy without notice. We provide detailed code examples how to use the config file in our guides section. #### Enabling/disabling credentials environment variables -We recommend using the credentials file for security reasons but credentials can also be accessed through environment variables. -This is disabled by default for PHP and Python apps. -Accessing the environment is more convenient in most languages, but some reporting tools or wrong security settings in -your app might print environment variables to external services or even your users. This also applies to any child processes -of your app if they inherit the environment (which is the default). When in doubt, disable this feature and use -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. +We recommend using the credentials file for security reasons but credentials can also be accessed through environment variables. This is disabled by default for PHP and Python apps. Accessing the environment is more convenient in most languages, but some reporting tools or wrong security settings in your app might print environment variables to external services or even your users. This also applies to any child processes of your app if they inherit the environment (which is the default). When in doubt, disable this feature and use the credentials file. -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)). +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://next.dotcloud.com/dev-center/guides/ruby/add-on-credentials), [Python](https://next.dotcloud.com/dev-center/guides/python/add-on-credentials), [Node.js](https://next.dotcloud.com/dev-center/guides/nodejs/add-on-credentials), [Java](https://next.dotcloud.com/dev-center/guides/java/add-on-credentials), [PHP](https://next.dotcloud.com/dev-center/guides/php/add-on-credentials)). To see the format and contents of the credentials file locally, use the `addon.creds` command. ~~~ -$ cctrlapp APP_NAME/DEP_NAME addon.creds +$ dcapp APP_NAME/DEP_NAME addon.creds { - "BLITZ": { - "BLITZ_API_KEY": "SOME_SECRET_API_KEY", - "BLITZ_API_USER": "SOME_USER_ID" + "SENDGRID": { + "SENDGRID_PASSWORD": "SOME_SECRET_PASSWORD", + "SENDGRID_USERNAME": "SOME_USERNAME" }, "MEMCACHIER": { "MEMCACHIER_PASSWORD": "SOME_SECRET_PASSWORD", @@ -489,10 +493,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 dcapp 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] +$ dcapp APP_NAME/DEP_NAME log [access,error,worker,deploy] [...] ~~~ @@ -522,6 +526,7 @@ The Custom Config Add-on can be used to specify an additional endpoint to receiv This is done by setting the config variable "RSYSLOG_REMOTE". The content should contain valid [rsyslog] configuration and can span multiple lines. E.g. to forward the logs to custom syslog remote over a [TLS] connection, create a temporary file with the following content: + ~~~ $DefaultNetstreamDriverCAFile /app/CUSTOM_CERTIFICATE_PATH $ActionSendStreamDriver gtls @@ -530,81 +535,67 @@ $ActionSendStreamDriverAuthMode x509/name $template CustomFormat, "%syslogtag%%msg%\n" *.* @@SERVER_ADDRESS:PORT;CustomFormat ~~~ + Where "SERVER_ADDRESS" and "PORT" should be replaced with the concrete values and "CUSTOM_CERTIFICATE_PATH" should be the path to a certificate file for the custom syslog remote in you repository. 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 +$ dcapp 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. - ## Provided Subdomains and Custom Domains **TL;DR:** - * Each deployment is provided with both a `*.cloudcontrolled.com` and `*.cloudcontrolapp.com` subdomain. + * Each deployment is provided with a `dotcloudapp.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 a `*.dotcloudapp.com` subdomain. The `APP_NAME.dotcloudapp.com` will point to the `default` deployment while any additional deployment can be accessed with a prefixed subdomain: `DEP_NAME-APP_NAME.app.exo.io`. -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.dotcloudapp.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 exoscale 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). +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). +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, requests are routed via the `*.dotcloudapp.com` subdomain. + * The `*.dotcloudapp.com` subdomain provides WebSocket support. * 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 `*.dotcloudapp.com` subdomain. 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. ### SSL -Transport Layer Security (TLS / SSL) is available to encrypt traffic between -users and applications. +Transport Layer Security (TLS / SSL) is available to encrypt traffic between users and applications. -As part of the provided `.cloudcontrolled.com` subdomain, all deployments have -access to piggyback SSL using a `*.cloudcontrolled.com` 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 +As part of the provided `.dotcloudapp.com` subdomain, all deployments have access to piggyback SSL using a `*.dotcloudapp.com` wildcard certificate. To use this, simply point your browser to: +* `https://APP_NAME.dotcloudapp.com` for the default deployment +* `https://DEP_NAME-APP_NAME.dotcloudapp.com` for non-default deployments Please note the **dash** between DEP_NAME and APP_NAME. -SSL support for custom domains is available through the -[SSL add-on](https://www.cloudcontrol.com/add-ons/ssl). +SSL support for custom domains is available through the [SSL add-on](https://next.dotcloud.com/add-ons/ssl). -Instructions on how to add HTTPS redirects to your application can be -found in the [SSL add-on documentation](https://www.cloudcontrol.com/dev-center/Add-on%20Documentation/Deployment/SSL#https-redirects). +Instructions on how to add HTTPS redirects to your application can be found in the [SSL add-on documentation](https://next.dotcloud.com/dev-center/add-on-documentation/ssl#https-redirects). ### Elastic Addresses @@ -616,21 +607,13 @@ 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. - - * __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. - * __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. - * __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. +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. You can find them below. -#### Timeouts for `*.cloudcontrolled.com` subdomain: + * __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. -|Parameter|Value [s]| -|:---------|:----------:| -|Connect timeout|60| -|Send timeout|60| -|Read timeout|120| - -#### Timeouts for `*.cloudcontrolapp.com` subdomain: +#### Timeouts for `*.dotcloudapp.com` subdomain: |Parameter|Value [s]| |:---------|:----------:| @@ -644,21 +627,16 @@ 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 a Health Checker to ensure high availability. Because this mechanism depends 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 - -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. - -#### `*.cloudcontrolapp.com` subdomain +#### Health Checker -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. +For the `*.dotcloudapp.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. 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. - ## Scaling **TL;DR:** @@ -666,72 +644,31 @@ 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 dotCloud loadbalancing and [routing tier](#routing-tier) ensures efficient distribution of incoming requests accross all available containers. ### Horizontal Scaling -Horizontal scaling is controlled by the --containers parameter. -It specifies the number of containers you have running. -Raising --containers also increases the availability in case of node failures. -Deployments with --containers 1 (the default) are unavailable for a few minutes in the event of a node failure until the failover process has finished. Set --containers value to at least 2 if you want to avoid downtime in such situations. +Horizontal scaling is controlled by the --containers parameter. It specifies the number of containers you have running. Raising --containers also increases the availability in case of node failures. Deployments with --containers 1 (the default) are unavailable for a few minutes in the event of a node failure until the failover process has finished. Set --containers value to at least 2 if you want to avoid downtime in such situations. ### 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 +## Performance **TL;DR:** * Reduce the total number of requests that make up a page view. - * Cache as far away from your database as possible. - * Try to rely on cache breakers instead of flushing. ### Reducing the Number of Requests Perceived web application performance is mostly influenced by the frontend. It's very common that the highest optimization potential lies in reducing the overall number of requests per page view. One common technique to accomplish this is combining and minimizing javascript and css files into one file each and using sprites for images. -### Caching Early - -After you have reduced the total number of requests, it's recommended to cache as far away from your database as possible. Using far-future `expires` headers avoids that browsers request resources at all. The next best way of reducing the number of requests that hit your containers is to cache complete responses in the loadbalancer. For this we offer caching directly in the routing tier. - -#### 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. - -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. - -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 - -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`). - - ## WebSockets **TL;DR:** - * WebSockets are supported via the `*.cloudcontrolapp.com` subdomain. + * WebSockets are supported via the `*.dotcloudapp.com` 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://`. @@ -756,18 +693,20 @@ 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 `*.dotcloudapp.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. ## Scheduled Jobs and Background Workers **TL;DR:** - * Web requests are subject to a time limit of 120s. - * Scheduled jobs are supported through different Add-ons. + + * Web requests are subject to a time limit of 55s. + * Scheduled jobs are supported through the Cron Add-on or workers. * 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 @@ -775,12 +714,180 @@ 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]. +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. Workers are the best way for handling tasks that will take longer +than 55s to execute, or that are triggered by a user request which are handled +asynchronously to prevent idle time for users. For example, handling +long-running periodical calculations or to poll a queue and execute tasks in the +background. + +You can create multiple workers for individual tasks. Each worker runs in a +separate isolated container. The containers have exactly the same runtime +environment defined by the stack chosen and the buildpack used and have the same +access to all of the deployments add-ons. + +Note: Workers sometimes get interrupted and restarted on a different host for +the following reasons: + - single instances can run into issues and need to be replaced + - containers are redistributed to provide the best performance + - security updates are applied + +This means all your worker operations should be idempotent. If possible a +`SIGTERM` signal is send to your worker before the shutdown. + +#### Worker configuration + +Add the following line to your app's `Procfile`: + +Usage: + +~~~ +WORKER_NAME: [] +~~~ + +Example for a Procfile with one worker defined: +~~~ +web: python server.py +reminder: python session_reminder.py +~~~ + +*Note: The WORKER_NAME can be chosen freely, but we recommend to name it in +a way, that it describes the task of the worker in a short way* + +#### Starting a Worker + +Workers can be started via the command line client's `worker.add` command. + +~~~ +$ dcapp APP_NAME/DEP_NAME worker.add WORKER_NAME [WORKER_PARAMS] +~~~ + +Enclose multiple WORKER_PARAMS in double quotes. + +~~~ +$ dcapp APP_NAME/DEP_NAME worker.add WORKER_NAME "PARAM1 PARAM2 PARAM3" +~~~ + +#### List Running Workers + +To get a list of currently running workers use the `worker` command. + +~~~ +$ dcapp APP_NAME/DEP_NAME worker +Workers + nr. wrk_id + 1 WRK_ID +~~~ + +You can also get all the worker details by appending the WRK_ID to the worker +command. + +~~~ +$ dcapp APP_NAME/DEP_NAME worker WRK_ID +Worker +wrk_id : WRK_ID +command : WORKER_NAME +params : "PARAM1 PARAM2 PARAM3" +~~~ + +#### Restarting Workers + +Running workers can be restarted via the command the command line client's +`worker.restart` command. + +~~~ +$ dcapp APP_NAME/DEP_NAME worker.restart (WRK_ID | --all) +~~~ + +#### Stopping Workers + +Workers can be either stopped via the command line client or by exiting the +process with a zero exit code. + +##### Via Command Line + +To stop a running worker via the command line use the `worker.remove` command. + +~~~ +$ dcapp APP_NAME/DEP_NAME worker.remove WRK_ID +~~~ + +To get the WRK_ID refer to the listing workers section above. + +##### Via Exit Codes + +To stop a worker programatically use UNIX style exit codes. There are three +distinct exit codes available. + + * exit (0); // Everything OK. Worker will be stopped. + * exit (1); // Error. Worker will be restarted. + * exit (2); // Error. Worker will be stopped. + +For more details refer to the [PHP example](#php-worker-example) below. + +#### Worker log + +As already explained in the [Logging section] +(https://next.dotcloud.com/dev-center/platform-documentation#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. + +~~~ +$ dcapp 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 +[...] +~~~ + +#### PHP Worker Example + +The following example shows how to use the exit codes to restart or stop a +worker. + +~~~php +// read exit code parameter +$exitCode = isset($argv[1]) && (int)$argv[1] > 0 ? (int)$argv[1] : 0;$steps = 5; + +$counter = 1; +while(true) { + print "step: " . ($counter) . PHP_EOL; + if($counter == $steps){ + if($exitCode == 0) { + print "All O.K. Exiting." . PHP_EOL; + } else if ($exitCode == 2){ + print "An error occured. Exiting." . PHP_EOL; + } else { + print "An error occured. Restarting." . PHP_EOL; + } + print "Exitcode: " . $exitCode . PHP_EOL . PHP_EOL; + exit($exitCode); + } + sleep(1); + $counter++; +} +~~~ + +Running this worker with the exit code set to 2 would result in the following +output and the worker stopping itself. + +~~~ +$ dcapp APP_NAME/DEP_NAME worker.add WORKER_NAME 2 +$ dcapp 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 +[Tue Apr 12 09:15:56 2011] WRK_ID step: 3 +[Tue Apr 12 09:15:57 2011] WRK_ID step: 4 +[Tue Apr 12 09:15:58 2011] WRK_ID step: 5 +[Tue Apr 12 09:15:58 2011] WRK_ID An error occured. Exiting. +[...] +~~~ ## 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 dotCloud 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. @@ -789,53 +896,56 @@ The container is identical to the web or worker containers but starts an SSH dae To start a shell (e.g. bash) use the `run` command. ~~~ -$ cctrlapp APP_NAME/DEP_NAME run bash +$ dcapp 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" 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.dotcloudapp.com 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" +$ dcapp 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 -GEM_PATH=vendor/bundle/ruby/1.9.1 -HOME=/srv -HOSTNAME=DEP_ID-10346 +DEP_VERSION=91bd71fdb33e3609292660c83956e02d0af65819 +DOMAIN=dotcloudapp.com +HOME=/srv/www +HOSTNAME=depxt6zv82r-10680 LANG=en_US.UTF-8 -LOGNAME=u10346 -MAIL=/var/mail/u10346 -OLDPWD=/srv +LD_LIBRARY_PATH=/app/.paasprovider/vendor/lib +LIBRARY_PATH=/app/.paasprovider/vendor/lib +LOGNAME=u10680 +MAIL=/var/mail/u10680 PAAS_VENDOR=cloudControl -PATH=bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin -PORT=10346 +PATH=/app/.paasprovider/python/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games +PORT=10680 +PS1='[\$DEP_NAME]:\w\$ ' PWD=/srv/www -RACK_ENV=production -RAILS_ENV=production +PYTHONHASHSEED=random +PYTHONHOME=/app/.paasprovider/python +PYTHONPATH=/app/ +PYTHONUNBUFFERED=True SHELL=/bin/sh -SSH_CLIENT=10.32.47.197 59378 10346 -SSH_CONNECTION=10.32.47.197 59378 10.250.134.126 10346 +SIZE=1 +SSH_CLIENT=10.240.134.154 35844 10680 +SSH_CONNECTION=10.240.134.154 35844 10.240.84.84 10680 SSH_TTY=/dev/pts/0 -TERM=xterm +TERM=xterm-256color TMP_DIR=/srv/tmp TMPDIR=/srv/tmp -USER=u10346 +USER=u10680 WRK_ID=WRK_ID -Connection to 10.250.134.126 closed. -Connection to ssh.cloudcontrolled.net closed. +Connection to sshforwarder.dotcloudapp.com closed. + ~~~ ## Stacks @@ -844,7 +954,7 @@ 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. @@ -852,49 +962,38 @@ Stacks are based on Ubuntu releases and have the same first letter as the releas ### 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 `dcapp` command line interface. + ~~~ -$ cctrlapp APP_NAME/DEP_NAME details +$ dcapp 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]: https://next.dotcloud.com/dev-center/add-on-documentation/config +[web console]: https://next.dotcloud.com/console [API libraries]: https://github.com/cloudControl -[the latest version]: http://cctrl.s3-website-eu-west-1.amazonaws.com/#windows/ +[the latest version]: https://download.dotcloudapp.com/windows [Python 2.6+]: http://python.org/download/ -[reset your password]: https://api.cloudcontrol.com/reset_password/ +[reset your password]: https://api.dotcloudapp.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]: https://next.dotcloud.com/dev-center/guides +[MongoSoup Add-on]: https://next.dotcloud.com/add-ons/mongosoup +[Add-on marketplace]: https://next.dotcloud.com/add-ons +[Deployment category]: https://next.dotcloud.com/dev-center/add-on-documentation#deployment [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 -[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 +[Alias Add-on]: https://next.dotcloud.com/add-ons/alias +[MemCachier Add-on]: https://next.dotcloud.com/add-ons/memcachier +[MemCachier Documentation]: https://next.dotcloud.com/dev-center/add-on-documentation/memcachier [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 +[Cron Add-on]: https://next.dotcloud.com/add-ons/cron +[Cron Add-on documentation]: https://next.dotcloud.com/dev-center/add-on-documentation/cron [Ubuntu 10.04 LTS Lucid Lynx]: http://releases.ubuntu.com/lucid/ [Ubuntu 12.04 LTS Precise Pangolin]: http://releases.ubuntu.com/precise/ diff --git a/Quickstart.md b/Quickstart.md index 6121784..4ef82e2 100644 --- a/Quickstart.md +++ b/Quickstart.md @@ -1,6 +1,6 @@ -# cloudControl Quickstart +# dotCloud 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 dotCloud. Follow this 5 minute quickstart to get your first app running on dotCloud 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. @@ -9,30 +9,30 @@ It's easy to start with cloudControl. Follow this 5 minute quickstart to get you ### Requirements * git version control system -* cctrl command line client +* dotcloudng command line client ### 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 cctrl +### Install dotcloudng -**Linux/Mac OS X:** We recommend installing cctrl via pip. +**Linux/Mac OS X:** We recommend installing dotcloudng via pip. ~~~bash # if you don't have pip yet $ sudo easy_install pip -$ sudo pip install cctrl +$ sudo pip install dotcloudng ~~~ -**Windows:** Please download the provided [installer](https://www.cloudcontrol.com/download/win). +**Windows:** Please download the provided [installer](https://download.dotcloudapp.com/windows). ## 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 +$ dcuser create Username: USERNAME Email : EMAIL Password: PASSWORD @@ -43,7 +43,7 @@ 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 +$ dcuser 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. @@ -51,19 +51,19 @@ Replace `USERNAME` and `ACTIVATION_CODE` with the values form the activation e-m ## Add a Public Key ~~~bash -$ cctrluser key.add +$ dcuser 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 dotCloud -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 dotCloud platform by giving it an unique `APP_NAME` (the name is used as the `.dotcloudapp.com` subdomain) and choosing the `TYPE`. ~~~bash -$ cctrlapp APP_NAME create [java, php, python, ruby, nodejs] +$ dcapp APP_NAME create [java, php, python, ruby, nodejs] ~~~ If the `APP_NAME` is already taken, please pick another one. @@ -74,7 +74,7 @@ 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 dotCloud platform. ~~~bash # for Java @@ -98,29 +98,29 @@ $ git clone https://github.com/cloudControl/nodejs-express-example-app.git $ cd nodejs-express-example-app # now push -$ cctrlapp APP_NAME push +$ dcapp 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. -## Deploy Your Application on cloudControl +## Deploy Your Application on dotCloud Deploy your app with ~~~bash -$ cctrlapp APP_NAME deploy +$ dcapp APP_NAME deploy ~~~ **Congratulations, your app is now up and running.** ~~~bash -http[s]://APP_NAME.cloudcontrolled.com +http[s]://APP_NAME.dotcloudapp.com ~~~ ## 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)](https://storage.googleapis.com/download.dotcloudapp.com/dotcloudng_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](https://next.dotcloud.com/dev-center/platform-documentation). diff --git a/README b/README index f0d2167..0f20c45 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -cloudControl Documentation +dotCloud Documentation -Markdown source of the cloudControl documentation online at https://www.cloudcontrol.com/dev-center +Markdown source of the dotCloud documentation online at https://next.dotcloud.com/dev-center For corrections or suggestions please send a pull request. diff --git a/cctrl_cheatsheet.pdf b/cctrl_cheatsheet.pdf deleted file mode 100644 index 9fd8b53..0000000 Binary files a/cctrl_cheatsheet.pdf and /dev/null differ diff --git a/images/ZendFramework-logo.png b/images/ZendFramework-logo.png deleted file mode 100644 index f1bb979..0000000 Binary files a/images/ZendFramework-logo.png and /dev/null differ diff --git a/images/cake-deployed-successfully.png b/images/cake-deployed-successfully.png deleted file mode 100644 index bd7eb91..0000000 Binary files a/images/cake-deployed-successfully.png and /dev/null differ diff --git a/images/cake-homepage.png b/images/cake-homepage.png deleted file mode 100644 index 27165e5..0000000 Binary files a/images/cake-homepage.png and /dev/null differ diff --git a/images/drupal7-files.png b/images/drupal7-files.png deleted file mode 100644 index b8549a6..0000000 Binary files a/images/drupal7-files.png and /dev/null differ diff --git a/images/drupal7-running.png b/images/drupal7-running.png deleted file mode 100644 index c2ca05e..0000000 Binary files a/images/drupal7-running.png and /dev/null differ diff --git a/images/drupal7.png b/images/drupal7.png deleted file mode 100644 index 9439398..0000000 Binary files a/images/drupal7.png and /dev/null differ diff --git a/images/expanded-sourcefile.png b/images/expanded-sourcefile.png deleted file mode 100644 index dcd9586..0000000 Binary files a/images/expanded-sourcefile.png and /dev/null differ diff --git a/images/joomla-logo.png b/images/joomla-logo.png deleted file mode 100644 index 96f244c..0000000 Binary files a/images/joomla-logo.png and /dev/null differ diff --git a/images/joomla-running.png b/images/joomla-running.png deleted file mode 100644 index d6b62b1..0000000 Binary files a/images/joomla-running.png and /dev/null differ diff --git a/images/joomla-source.png b/images/joomla-source.png deleted file mode 100644 index 4368eb1..0000000 Binary files a/images/joomla-source.png and /dev/null differ diff --git a/images/kohana application-config dir.png b/images/kohana application-config dir.png deleted file mode 100644 index ebb8cc0..0000000 Binary files a/images/kohana application-config dir.png and /dev/null differ diff --git a/images/kohana-files.png b/images/kohana-files.png deleted file mode 100644 index 691f21f..0000000 Binary files a/images/kohana-files.png and /dev/null differ diff --git a/images/kohana-homepage.png b/images/kohana-homepage.png deleted file mode 100644 index 352aadd..0000000 Binary files a/images/kohana-homepage.png and /dev/null differ diff --git a/images/kohana-success-output.png b/images/kohana-success-output.png deleted file mode 100644 index 81692ba..0000000 Binary files a/images/kohana-success-output.png and /dev/null differ diff --git a/images/misconfigured-database.png b/images/misconfigured-database.png deleted file mode 100644 index 9f4b7cb..0000000 Binary files a/images/misconfigured-database.png and /dev/null differ diff --git a/images/symfony1-source.png b/images/symfony1-source.png deleted file mode 100644 index 10e10ab..0000000 Binary files a/images/symfony1-source.png and /dev/null differ diff --git a/images/symfony1.4-homepage.png b/images/symfony1.4-homepage.png deleted file mode 100644 index 160ecd1..0000000 Binary files a/images/symfony1.4-homepage.png and /dev/null differ diff --git a/images/symfony1.png b/images/symfony1.png deleted file mode 100644 index b41ccba..0000000 Binary files a/images/symfony1.png and /dev/null differ diff --git a/images/yii-framework-logo.png b/images/yii-framework-logo.png deleted file mode 100644 index a62ad4d..0000000 Binary files a/images/yii-framework-logo.png and /dev/null differ diff --git a/images/yii-framework-running.png b/images/yii-framework-running.png deleted file mode 100644 index 5bb446c..0000000 Binary files a/images/yii-framework-running.png and /dev/null differ diff --git a/images/yii-framework-source.png b/images/yii-framework-source.png deleted file mode 100644 index e6484b6..0000000 Binary files a/images/yii-framework-source.png and /dev/null differ diff --git a/images/zf-deployed.png b/images/zf-deployed.png deleted file mode 100644 index 774b4fd..0000000 Binary files a/images/zf-deployed.png and /dev/null differ diff --git a/images/zf-source-files.png b/images/zf-source-files.png deleted file mode 100644 index a93f901..0000000 Binary files a/images/zf-source-files.png and /dev/null differ