Create a Build

Use this API call to create a new stack build.

Requires the stacks-builds-manage permission.

Returns

Returns a stack build resources, otherwise returns an Error.

Arguments
  • instructions
    object
    optional

    A set of instructions, including information about tags, commits, and the branch to use for the build. The default is to use the latest commit.

    Show child fields
  • about
    object
    optional

    Passing custom About information is a way that the developer can override the default version and description.

    Show child fields

POST /v1/stacks/5b9c2a77b6393d0001eb45fd/builds

Example Request
$ curl https://api.cycle.io/v1/stacks/5a98710df231a500017f9aa4/builds \
-H
"Authorization: Bearer API_KEY"
\
-H
"X-Hub-Id: HUB_ID"
\
-X POST
Example Response
{
"data": {
"id": "5d02f7e9b89494000108422a",
"stack_id": "5d02f7e44146380001ccc871",
"hub_id": "5a14ddd8b6393d0001976f44",
"about": {
"version": "1.0",
"description": "A redis applicaiton"
},
"instructions": {},
"spec": {
"version": "1.0",
"containers": {
"redis": {
"name": "redis",
"image": {
"name": "redis",
"origin": {
"type": "docker-hub",
"details": {
"target": "redis:latest"
}
}
},
"stateful": false,
"config": {
"network": {
"public": "disable",
"hostname": "redis",
"ports": [
"6379:6379"
]
},
"deploy": {
"instances": 1
},
"runtime": {
"environment_vars": {
"TEST_VAR": "test_vaar_one"
},
"privileged": false
}
},
"volumes": []
},
"web": {
"name": "web",
"image": {
"name": "node",
"origin": {
"type": "docker-file",
"details": {
"context_dir": "/",
"build_file": "/Dockerfile"
}
}
},
"stateful": false,
"config": {
"network": {
"public": "enable",
"hostname": "web",
"ports": [
"80:8081"
]
},
"deploy": {
"instances": 1
},
"runtime": {
"environment_vars": {
"TEST_VAR": "test_var"
},
"privileged": false
}
},
"volumes": []
}
},
"annotations": {}
},
"events": {
"created": "2019-06-14T01:27:05.486Z",
"updated": "0001-01-01T00:00:00Z",
"deleted": "0001-01-01T00:00:00Z"
},
"state": {
"changed": "2019-06-14T01:29:01.238Z",
"current": "live"
},
"meta": {
"containers_count": {
"state": {
"new": 0,
"starting": 0,
"running": 0,
"stopping": 0,
"stopped": 0,
"reimaging": 0,
"deleting": 0,
"deleted": 0
},
"total": 0,
"available": 0
}
}
}
}