an introduction to atlassian bitbucket pipelines

30
Using Docker to improve your workflow An overview of Bitbucket Pipelines Twitter: @dkcwd

Upload: dave-clark

Post on 09-Jan-2017

257 views

Category:

Software


2 download

TRANSCRIPT

Using Docker to improve your workflowAn overview of Bitbucket Pipelines

Twitter: @dkcwd

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….

An overview of Bitbucket Pipelines

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

Enabling Pipelines for your repository

In the Settings area, you need to enable Pipelines…

Next, you need to configure your bitbucket-pipelines.yml

Configuring bitbucket-pipelines.yml

Choose a template to use with your build plan…

Previewing the template

Move on to the next step when you’re ready…

Previewing the template

Make a change if you want to then commit to create the file…

Previewing the template

An opportunity to update the message…

Previewing the templateThe first build begins…

And fails…

An email notification is sent about the failure…

The reason for failure is clear…

Ok, so let’s add some tests….

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

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

Let’s deliberately break it

Yay it’s broken!

\o/

And fix it again

Off Topic: Using Docker to make tools available

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/

Making it easy for a team to useThe 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?

A useful YouTube channel! \o/ Check out this link:

https://www.youtube.com/channel/UCnxrdFPXJMeHru_b4Q_vTPQ

Off Topic: Have you heard about BuzzConf?

An awesome technology festival! \o/

Check out this link:

https://buzzconf.io/go/dkcwd

Enjoy and share what you do….

I’m on Twitter: @dkcwdLinkedIn: https://au.linkedin.com/in/daveclarkprofile