如何使用cloudcontrol

1. 首先安装git,不用装乌龟。

2. 然后配置git的username和email,global方面的。

3. 生成ssh可以

4. 在github上注册一个账户,邮件用配置git的邮件,然后把ssh.pub的内容添加到账户的ssh key 中

5. 测试一下是否成功

6. 在cloudcontrol中注册一个账户,邮件用你配置git的邮件

7. 在cloudcontrol中添加ssh key

8. 用git测试clone cloudcontrol的实例代码,如下

然后添加一个php的应用程序,名称为locationmonitor

网站会给一个实例,如下

To show how easy it is to extend an app with Add-ons let's add a free shared MySQL database. To access the database we need to read the credentials from the deployment's private JSON file.

# read the credentials file
$string = file_get_contents($_ENV['CRED_FILE'], false);
if ($string == false) {
    die('FATAL: Could not read credentials file');
}

# the file contains a JSON string, decode it and return an associative array
$creds = json_decode($string, true);

# use credentials to set the configuration for MySQL
$config = array(
  'MYSQL_HOSTNAME' => $creds['MYSQLS']['MYSQLS_HOSTNAME'],
  'MYSQL_DATABASE' => $creds['MYSQLS']['MYSQLS_DATABASE'],
  'MYSQL_USERNAME' => $creds['MYSQLS']['MYSQLS_USERNAME'],
  'MYSQL_PASSWORD' => $creds['MYSQLS']['MYSQLS_PASSWORD']
);

The tutorial app we cloned from Github is already prepared. You can see the full example of this code in the _config.php file. For now go ahead and add the Add-on.

进入到下一步

1. Push the code

$ cd cctrl_tutorial_app
$ git remote add cctrl ssh://locationmonitor@cloudcontrolled.com/repository.git
$ git push cctrl master

2. Deploy the app

After you pushed your code, let's deploy it.


照着做一遍,结果如下:



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值