This document provides an overview of using Bitbucket Pipelines to build, test, and deploy projects from Bitbucket repositories. It discusses how Bitbucket Pipelines uses Docker containers to run build plans, benefits like faster feedback and reusable containers. It also covers enabling Pipelines for a repository, configuring the bitbucket-pipelines.yml file, and adding tests to a sample build plan by exporting Postman tests and adding a package.json file to run the tests during the build.
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
Improve workflow using Docker & Bitbucket Pipelines
1. Using Docker to improve your workflow
An overview of Bitbucket Pipelines
Twitter: @dkcwd
2. Reminder about this session
The slides will be made available after the session and you are more
than welcome to share them if you find them useful.
We have people attending from all manner of different backgrounds
with different levels of experience and you’re welcome to ask
questions and share knowledge after the session.
Let’s get started….
4. Build, test and deploy from Bitbucket
Bitbucket Pipelines uses Docker
containers to run build plans
Benefits:
- Potential for faster feedback
- Sensible default containers
- Can use your private containers
- Easy to set environment vars
5. Enabling Pipelines for your repository
In the Settings area, you need to enable Pipelines…
Next, you need to configure your bitbucket-pipelines.yml
14. Building on a basic example
Let’s build on that basic example by adding some tests to run using Pipelines
For an example I’ll reuse a simple API test collection which I previously created
with Postman when experimenting with serverless-graphql
I’ll export from Postman and commit:
- the request collection file, including pre-request scripts and tests
- an environment file which “should” mean the tests pass when they are run
15. Building on that basic example
Additionally I’ll need to do a few more things so the tests can run
I’ll create a package.json file defining newman (The CLI test runner for Postman)
as a dependency so it will be installed during the build process
I’ll update:
- the package.json file so tests can be run using npm to call newman
- the bitbucket-pipelines.yml file to run the relevant commands
20. Need to create your own image?
Check out this link:
https://answers.atlassian.com/questions/39140980/how-do-i-
create-a-docker-image-for-bitbucket-
pipelines?_ga=1.125432457.263526773.1473156356
21. Need to test with a database?
Check out this link:
https://confluence.atlassian.com/bitbucket/test-with-databases-
856697462.html
22. Need to use environment variables?
Check out this link:
https://confluence.atlassian.com/bitbucket/environment-variables-
in-bitbucket-pipelines-794502608.html
23. All of those questions are in the docs! o/
Check out this link:
https://confluence.atlassian.com/bitbucket/bitbucket-pipelines-
792496469.html
25. Example: SugarCRM XHProf viewer
The project is very useful for SugarCRM developers however some setup is
required to be able to make use of it.
Link: https://developer.sugarcrm.com/2016/09/05/sugar-xhprof-viewer-released-as-open-source-project/
26. Making it easy for a team to use
The project can be set up and “containerized” with a
volume made available for the files to be analyzed.
Benefits:
- Minimizes friction prior to using the tool
- Allows a simplified workflow for sharing
What tools will your team containerize?
What will the benefits be?
27. A useful YouTube channel! o/
Check out this link:
https://www.youtube.com/channel/UCnxrdFPXJMeHru_b4Q_vTPQ