Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Best practice to run php tests on branches and docker build on tags

Andrei Dascalu March 18, 2020

Hello,

 

I have a PHP project (basic, with composer). I would like that when team members make a merge requests, there would be a pipeline that simply runs phpunit while on tags following a certain pattern there would be a docker build for an image that is then pushed.

 

Now the second part is already up and running, using 

image: atlassian/default-image:2
pipelines:
tags: v*:
- step:
services:
- docker
script:
- ... run docker build and push

So my question is:

is there a way to use another image for my purpose in the same pipeline file? From what I can see, I can't have two pipeline yml in the same project.

 

From what I gather, my next choice would be to run some docker commands against my own custom Docker image.

 

1 answer

0 votes
Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 13, 2020

@Andrei Dascalu you can'have two pipelines yaml, but you can write different steps.

For example, you want to execute dev-test step and generally it is executed step master-test.

 

Regarding this,

there would be a pipeline that simply runs phpunit while on tags following a certain pattern there would be a docker build for an image that is then pushed.


you can execute some steps you desire on tags also, not on branches only. Look at the doc how to configure pipeline code and use tags

https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events