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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Caching beginner need some help Edited

I am new to caching topics, but I need to do something here and I thought maybe u can help me out with some things :)

My bitbucket-pipeline.yml:

definitions:
steps:
- step: &Codestyle-step
name: Codestyle
size: 2x
caches:
- composer
- docker
script:
- login
- docker-compose build php
- docker-compose run --rm -w /var/www/html php composer install --no-interaction --no-progress
- docker run --network=betafashion --rm -e "COMPOSER_ALLOW_SUPERUSER=1" -e "ENABLE_XDEBUG=1" --env-file=repo/.env-test -v "`pwd`/repo:/var/www/html" --memory=2G quay.io/betafashion/runtime-php composer check-code-style
services:
- docker
- step: &Test-step
name: Test
size: 2x
script:
- login
- docker-compose up -d database
- docker-compose build php
- docker-compose run --rm -w /var/www/html php composer install --no-interaction --no-progress
- docker run --network=betafashion --rm -e "COMPOSER_ALLOW_SUPERUSER=1" -e "ENABLE_XDEBUG=1" --env-file=repo/.env-test -v "`pwd`/repo:/var/www/html" --memory=2G quay.io/betafashion/runtime-php composer run-tests
services:
- docker
services:
docker:
memory: 4096

image:
name: quay.io/betafashion/ci-eb:latest
username: $DOCKER_USER
password: $DOCKER_PASSWORD

pipelines:
pull-requests:
'**':
- parallel:
- step: *Codestyle-step
- step: *Test-step

As u see on every commit in a pull-reguest code-style-checks and tests will run in parallel.
Both using kind of the same environment (just tests needs a database to run integration tests).
I see some potential to cache things here, but don't have a clue to do it.
1. both steps (Test & Codestyle) are building the "php" container and

2. doing "composer install". composer install in both cases will install all vendors. It is also important, because github has a limitation of how many things you can clone from their.

I think all of this can be cached if nothing changed (so no vendors or in the php container).
Can u help out with that or isn't it so easy like in my imagination :)?


Kind regards,

Martin

1 answer

+1 👍🏻

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,225 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