Skip to content

Reliable builds and deploys #1840

@kasparsd

Description

@kasparsd

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/src directory.

  • Copy the .git directory from the root to /build/src/.git.

  • Checkout the required release branch such as develop or master. This ensures that we never accidentally deploy a feature brunch.

  • Install all dependencies via npm install and composer install --no-dev --optimize-autoloader.

  • Build assets npm run build and replace any version strings as necessary.

  • Copy the release files to /build/release and make sure to exclude node_modules and other development specific files. Maybe introduce .distignore that 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.

Metadata

Metadata

Assignees

Labels

InfrastructureChanges impacting testing infrastructure or build toolingP2Low priorityWS:CoreWork stream for Plugin core

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions