Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Run Composer Install in specific directory using Pipelines

robabbott
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 2, 2018

I have a WordPress site where I'm trying to push out updated code via FTP using Pipelines, and then run "composer install" within the theme directory in order to install necessary dependencies.  I have a composer.json file within that theme directory that manages dependencies.

I'm wondering how I can tell Pipelines to run the install in the theme directory using that composer.json file?  Here is my current code:

image: php:7.2.3

pipelines:
default:
- step:
script:
- apt-get update && apt-get install -y unzip
- apt-get -qq install git-ftp
- git ftp push --user $FTP_USERNAME --passwd $FTP_PASSWORD server/path
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install

 

1 answer

0 votes
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 5, 2018

Hi Rob,

How have you set this up locally? You should be able to reuse your composer.json file if it works in a similar way locally. Or maybe there was some set up you did when you first installed composer on your machine that you need to redo in Pipelines.

Do you run into any specific errors that don't surface locally when you're trying to set this up in Pipelines?

You can also debug this inside of Docker (which will provide a near identical environment to Pipelines). This should make it possible for you to reproduce the issue locally and figure out a fix faster. Have a look here: https://confluence.atlassian.com/bitbucket/debug-your-pipelines-locally-with-docker-838273569.html

Thanks,

Phil

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events