Skip to content
This repository has been archived by the owner on Apr 8, 2021. It is now read-only.

A plugin for [Jenkins X](https://jenkins-x.io) to assist in converting from the legacy `Jenkinsfile`-based pipelines to the modern `jenkins-x.yml`-based pipelines

License

Notifications You must be signed in to change notification settings

jenkins-x/jx-convert-jenkinsfile

Repository files navigation

jx convert jenkinsfile

jx convert jenkinsfile is a plugin for Jenkins X to assist in converting from the legacy Jenkinsfile-based pipelines to the modern jenkins-x.yml-based pipelines. It will attempt to convert an existing Jenkinsfile into the equivalent jenkins-x.yml in the same directory, letting the user know if there are parts of the existing Jenkinsfile which cannot be converted.

Directives in the Jenkinsfile which cannot be automatically converted will be noted in the jenkins-x.yml with comments showing the Jenkinsfile snippet, and steps which cannot be converted will be noted with comments and replaced by echo ... && exit 1 in the actual pipeline execution.

If the Jenkinsfile contains code outside of the pipeline { ... } block, or unknown Declarative directives, jx convert jenkinsfile will exit with an error.

Installation

Download the jx-convert-jenkinsfile binary and place it in a directory in your PATH:

Linux

curl -L https://github.com/jenkins-x/jx-convert-jenkinsfile/releases/download/$(curl --silent https://api.github.com/repos/jenkins-x/jx-convert-jenkinsfile/releases/latest | jq -r '.tag_name')/jx-convert-jenkinsfile-linux-amd64.tar.gz | tar xzv 
sudo mv jx-convert-jenkinsfile /usr/local/bin

macOS

curl -L https://github.com/jenkins-x/jx-convert-jenkinsfile/releases/download/$(curl --silent https://api.github.com/repos/jenkins-x/jx-convert-jenkinsfile/releases/latest | jq -r '.tag_name')/jx-convert-jenkinsfile-darwin-amd64.tar.gz | tar xzv 
sudo mv jx-convert-jenkinsfile /usr/local/bin

You can now invoke the tool by running jx convert jenkinsfile.

Usage

Run jx convert jenkinsfile, optionally specifying --dir ... to look for the Jenkinsfile in a different directory than the current one.

Reporting issues

Please create an issue in the jx project with the area/jenkinsfile-converter label for any issues or feature requests for this tool.

About

A plugin for [Jenkins X](https://jenkins-x.io) to assist in converting from the legacy `Jenkinsfile`-based pipelines to the modern `jenkins-x.yml`-based pipelines

Resources

License

Stars

Watchers

Forks

Packages

No packages published