go-convert

command module
v0.0.0-...-6bd371c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

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:

import "github.com/drone/go-convert/convert/bitbucket"
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 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=<chat-gpt-token> samples/Jenkinsfile

Convert a Jenkinsfile and downgrade to the Harness v0 format:

./go-convert jenkins --token=<chat-gpt-token> --downgrade samples/Jenkinsfile

Syntax Highlighting

The command line tools are compatble with bat for syntax highlight.

./go-convert bitbucket --before-after samples/bitbucket.yaml | bat -l yaml

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
convert
azure
Package azure converts Azure Devops pipelines to Harness pipelines.
Package azure converts Azure Devops pipelines to Harness pipelines.
circle
Package circle converts Circle pipelines to Harness pipelines.
Package circle converts Circle pipelines to Harness pipelines.
cloudbuild
Package cloudbuild converts Google Cloud Build pipelines to Harness pipelines.
Package cloudbuild converts Google Cloud Build pipelines to Harness pipelines.
cloudbuild/yaml
package yaml provides definitions for the Cloud Build schema.
package yaml provides definitions for the Cloud Build schema.
drone
Package drone converts Drone pipelines to Harness pipelines.
Package drone converts Drone pipelines to Harness pipelines.
drone/yaml
package yaml provides definitions for the Yaml schema.
package yaml provides definitions for the Yaml schema.
github
Package github converts GitHub pipelines to Harness pipelines.
Package github converts GitHub pipelines to Harness pipelines.
gitlab
Package gitlab converts Gitlab pipelines to Harness pipelines.
Package gitlab converts Gitlab pipelines to Harness pipelines.
jenkins
Package jenkins converts Jenkins pipelines to Harness pipelines.
Package jenkins converts Jenkins pipelines to Harness pipelines.
travis
Package travis converts Travis pipelines to Harness pipelines.
Package travis converts Travis pipelines to Harness pipelines.
slug
Package slug provides utilities for working with slug values.
Package slug provides utilities for working with slug values.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL