with quantum-cli

See what we're up to: Runway is here! 🚀

Deployments with quantum-cli #

Download the quantum-cli binary, or use the Docker image at r.planetary-quantum.com/quantum-public/cli:2.

For more about what quantum-cli can do, see this quick introduction.

Basic deployments #

In a directory with your docker-compose.yml, do

$ quantum-cli stack update --create \
    --user $USER --password $PASSWORD \
    --endpoint $YOUR_ENDPOINT --stack $YOUR_ENDPOINT-somestackname

Instead of using --user/--password, you can also

  • set QUANTUM_USER and QUANTUM_PASSWORD env variables
  • create a ~/.config/quantum/env file:
QUANTUM_USER=your-user-account
QUANTUM_PASSWORD=your-password

Custom Docker Images #

You can customize what quantum-cli does, by putting a .quantum file into your project directory. A basic one would look like this:

---
version: '1.0'
build: make build
publish: make docker-push
compose: docker-compose.local.yml
  • build: and publish: are commands that are executed before stack update and stack create. You can use them to build and publish docker images to your private registry.
Normally, one would use the `build` config in `docker-compose.yml` to achieve the same thing. Quantum currently doesn't support that, since we only upload the docker-compose file, not your complete local build context.
  • compose: just gives the name of the docker-compose file

Multiple environments #

The .quantum file optionally also supports multiple environments. The syntax for that is:

---
version: '1.0'
build: make build
publish: make docker-push
compose: docker-compose.yml

environments:
- name: staging
  compose: docker-compose.staging.yml
- name: production
  build: make prod-build
  compose: docker-compose.production.yml

You can then select which environment to use by adding e.g. --environment production to the quantum-cli stack update/create command.

Environments inherit all values from the main part of the .quantum file, and can optionally overwrite them.

There are no limits to how many environments you can add, and you can name them as you please.