The release model is associate with the Release Server model, which allows you to deploy your code via FTP or SFTP to your web server.
Optional GET parameters:
GET /api/releases.json
Click to expand…
json http-response[
{
"release": {
"state": "success",
"id": 183,
"auto": true,
"updated_at": "2013/01/19 00:18:18 +0800",
"skipped": false,
"revision": "2",
"comment": "test",
"author": "railsmonk",
"environment_name": "Dreams",
"user_id": 6,
"retried_at": null,
"account_id": 4,
"environment_revision": null,
"environment_branch_name":null,
"deploy_from_scratch": false,
"repository_id": 67,
"environment_id": 32,
"do_not_notify": false,
"deployed": true,
"created_at": "2013/01/17 05:04:08 +0800",
"retries": 0,
"deployed_at": "2013/01/17 05:04:35 +0800"
}
}
]
GET /api/releases.xml
Click to expand…
xml http-response<?xml version="1.0" encoding="UTF-8"?>
<releases type="array">
<release>
<id type="integer">183</id>
<account-id type="integer">4</account-id>
<repository-id type="integer">67</repository-id>
<user-id type="integer">6</user-id>
<environment-id type="integer">32</environment-id>
<environment-revision nil="true"/>
<revision>2</revision>
<comment>test</comment>
<author>railsmonk</author>
<deployed-at type="datetime">2013-01-21T16:54:18-05:00</deployed-at>
<created-at type="datetime">2013-01-21T16:53:29-05:00</created-at>
<updated-at type="datetime">2013-01-21T16:54:18-05:00</updated-at>
<retried-at nil="true"/>
<retries type="integer">0</retries>
<state>success</state>
<deploy-from-scratch type="boolean">false</deploy-from-scratch>
<do-not-notify type="boolean">false</do-not-notify>
<auto type="boolean">true</auto>
<environment-name>Dreams</environment-name>
<environment-branch-name nil="true"></environment-branch-name>
<deployed type="boolean">true</deployed>
<bypassed type="boolean">false</bypassed>
</release>
</releases>
Optional GET parameters:
GET /api/{REPOSITORY_ID}/releases.json
Click to expand…
json http-response[
{
"release": {
"state": "success",
"id": 183,
"auto": true,
"updated_at": "2013/01/19 00:18:18 +0800",
"skipped": false,
"revision": "2",
"comment": "test",
"author": "railsmonk",
"environment_name": "Dreams",
"user_id": 6,
"retried_at": null,
"account_id": 4,
"environment_revision": null,
"environment_branch_name":null,
"deploy_from_scratch": false,
"repository_id": 67,
"environment_id": 32,
"do_not_notify": false,
"deployed": true,
"created_at": "2013/01/17 05:04:08 +0800",
"retries": 0,
"deployed_at": "2013/01/17 05:04:35 +0800"
}
}
]
GET /api/{REPOSITORY_ID}/releases.xml
Click to expand…
xml http-response<?xml version="1.0" encoding="UTF-8"?>
<releases type="array">
<release>
<id type="integer">183</id>
<account-id type="integer">4</account-id>
<repository-id type="integer">67</repository-id>
<user-id type="integer">6</user-id>
<environment-id type="integer">32</environment-id>
<environment-revision nil="true"/>
<revision>2</revision>
<comment>test</comment>
<author>railsmonk</author>
<deployed-at type="datetime">2013-01-21T16:54:18-05:00</deployed-at>
<created-at type="datetime">2013-01-21T16:53:29-05:00</created-at>
<updated-at type="datetime">2013-01-21T16:54:18-05:00</updated-at>
<retried-at nil="true"/>
<retries type="integer">0</retries>
<state>success</state>
<deploy-from-scratch type="boolean">false</deploy-from-scratch>
<do-not-notify type="boolean">false</do-not-notify>
<auto type="boolean">true</auto>
<environment-name>Dreams</environment-name>
<environment-branch-name nil="true"></environment-branch-name>
<deployed type="boolean">true</deployed>
<bypassed type="boolean">false</bypassed>
</release>
<release>
<id type="integer">184</id>
<account-id type="integer">4</account-id>
<repository-id type="integer">67</repository-id>
<user-id type="integer">6</user-id>
<environment-id type="integer">32</environment-id>
<environment-revision nil="true"/>
<revision>2</revision>
<comment>test</comment>
<author>railsmonk</author>
<deployed-at type="datetime">2013-01-21T16:54:18-05:00</deployed-at>
<created-at type="datetime">2013-01-21T16:53:29-05:00</created-at>
<updated-at type="datetime">2013-01-21T16:54:18-05:00</updated-at>
<retried-at nil="true"/>
<retries type="integer">0</retries>
<state>success</state>
<deploy-from-scratch type="boolean">false</deploy-from-scratch>
<do-not-notify type="boolean">false</do-not-notify>
<auto type="boolean">true</auto>
<environment-name>Dreams</environment-name>
<environment-branch-name nil="true"></environment-branch-name>
<deployed type="boolean">true</deployed>
<bypassed type="boolean">false</bypassed>
</release>
</releases>
GET /api/{REPOSITORY_ID}/releases/{RELEASE_ID}.json
Click to expand…
json http-response{
"release": {
"state": "success",
"id": 183,
"auto": true,
"updated_at": "2013/01/19 00:18:18 +0800",
"skipped": false,
"revision": "2",
"comment": "test",
"author": "railsmonk",
"environment_name": "Dreams",
"user_id": 6,
"retried_at": null,
"account_id": 4,
"environment_revision": null,
"environment_branch_name":null,
"deploy_from_scratch": false,
"repository_id": 67,
"environment_id": 32,
"do_not_notify": false,
"deployed": true,
"created_at": "2013/01/17 05:04:08 +0800",
"retries": 0,
"deployed_at": "2013/01/17 05:04:35 +0800"
}
}
GET /api/{REPOSITORY_ID}/releases/{RELEASE_ID}.xml
Click to expand…
xml http-response<?xml version="1.0" encoding="UTF-8"?>
<release>
<id type="integer">183</id>
<account-id type="integer">4</account-id>
<repository-id type="integer">67</repository-id>
<user-id type="integer">6</user-id>
<environment-id type="integer">32</environment-id>
<environment-revision nil="true"/>
<environment-branch-name nil="true"/>
<revision>2</revision>
<comment>test</comment>
<author>railsmonk</author>
<deployed-at type="datetime">2013-01-21T16:54:18-05:00</deployed-at>
<created-at type="datetime">2013-01-21T16:53:29-05:00</created-at>
<updated-at type="datetime">2013-01-21T16:54:18-05:00</updated-at>
<retried-at nil="true"/>
<retries type="integer">0</retries>
<state>success</state>
<deploy-from-scratch type="boolean">false</deploy-from-scratch>
<do-not-notify type="boolean">false</do-not-notify>
<auto type="boolean">true</auto>
<environment-name>Dreams</environment-name>
<deployed type="boolean">true</deployed>
<bypassed type="boolean">false</bypassed>
</release>
Creating a release means requesting a deployment. If you already have some releases in state “new” or “retry”, Beanstalk will delete them after creating a new one.
See the list of writable attributes at the top of the page.
POST /api/{REPOSITORY_ID}/releases.json?environment_id={SERVER_ENVIRONMENT_ID}
{
"release": {
"comment": "Deployment description or commit message.",
"revision": "a77a6bafd54c947c029b90d983e987ff4923b110"
}
}
Click to expand…
json http-response{
"release": {
"state": "new",
"id": 183,
"auto": false,
"updated_at": "2013/01/19 00:18:18 +0800",
"skipped": false,
"revision": "a77a6bafd54c947c029b90d983e987ff4923b110",
"comment": "Deployment description or commit message.",
"author": "railsmonk",
"environment_name": "Dreams",
"user_id": 6,
"retried_at": null,
"account_id": 4,
"environment_revision": null,
"environment_branch_name": "master",
"deploy_from_scratch": false,
"repository_id": 67,
"environment_id": 32,
"do_not_notify": false,
"deployed": false,
"created_at": "2013/01/17 05:04:08 +0800",
"retries": 0,
"deployed_at": null
}
}
--OR IF INVALID--
{
"errors": ["Error message"]
}
POST /api/{REPOSITORY_ID}/releases.xml?environment_id={SERVER_ENVIRONMENT_ID}
<release>
<revision type="integer">1</revision>
</release>
Click to expand…
xml http-response<?xml version="1.0" encoding="UTF-8"?>
<release>
<id type="integer">183</id>
<account-id type="integer">4</account-id>
<repository-id type="integer">67</repository-id>
<user-id type="integer">6</user-id>
<environment-id type="integer">32</environment-id>
<environment-revision nil="true"/>
<environment-branch-name>master</environment-branch-name>
<revision>a77a6bafd54c947c029b90d983e987ff4923b110</revision>
<comment>Deployment description or commit message.</comment>
<author>railsmonk</author>
<deployed-at nil="true"></deployed-at>
<created-at type="datetime">2013-01-21T16:53:29-05:00</created-at>
<updated-at type="datetime">2013-01-21T16:54:18-05:00</updated-at>
<retried-at nil="true"/>
<retries type="integer">0</retries>
<state>success</state>
<deploy-from-scratch type="boolean">false</deploy-from-scratch>
<do-not-notify type="boolean">false</do-not-notify>
<auto type="boolean">false</auto>
<environment-name>Dreams</environment-name>
<deployed type="boolean">false</deployed>
<bypassed type="boolean">false</bypassed>
</release>
--OR IF INVALID--
<?xml version="1.0" encoding="UTF-8"?>
<errors>
<error>Server can't be blank</error>
</errors>
Use this method to retry a failed deployment.
PUT /api/{REPOSITORY_ID}/releases/{RELEASE_ID}/retry.json
Click to expand…
json http-responseHEAD 200 OK
--OR IF INVALID--
HEAD 422
PUT /api/{REPOSITORY_ID}/releases/{RELEASE_ID}/retry.xml
Click to expand…
xml http-responseHEAD 200 OK
--OR IF INVALID--
HEAD 422