A bootstrap for quick development and deployment with Envoyer.io
-
Go through the basic setup of adding your server and repository to Envoyer. Choose "other" when asked for the type of application
-
Copy over the
.env
details into the "Manage Environment" of Envoyer -
Create a
storage
folder in your deployment directory (usually httpdocs) -
Copy over the storage directory of your project once to the newly created storage folder
If anyone has a better, automated solution to this, let me know! -
Add a linked folder in Envoyer with the following settings:
- Create Link At:
storage
- To Folder:
storage
- Create Link At:
-
Add the following deployment hooks
- Before Activate New Release
- Yarn
cd {{release}} yarn
- Gulp
cd {{release}} gulp --production
- After Activate New Release
- Clear cache
cd {{release}} php please clear:cache php please clear:stache php please clear:static
- Before Activate New Release
-
Point your website root to the
public
folder
- Running Statamic above webroot to prevent accidents
- A storage directory has been created in the root
- The site/content folder is now in storage/content
- The site/assets folder is now in storage/assets
- The site/users folder is nwo in storage/users
- Split the theme folder off and only make the compiled assets available
- This has the benefit of not having all your templates publicly accessible
- Moved the gulpfile to the root of the project for easier terminal access
- The node_modules will now be installed in the root of the project
- Added yarn for faster npm installs and dependency management
This allows for a deployment workflow where the storage
folder is symlinked between releases and changes that are made through the control panel are kept.
The following settings have been moved to the .env
file for configuration between dev/production
APP_ENV=dev
APP_DEBUG=true
APP_DEBUGBAR=false
APP_URL=http://statamic-boilerplate.dev
APP_KEY=SomeRandomStringWith32Characters
STACHE_UPDATE=true
STATIC_CACHE_ENABLED=false
STATIC_CACHE_TYPE=cache
STATIC_CACHE_LENGTH=86400
STATIC_CACHE_FILE_PATH=static
STATIC_CACHE_IGNORE_QUERY=true
These settings cannot be changed through the control panel. A .env.example
is included in the project to get you started.
90% Of sites that we build need the following Add-ons so they're included by default, these can be removed easily:
- Sitemap
- CookieConsent
Take a look at our repositories to see if we might have another addon that might be useful to you.