# Updating docker-compose.yml via API

**URL:** <https://forums.suse.com/t/updating-docker-compose-yml-via-api/6997>\
**Category:** General\
**Created:** [August 1, 2017, 3:45pm UTC](https://forums.suse.com/t/updating-docker-compose-yml-via-api/6997 "2017-08-01T15:45:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Peacock](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/andrew_peacock/32/3724_2.png) [@Andrew\_Peacock](https://forums.suse.com/u/Andrew_Peacock)\
**Post date:** [August 1, 2017, 3:45pm UTC](https://forums.suse.com/t/updating-docker-compose-yml-via-api/6997/1 "2017-08-01T15:45:50Z")

</div>

Hi,

I’m trying to use the API to integrate into by CI process to update the docker-compose (and possibly rancher-compose) files as part of the deployment.

As a test, I’m taking a simple test stack, and trying to add new environment variables, and update an existing one.

The initial docker-compose.yml is

```
version: '2'
services:
  Alpine:
    image: alpine
    environment:
      SHOW: 'false'
    stdin_open: true
    tty: true
    labels:
      io.rancher.container.pull_image: always

```

I’m submitting this via the API:

```
version: '2'
services:
  Alpine:
    image: alpine
    stdin_open: true
    tty: true
    labels:
    - io.rancher.container.pull_image: always
    environment:
    - RACK_ENV=development
    - SHOW=true
    - SESSION_SECRET=123 

```

And I seem to get a valid response: a dump of the stack resource.

However, the environment variables aren’t being updated.

Any thoughts on what I’m doing wrong?

Regards,  
Andy

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [August 2, 2017, 10:51am UTC](https://forums.suse.com/t/updating-docker-compose-yml-via-api/6997/2 "2017-08-02T10:51:34Z")

</div>

You need to call the upgrade action, there are fields for the compose files but updating then does not trigger anything to happen

---

<div class="post-metadata">

**Author:** ![Andrew\_Peacock](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/andrew_peacock/32/3724_2.png) [@Andrew\_Peacock](https://forums.suse.com/u/Andrew_Peacock)\
**Post date:** [August 2, 2017, 11:36am UTC](https://forums.suse.com/t/updating-docker-compose-yml-via-api/6997/3 "2017-08-02T11:36:05Z")

</div>

Hi Vincent,  
Thanks for getting back to me.

I think I already am calling upgrade:

http://\<rancher\_URL\>/v2-beta/stacks/?action=upgrade

Is that what you meant?

Regards  
Andy
