目录

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.

关于
115.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号