Example for creating a swarm stack with method 'file' in bash (curl)?

Hi,

is there anyone out who can give me a short example how to create a new swarm stack with method ‘file’ via bash (curl)?
I couldn’t find any examples yet :frowning:

What I want to do within an already existing CI/CD-Pipeline:

  • my pipeline is creating a docker-compose.yml from a template (because I need dynamic docker images) => already WORKS
  • the docker-compose.yml only exists temporarily while the pipeline is running => already WORKS
  • creating a new stack on a given endpoint basing on the temporary docker-compose.yml with curl ???

I’ve already used the API for deploying stacks from a repo hosted docker-compose.yml file. So I know how to use curl for getting the Bearer-Token, ClusterID, etc. but I’m missing the link who to use a local docker-compose.yml… :frowning:

Thanks in advance,
Michael