Version 1.0.0
Language EN

Migrating from 0.8

The goal of this article is to help you upgrade your yaml configuration from the 0.8 to the 1.0 configuration format. It is important to note you can use the 0.8 configuration format with 1.0.0. We have tried to make this version backward compatible to minimize disruption to existing teams and projects.

Pipelines

The pipeline configuration syntax has changed significantly in Drone 1.0.0. This syntax is inspired by kubernetes and should be familar to a large portion of the Drone community that has already adopted kubernetes.

Example 0.8 configuration:

pipeline:
  build:
    image: golang
    commands:
    - go build
    - go test

services:
  redis:
    image: redis:latest

Example 1.0 configuration:

kind: pipeline
name: default

steps:
- name: build
  image: golang
  commands:
  - go build
  - go test

services:
- name: redis
  image: redis:latest

If you want to learn more about the latest syntax, please see the pipeline configuration section of the documentation.

Plugins

The plugin configuration syntax has chanaged in this latest version. Plugin paramters are now defined in the settings block of the step. Over time plugin documentation will be adjusted to reflect this change.

Example 0.8 configuration:

pipeline:
  publish:
    image: plugins/docker
    repo: octocat/hello-world
    username: octocat
    password: correct-horse-battery-staple

Example 1.0 configuration:

kind: pipeline
name: default

steps:
- name: publish
  image: plugins/docker
  settings:
    repo: octocat/hello-world
    username: octocat
    password: correct-horse-battery-staple

Secrets

The secret syntax has been improved to be more explicity. Named secrets are passed to pipeline steps as environment variables using the following syntax:

kind: pipeline
name: default

steps:
- name: publish
  image: golang
  environment:
    GOOS: linux
    PASSWORD:
      from_secret: password

You can also source plugin configuration values from named secrets using similar syntax:

kind: pipeline
name: default

steps:
- name: publish
  image: plugins/docker
  settings:
    repo: octocat/hello-world
    username: octocat
    password: 
      from_secret: docker_password

Cloning

This latest version includes a new clone plugin with improved logic for cloning pull requests. To customize or replace the default clone plugin, please see the clone documentation.

kind: pipeline
name: default

clone:
  depth: true

steps:
- name: build
  image: golang
  commands:
  - go build
  - go test

Matrix

The matrix syntax has been deprecated in 1.0.0 in favor of a more powerful multi-machine pipeline configuration, however, is still possible to perform matrix testing.

Example matrix from 0.8

pipeline:
  build:
    image: golang:${golang}
    commands: [ go build, go test ]
matrix:
  golang: [ 1.0, 1.1 ]

Example matrix ported to 1.0.0

---
kind: pipeline
name: golang-1-0

steps:
- name: build
  image: golang:1.0
  commands:
  - go build
  - go test

---
kind: pipeline
name: golang-1-1

steps:
- name: build
  image: golang:1.1
  commands:
  - go build
  - go test

...

The above syntax can be quite verbose if you are testing a large number of variations. To simplify your configuration we recommend using jsonnet.

local Pipeline(version) = {
  kind: "pipeline",
  steps: [
    {
      name: "build",
      image: "golang:"+version,
      commands: [
        "go build",
        "go test",
      ]
    }
  ]
};

[
  Pipeline("1.0"),
  Pipeline("1,1")
]

On This Page:

Getting Help

Mailing List
Search for information in the mailing list archives, or post a question.
Chat Support
Real-time chat support from maintainers and community members.