stacks
Update a stack's Git configs
Update the Git settings in a stack, e.g., RepositoryReferenceName and AutoUpdate. When SourceID is set, URL/auth/TLS are taken from the referenced Source. Access policy: authenticated
post/stacks/{id}/git
Path parameters
idinteger required
Stack identifier
Query parameters
endpointIdinteger
Stacks created before version 1.18.0 might not have an associated environment(endpoint) identifier. Use this optional parameter to set the environment(endpoint) identifier used by the stack.
Request body
Example request
{
"AutoUpdate": {
"Interval": "1m30s",
"JobID": "15",
"Webhook": "05de31a2-79fa-4644-9c12-faa67e5c49f0"
},
"Env": [
{
"name": "name",
"value": "value"
}
]
}Response
Success
Example response
{
"AutoUpdate": {
"Interval": "1m30s",
"JobID": "15",
"Webhook": "05de31a2-79fa-4644-9c12-faa67e5c49f0"
},
"CreatedBy": "admin",
"CreationDate": 1587399600,
"EndpointId": 1,
"EntryPoint": "docker-compose.yml",
"Env": [
{
"name": "name",
"value": "value"
}
],
"GitConfig": {
"ConfigFilePath": "docker-compose.yml",
"ConfigHash": "bc4c183d756879ea4d173315338110b31004b8e0",
"ReferenceName": "refs/heads/branch_name",
"URL": "https://github.com/portainer/portainer.git"
},
"Id": 1,
"Name": "myStack",
"Namespace": "default",
"ProjectPath": "/data/compose/myStack_jpofkc0i9uo9wtx1zesuk649w",
"ResourceControl": {
"AdministratorsOnly": true,
"Id": 1,
"Public": true,
"ResourceId": "617c5f22bb9b023d6daab7cba43a57576f83492867bc767d1c59416b065e5f08",
"SubResourceIds": [
"617c5f22bb9b023d6daab7cba43a57576f83492867bc767d1c59416b065e5f08"
]
},
"SwarmId": "jpofkc0i9uo9wtx1zesuk649w",
"UpdateDate": 1587399600,
"UpdatedBy": "bob"
}