Skip to content

Conversation

@snim2
Copy link
Contributor

@snim2 snim2 commented Aug 6, 2025

Previously we deployed the same WP Core version on all environments. To descibe the version of Core that we wish to deploy we use a movable tag, which is usually the major version tag of the latest release, e.g. 'v6'.

However, this means that for patch and minor version updates, moving the movable tag will change deploys on both staging and production.

This commit changes that strategy, and if there is an no environment variable defined that looks like it describes a production environment, we try to deploy to a revision called 'latest' and then fall back to the revision from the JSON file if that does not exist.

Environment variables that might describe a production environment are:

  • 'WP_ENVIRONMENT_TYPE' - found in wp-config.php
  • 'WP_CONFIG_WP_ENVIRONMENT_TYPE' - specific to dxw

Resolves: https://...

  • Includes tests (if new features are introduced)
  • Commit message includes link to the ticket/issue
  • Changelog updated
  • PR open against dxw's Homebrew Tap to point the Whippet formula to the new version number

Previously we deployed the same WP Core version on all
environments. To descibe the version of Core that we
wish to deploy we use a movable tag, which is usually
the major version tag of the latest release, e.g. 'v6'.

However, this means that for patch and minor version
updates, moving the movable tag will change deploys
on both staging and production.

This commit changes that strategy, and if there is an
no environment variable defined that looks like it
describes a production environment, we try to deploy
to a revision called 'latest' and then fall back to
the revision from the JSON file if that does not exist.

Environment variables that might describe a production
environment are:

* 'WP_ENVIRONMENT_TYPE' - found in wp-config.php
* 'WP_CONFIG_WP_ENVIRONMENT_TYPE' - specific to dxw
$wp->clone_repo($this->application_config->wordpress->repository);
$wp->checkout($this->application_config->wordpress->revision);

if (getenv('WP_CONFIG_WP_ENVIRONMENT_TYPE') === false) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to tighten this up? e.g. if WP_CONFIG_WP_ENVIRONMENT_TYPE was set to production on a prod site, this would result in us deploying the latest version there (assuming the "latest" tag existed).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, forgot to rebase. I've pushed a fixup commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants