Create A Staging Environment

post
Create A Staging Environment

https://api.releaseapp.io/api/apps/:app_id/environments/
Add creating a Release Staging Environment to your existing pipelines. By passing in the app you want to create the environment for and the Docker images to to use, you have full control over what is created. Additionally by adding a branch, you're able to continually update the same environment as you push code changes.A Build object will be created upon a successful request and the optional parameters help to fill in data that the Release build system returns. Without the optional data you may find it hard to determine what code is actually running on your environment.
Request
Response
Request
Path Parameters
app_id
optional
integer
Release App ID
Headers
X-Account-ID
required
integer
Account ID
X-Account-Token
required
string
Authentication token
Body Parameters
branch
required
string
Git branch name
services
required
object
Object in the form of {service_name: image_name}
commit_short
optional
string
Shortened version of a commit sha, usually seven characters
commit_long
optional
string
Full commit sha
committer
optional
string
Email of the person who created the commit
commit_message
optional
string
Message used for the commit
commit_date
optional
string
Time the commit happened at in the form "YYYY-MM-DD HH:MM:SS -0700". "-0700" is used as an example time zone offset.
logs
optional
array
Array of objects in the form of {level: "info" || "error", message: "message"}
Response
200: OK
Environment Successfully Created or Updated
{"message": "Successfully created|updated Environment"}
400: Bad Request
If a required parameter is missing, a Bad Request will be returned. The responses are: {"error": "app_id is a required parameter"}{"error": "branch is a required parameter"}{"error": "services is a required paramete"}
{"error": 'message'}
404: Not Found
If an App cannot be found with the given app_id, a Not Found will be returned. {"error": "Could not find app with id 0"}If a User cannot be found to authenticate either from the committer email or from the App's owner, a Not Found will be returned. {"error": "No user found"}
{"error": "message"}

The following is an example payload with images stored in ECR

{
"app_id": 1,
"branch": "auth_test",
"services": {
"web": "123.dkr.ecr.us-west-2.amazonaws.com/releaseappuser/test_repo/web:9106aa52e16981a062676f0f5cf7a0ce3ebf00c0",
"sidekiq": "123.dkr.ecr.us-west-2.amazonaws.com/releaseappuser/test_repo/sidekiq:9106aa52e16981a062676f0f5cf7a0ce3ebf00c0"
},
"committer": "[email protected]",
"commit_message": "testing_message",
"commit_date": "2020-04-10 13:27:16 -0700",
"commit_short": "9106aa5",
"commit_long": "9106aa52e16981a062676f0f5cf7a0ce3ebf00c0",
"logs": [{level: "info", message: "testing"}, {level: "info", message: "the api"}],
}