The Build Environment
The build environment is designed to match Laravel Forge's environment as much as possible.
The build container has several versions of PHP and NodeJS available. Here is what the build environment has installed:
The PHP version available is set by your
.chipperci.yml file, in the
environment: php: 8.2 # 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2
The following PHP versions are available for use:
The following modules are installed as reported by
- Zend OPcache
$PATH variable is set to include
./vendor/bin, so you can reference commands such as
phpunit without needing to write
There is no global
phpunitcommand installed. You are encouraged to use
phpunitincluded via your project's
You can run
composer version 1 and 2 in your pipeline. The default
composer command is version 2. The command
composer1 is available as well.
# Use composer version 1 composer1 install --no-interaction --prefer-dist --optimize-autoloader # Use composer version 2 with either of these composer install --no-interaction --prefer-dist --optimize-autoloader composer2 install --no-interaction --prefer-dist --optimize-autoloader
Alternatively, you can "update" the default version to another major version:
# "Update" composer to version 1 sudo composer self-update --1 composer --version # 1.x.x # Update composer to version 2 sudo composer self-update --2 composer --version # 2.x.x
The NodeJS version used in the container is set ahead of time within the project's
environment: node: 18
No global Node packages are installed other than
$PATHvariable is set to include
./node_modules/.bin, so you can reference NodeJS commands without using a relative path.
You can dynamically set which NodeJS version is used. This is useful if the build environment needs a newer minor point release, or if you need to use an older version of NodeJS.
To change node version, run the following in your build pipeline before running any node/npm commands:
# Example: Downgrade NodeJS to 14.16.0 source ~/.nvm/nvm.sh nvm install 14.16.0 nvm use 14.16.0 # Tell other pipeline steps to # use this version also nvm alias default 14.16.0
Browser testing is available for Dusk tests via the Chrome driver. More documentation on using Laravel Dusk available here.
The following basic utilities are available (although this is not an exhaustive list):
aws command line utility is not installed globally. The best way to install it is with the following:
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install
sudo command is available to use, in case you need to install other utilities or change configuration.
For example, certain customers from Down Under have needed to change locale settings to get the correct currency in PHP. If you need to do something like that, you may want to run the following (or similar):
echo "en_AU.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen \ && sudo locale-gen echo "LANG=\"en_AU.UTF-8\"" | sudo tee -a /etc/default/locale echo "LANG=\"en_AU.UTF-8\"" >> /home/chipper/.profile echo "LC_MONETARY=\"en_AU.UTF-8\"" >> /home/chipper/.profile source /home/chipper/.profile