-
Notifications
You must be signed in to change notification settings - Fork 382
Description
Currently the build process defined in Gruntfile.js relies on an unknown state of the checked out repository -- For example, it uses existing dependencies in /vendor and /node_modules directories without installing them according to the rules in the lock files.
For reliable and reproducible builds we need to isolate any local overrides and always start from a known state. I suggest to update the deploy process to the following steps:
-
Create an empty
/build/srcdirectory. -
Copy the
.gitdirectory from the root to/build/src/.git. -
Checkout the required release branch such as
developormaster. This ensures that we never accidentally deploy a feature brunch. -
Install all dependencies via
npm installandcomposer install --no-dev --optimize-autoloader. -
Build assets
npm run buildand replace any version strings as necessary. -
Copy the release files to
/build/releaseand make sure to excludenode_modulesand other development specific files. Maybe introduce.distignorethat defines all files and directories that shouldn't be part of the final release. Maybe use parse-gitignore to generate the exclude list. -
Now deploy the /build/release to WP plugin SVN or create a release zip file.
All of these steps can be made cross-platform, too.