Sage 9 is the latest and greatest from Roots, but the build process is much more complicated than Sage 8 (i.e. gulp --production
and profit). The following took me quite a bit of time to figure out, but is probably not comprehensive. Please comment if you need clarity. I hope it saves you some time!
Deploybot allows you to create your own containers. Go to Settings > Containers > Create a container. Based off the Ubuntu 16.04 container add the following build commands and save as Sage 9
:
# Update PHP
add-apt-repository ppa:ondrej/php
apt-get update
apt-get install -y php7.1 php7.1-common php7.1-mbstring php7.1-xml gcc g++ make nodejs
a2enmod php7.1
# Install Composer
apt-get install -y composer
composer install
# Update npm
npm install npm@latest -g
# Install Yarn + Composer
npm install --global yarn webpack
Now go to the server settings for your deployment. The following are the settings for each section that needs to configured.
- Select
Sage 9
from the dropdown for your container. - Add the following command:
yarn build:production
- You need to make sure composer is installed on your server – Sage 9 depends on it. In Debian/Ubuntu you can run
apt-get install composer
to install. - Add the following command:
composer install
.cache-loader
.git
node_modules
composer.lock
yarn.lock
composer.json
package-lock.json
package.json
LICENSE.md
.eslintrc.js
phpcs.xml
.editorconfig
.gitignore
In Cached build commands add the following command: yarn
Save the changes and deploy.