This question is in reference to Atlassian Documentation: Use Docker images as build environments in Bitbucket Pipelines
I have a pretty standard Dropwizard Java web application which depends on a PostgreSQL database. Our maven build runs it's tests by first spinning up a PostgreSQL docker container and then starting the Dropwizard application.
My instinct is to try to continue this approach by rolling a custom environment, but as the building and running of Docker images isn't currently supported (https://confluence.atlassian.com/bitbucket/limitations-of-bitbucket-pipelines-beta-827106051.html) and this must be a typical use case - what is the intended approach?
Funnily enough I'm in the exact same position with an internal project that also requires Postgres (and Postgres specifically) to run its tests.
Right now since you can't run Docker inside Pipelines yet (and therefor can't use docker-compose to pull in a db container), you could create a custom docker image that contains Postgres and use that in your bitbucket-pipelines.yml file:
Pipelines after all, is Docker based and you can provide your own image.
I think this will work - although that approach means it's not really any better than using Bamboo with Docker Agents. Moving to Bitbucket Pipelines is compelling as it's simpler & easier.
As hope it that I can replace my usage of Bamboo (which manages my build and deployment pipeline) with Pipelines, there is also the case to consider where you have a number of microservices, all of which I can spin up locally in Docker containers (the same as spinning up Postgres) for testing purposes - but this constraint means I can't replace my Bamboo integration tests (that I can also run locally simply with `mvn clean verify`).
Is this constraint likely to be permanent? Have I architected a problem for myself? Is there a more appropriate way that Bitbucket Pipelines is supposed to be used?
Here's a list of repositories containing Node.js and Ruby examples of pipelines using Docker images that have databases bundled. You'll also find some documentation on how to simply adapt the Dockerfile to change the Node or Ruby versions:
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.Read more
Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs