It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

I'd like to run Python and PHP in a Pipelines image. Is that possible? Edited

We're trying to setup a CI/CD pipeline from BitBucket to an AWS EC2 instance running CentOS7.  Our program is a PHP Laravel API, but the only integration examples we've been able to find are written in Python.  We'd like to run Python alongside or as a service to the Pipelines image, so we can leverage the integrations code distributed by BitBucket for AWS deployment.

1 answer

0 votes

Hey Daniel,

It sounds like your ultimate goal is just to deploy to EC2. The fact that you have to use python is a side effect of the fact that all the examples you've found are in python.

There are two main ways you can make this deployment easier. The first doesn't use any python and the second does.

You could use our new 'pipes' feature. Pipes are pluggable tasks you can inject into your pipelines to avoid complex scripts or repetition. To use a pipe all you need to do is call it within the script section of your bitbucket-pipelines.yml. The documentation for doing this can be found here https://confluence.atlassian.com/bitbucket/pipes-958765631.html.

By using an EC2 deployment pipe you could avoid having to interact with the python code. An EC2 pipe already exists and can be found here https://bitbucket.org/atlassian/aws-code-deploy/src/master/README.md. This way you can build your application using php and just pass in the path to the code you want to deploy.

The other option is to use different steps with different images, one php step to build the code and another python step to deploy the code. By using different images for the different steps you can isolate which tools are needed for each operation.

To do this define separate steps for building and deploying the code (https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html#Configurebitbucket-pipelines.yml-ci_stepstep). Have the first step export the code you want to deploy as an artifact (https://confluence.atlassian.com/bitbucket/using-artifacts-in-steps-935389074.html) and the add the deployment code to the second step.

If you have any questions let me know.

Cheers,
Tom.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,031 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you