I've been working with Bitbucket and Bitbucket Pipelines the last few weeks, and very soon started missing a tool to test and debug my builds, something similar to Jet for Codeship or CircleCI CLI. I ended up writing my own set of scripts, which I've cleaned up and published in Github and NPM.
$ npm install -g bbrun
bbrun can execute any step defined in your
pipelines: default: - step: name: hello image: ubuntu2 script: - echo "hello world!"
bbrun straight from your project path:
$ bbrun hello running "build" in "atlassian/default-image" image... hello world!
Usage $ bbrun <step> <options> Options --template (-t), pipeline template, defaults to "bitbucket-pipelines.yml" --env (-e), define environment variables for execution --dry-run (-d), performs dry run, printing the docker command --interactive (-i), starts an interactive bash session in the container --help, prints this very guide Examples: Execute all steps in the default pipeline from bitbucket-pipelines.yml $ bbrun $ bbrun --template bitbucket-template.yml $ bbrun --pipeline default Execute a single step by its name $ bbrun test $ bbrun "Integration Tests" Execute steps from different pipelines $ bbrun test --pipeline branches:master Define an environment variable $ bbrun test --env EDITOR=vim $ bbrun test --env "EDITOR=vim, USER=root"
There are still a few caveats, which will hopefully be resolved soon: