from Drone.io

Deployments with Drone.io #

Requirements #

  • You need to have a drone.io installation
  • You need to create a deploy user on our platform
  • Add the following private variable to the project settings on drone.io:
    • QUANTUM_API_KEY - your deployment api key

Basic Setup #

💡 New in Quantum-CLI v3: Use our drone plugin.
---
kind: pipeline
name: deploy

steps:
  - name: deploy
    image: r.planetary-quantum.com/quantum-public/drone-plugin:latest
    settings:
      key:
        from_secret: QUANTUM_API_KEY
      endpoint: MY_ENDPOINT
      stack: MY_STACK
      command: stack deploy

The plugin can be extended — feel free to get in touch to request additional features.

Manual #

Or continue to roll your own by using the following in your drone.yml:

---
kind: pipeline
name: test

steps:
  - name: Deploy
    image: r.planetary-quantum.com/quantum-public/cli:3
    environment:
      QUANTUM_ENDPOINT: your-cluster
      QUANTUM_STACK: your-stack
      QUANTUM_API_KEY:
        from_secret: QUANTUM_API_KEY
    commands:
        - stack deploy
    when:
      event: tag

Setup with custom Docker images #

If you need to build custom images, you’ll probably also need your private registry set up on Quantum.

Additionally to the above, add the registry user as private variables on the drone.io project:

  • REGISTRY_USER
  • REGISTRY_PASSWORD

In your .drone.yml, build and push the image, before using quantum-cli to deploy it, as above:

  - name: Build and push Docker image
    image: plugins/docker
    settings:
      username:
        from_secret: REGISTRY_USER
      password:
        from_secret: REGISTRY_PASSWORD
      registry: your-registry.example.com
      repo: your-registry.example.com/user/repo
      dockerfile: Some-Dockerfile
      tags:
        - latest
    when:
      event: tag

  - name: Deploy
    image: r.planetary-quantum.com/quantum-public/drone-plugin:latest
    settings:
      key:
        from_secret: QUANTUM_API_KEY
      endpoint: MY_ENDPOINT
      stack: MY_STACK
      command: stack deploy
    when:
      event: tag
    depends_on:
      - Build and push Docker image