DNA Basic Recipe metapackage
Includes a collection of useful modules, a starter theme, and the silverstripe recipe-cms
Silverstripe 4. See 3.0 branch for silverstripe 3 support.
NOTE: assumes you have node setup and gulp installed globally. If not, you should go do those things first
To start a project with this recipe use a terminal to run (replace
your-project with your project's name):
composer create-project dnadesign/basic-recipe ./your-project
- Copy a draft
.envfile in for you (you'll need to update this)
- Install the frontend dependencies & create the built theme in
composer install(because this task doubles as a quick setup for future devs on your project)
composer vendor-exposeto symlink assets into
- Run a
To add this recipe to an existing project:
composer require dnadesign/basic-recipe ./your-project
To move the cms recipe dependencies to your own composer file in order to modify them:
composer update-recipe silverstripe/recipe-cms
More information about recipes and how to work with them is available here: https://github.com/silverstripe/recipe-plugin
This code comes bundled with a makefile for quick access to common tasks. Run
make list or
make help to get a list of available options, or open the Makefile directly.
Theme-default is a starter theme, intended to be used as a base for development. See the theme README file for theme specific documentation
This recipe comes with setup for a deployment pipeline from CodeShip to Silverstripe Dashboards. There are commands in the MakeFile for this purpose.
If you don't intend to use this pipeline, feel free to remove these from the makefile. Note that by default we aren't committing built assets, so if you have a git based deployment pipeline, you might want to remove
- A Codeship account
- A SilverStripe Dashboard Project, and a Dashboard api key
- An amazon s3 bucket
Note: you can still use Codeship and not deploy to platform.
- Update the
pipeline_project_namein the MakeFile with the project name used in the Silverstripe Dashboard.
- Codeship: create a new project for this build, and set it up with your projects git details (Codeship supports GitHub, GitLab, and BitBucket repos)
Codeship > Your project > Project settings > Test
- Select your technology > select php
- Update the php version to support your project. eg:
phpenv local 7.2
- Adjust any other settings you might need (e.g. you can set memory limits with:
echo "memory_limit = 512M" >> $HOME/.phpenv/versions/7.2/etc/php.ini)
make pipeline_setuptestto set up an instance of your project for tests to run inside
- Create a test pipeline
- Call the
make testcommand to run all your project's tests
Configure your Codeship environment variables under
Project settings > Environment. You will need:
AWS_DEFAULT_REGION - from your s3 bucket account. e.g. ap-southeast-2
AWS_ACCESS_KEY_ID - from your s3 bucket account.
AWS_SECRET_ACCESS_KEY - from your s3 bucket account.
DASHBOARD_TOKEN - You can find this in your profile on the Silverstripe Dashboard
DASHBOARD_USER - this is the email address you use on the dashboard, and not your username
Note: The AWS connections might be adapted for deployments to other environments, if you aren't hosted on CWP, or the Silverstripe Platform.
Project settings > Deploy
- Add a new deployment pipeline, and choose a deployment branch
- Choose "Custom script"
make pipeline_deploy. This will prep the test build - removing unwanted files, create a tar file, and send it to a SilverStripe Dashboard for deployment.
You should now be able to push to your deployment branch to trigger a deploy