
A CLI Tool for Jenkinsfile to bitbucket-pipelines.yml
- Convert Jenkinsfile to bitbucket-pipelines.yml
jen2bit convert [Jenkinsfile] [options]
| option |
description |
default |
-o, --output <file> |
Output file path |
bitbucket-pipelines.yml |
-r, --runner <runners...> |
Runner labels added as runs-on in each step. Labels containing windows → Windows mode, otherwise Linux mode |
- |
-a, --all |
Merge all stages into a single step |
- |
# No runner specified (Linux mode, no runs-on)
jen2bit convert Jenkinsfile
# Linux self-hosted runner
jen2bit convert Jenkinsfile -r self.hosted linux
# Windows self-hosted runner
jen2bit convert Jenkinsfile -r self.hosted windows
# Merge all stages into a single step
jen2bit convert Jenkinsfile -a
# Combine with runner
jen2bit convert Jenkinsfile -a -r self.hosted linux
# Specify output file
jen2bit convert Jenkinsfile -o my-pipeline.yml
- Invert from bitbucket-pipelines.yml to Jenkinsfile
jen2bit invert [bitbucket-pipelines.yml] [options]
| option |
description |
default |
-o, --output <file> |
Output file path |
Jenkinsfile |
# Default (reads bitbucket-pipelines.yml, outputs Jenkinsfile)
jen2bit invert
# Specify input file
jen2bit invert my-pipeline.yml
# Specify output file
jen2bit invert bitbucket-pipelines.yml -o MyJenkinsfile
- major : Delete or Rename commands (Compatibility Ignored)
- minor : Add new commands
- patch : Edit commands
| package |
description |
commander |
CLI framework for parsing commands and options |
js-yaml |
YAML parser used to read bitbucket-pipelines.yml in the invert command |