jen2bit
v0.2.5
Published
CLI tool to convert Jenkinsfile to Bitbucket Pipelines YAML
Downloads
204
Maintainers
Readme
1. What is jen2bit
A CLI Tool for Jenkinsfile to bitbucket-pipelines.yml
2. Install
npm install -g jen2bit3. Commands
convert
descriptions
- Convert Jenkinsfile to bitbucket-pipelines.yml
grammars
jen2bit convert [Jenkinsfile] [options]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 | - |
examples
# 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.ymloutput
bitbucket-pipelines.ymlinvert
descriptions
- Invert from bitbucket-pipelines.yml to Jenkinsfile
grammars
jen2bit invert [bitbucket-pipelines.yml] [options]options
| option | description | default |
|--------|-------------|---------|
| -o, --output <file> | Output file path | Jenkinsfile |
examples
# 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 MyJenkinsfileoutput
Jenkinsfile4. Versioning
major.minor.patch- major : Delete or Rename commands (Compatibility Ignored)
- minor : Add new commands
- patch : Edit commands
5. Dependencies
| package | description |
|---------|-------------|
| commander | CLI framework for parsing commands and options |
| js-yaml | YAML parser used to read bitbucket-pipelines.yml in the invert command |
