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 variables to the project settings on drone.io:
    • QUANTUM_USER - your deployment user name
    • QUANTUM_PASSWORD

Basic Setup #

Add something like the following to your drone.yml:

---
kind: pipeline
name: test

steps:

  ...

  - name: Deploy
    image: r.planetary-quantum.com/quantum-public/cli:2
    environment:
      QUANTUM_USER:
        from_secret: QUANTUM_USER
      QUANTUM_PASSWORD:
        from_secret: QUANTUM_PASSWORD
    commands:
        - >
            quantum-cli stack update --create
            --endpoint your-cluster --stack your-cluster-your-stack            
    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/cli:2
    environment:
      QUANTUM_USER:
        from_secret: QUANTUM_USER
      QUANTUM_PASSWORD:
        from_secret: QUANTUM_PASSWORD
    commands:
        - >
            quantum-cli stack update --create
            --endpoint your-cluster --stack your-cluster-your-stack            
    when:
      event: tag
    depends_on:
      - Build and push Docker image