I have learned that I can use artifacts in order to persist specific directories for the following steps, however what if I want to install system dependencies and application dependencies in two different steps?
Example:
# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: php:7-fpm
pipelines:
branches:
'{staging,develop,master}':
- step:
name: Install system dependencies
script:
- apt-get update && apt-get install -qy zip unzip git curl libmcrypt-dev mysql-client
- yes | pecl install mcrypt-1.0.1
- docker-php-ext-install pdo_mysql
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- step:
name: Install application dependencies
caches:
- composer
script:
- composer install
- ln -s .env.pipelines .env
- export CACHE_DRIVER=array
- export DB_CONNECTION=sqlite
- export QUEUE_DRIVER=array
- php artisan jwt:secret
- step:
name: Test Suite
script:
- ln -s .env.pipelines .env
- export CACHE_DRIVER=array
- export DB_CONNECTION=sqlite
- export QUEUE_DRIVER=array
- php artisan jwt:secret
- php artisan serve &
- sleep 5
- ./vendor/bin/phpunit
- curl -vk http://localhost:8000
However, once I reach the install application dependencies step, it says that composer does not exist.