https://github.com/drone/go-convert
Package convert provides tools for converting pipeline configuration files to the Drone format.
https://github.com/drone/go-convert
Last synced: 5 months ago
JSON representation
Package convert provides tools for converting pipeline configuration files to the Drone format.
- Host: GitHub
- URL: https://github.com/drone/go-convert
- Owner: drone
- License: apache-2.0
- Created: 2023-03-02T21:34:29.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-12-18T08:30:27.000Z (7 months ago)
- Last Synced: 2025-12-21T15:57:10.661Z (7 months ago)
- Language: Go
- Size: 6.44 MB
- Stars: 14
- Watchers: 1
- Forks: 25
- Open Issues: 54
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Package convert provides tooling to convert third party pipeline configurations to the Harness pipeline configuration format.
__Sample Usage__
Sample code to convert a Bitbucket pipeline to a Harness pipeline:
```Go
import "github.com/drone/go-convert/convert/bitbucket"
```
```Go
converter := bitbucket.New(
bitbucket.WithDockerhub(c.dockerConn),
bitbucket.WithKubernetes(c.kubeConn, c.kubeName),
)
converted, err := converter.ConvertFile("bitbucket-pipelines.yml")
if err != nil {
log.Fatalln(err)
}
```
__Command Line__
This package provides command line tools for local development and debugging purposes. These command line tools are intentionally simple. For more robust command line tooling please use the [harness-convert](https://github.com/harness/harness-convert) project.
Compile the binary:
```
git clone https://github.com/drone/go-convert.git
cd go-convert
go build
```
__Bitbucket__
Convert a Bitbucket pipeline:
```
./go-convert bitbucket samples/bitbucket.yaml
```
Convert a Gitlab pipeline and print the before after:
```
./go-convert bitbucket --before-after samples/bitbucket.yaml
```
Convert a Bitbucket pipeline and downgrade to the Harness v0 format:
```
./go-convert bitbucket --downgrade samples/bitbucket.yaml
```
__Drone__
Convert a Drone pipeline:
```
./go-convert drone samples/drone.yaml
```
Convert a Drone pipeline and print the before after:
```
./go-convert drone --before-after samples/drone.yaml
```
Convert a Drone pipeline and downgrade to the Harness v0 format:
```
./go-convert drone --downgrade samples/drone.yaml
```
__Gitlab__
Convert a Gitlab pipeline:
```
./go-convert gitlab samples/gitlab.yaml
```
Convert a Gitlab pipeline and print the before after:
```
./go-convert gitlab --before-after samples/gitlab.yaml
```
Convert a Gitlab pipeline and downgrade to the Harness v0 format:
```
./go-convert gitlab --downgrade samples/gitlab.yaml
```
__Jenkins__
Convert a Jenkinsfile:
```
./go-convert jenkins --token= samples/Jenkinsfile
```
Convert a Jenkinsfile and downgrade to the Harness v0 format:
```
./go-convert jenkins --token= --downgrade samples/Jenkinsfile
```
__Syntax Highlighting__
The command line tools are compatble with [bat](https://github.com/sharkdp/bat) for syntax highlight.
```
./go-convert bitbucket --before-after samples/bitbucket.yaml | bat -l yaml
```