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

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

Using composer custom cache location in bitbucket pipeline

Edited

Hello,

  I am trying to cache my composer dependencies between builds.  From what I have seen, I am using a custom composer cache location since the image does not use the default `~/.composer/cache` location.  Upon running the following script, I see in the build teardown section of the Composer install section that a cache is indeed being created: "Assembling contents of new cache 'composer-custom'".  However, on subsequent runs of the build, it installs fresh composer dependencies and does not read from the cache. 

Since I can't quite seem to get the code snippet to look nicely in this textarea, here is a gist of my file.

2 answers

1 accepted

0 votes
Answer accepted

After discussion with support, running the composer install script:
```
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
```
on the image I was using: php:7.3-fpm, did in fact use the default composer cache location, `~/.composer/cache`.  By removing the custom-cache and using the default `caches: composer` option, I was able to get it to work.  There could have been other configuration issues that was causing it not to work previously.  Hope this helps

0 votes

Hi @Stetson Lewis  and welcome to the community.

It's a bit difficult to say why this is happening without checking the builds.

I would suggest opening a ticket with the support team and share the URL of a build where you see the cache being created, and of a subsequent one where it is not being used. The support ticket will be visible only to you, Atlassian staff, and any colleagues you may want to CC.

If there is an open ticket, the engineer working on your case will be able to access the builds and assist with this issue. You can open a ticket via https://support.atlassian.com/contact/#/, in "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as product.

If you have any questions, please feel free to let me know.

Kind regards,
Theodora

Hi Theodora, thank you for your response and suggestion.  I have went ahead and opened a ticket and will follow up here once there is a resolution.

Like Theodora Boudale likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence Cloud

🎨 Add some visual life to your templates

Hi Atlassian Community, My name is Avni Barman, and I am a Product Manager on the Confluence Cloud team. Based on feedback from you, we are giving admins more power to create templates that a...

129 views 1 4
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