Skip to content

hnykda/drone-converter

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

Drone 0.8 -> 1.0 converter

This converts old 0.8 .drone.yml to a version 1.0 variant (or close to it).

According to this you should use drone convert. Unfortunately, that tool can't handle some of the yaml's features such as <<: *anchor or escaping in commands. This tool can be used as a complementary to the original one. I had to do some manual adjustments by hand anyway.

usage

Install deps by:

pip install ruamel.yaml

and then

python convert.py .drone.yml --output .drone-new.yaml

Help

$ python convert.py --help
usage: convert.py [-h] [--output OUTPUT] input

positional arguments:
  input            Input .drone.yaml file.

optional arguments:
  -h, --help       show this help message and exit
  --output OUTPUT  Output name for new drone. Default: .drone-new.yml

Notes

  • (todo) plugins are not converted correctly (keys should go under settings)
  • anchors of elements which get converted are lost
  • volumes are named by vol-{0..}. Rename to your liking.
  • after the conversion, it's recommended to run, run drone fmt and drone lint

About

Script converting old 0.8 pipeline to 1.0

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages