-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate with wp-product-info for plugin updates #179
Merged
Merged
Changes from all commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
3173f28
test: confirm update callbacks are attached
mindctrl 2f40eb6
chore: Add updater functions
mindctrl e953566
chore: Add updater callbacks
mindctrl 5463dc5
chore: add convenience constants used by updater functionality
mindctrl c502398
chore: load updater files via require_once
mindctrl 07d61a7
chore: exclude VIP rule for wp_remote_get calls
mindctrl 87296e8
chore: coding standards
mindctrl 6a93b95
chore: add .zipignore
mindctrl 92946da
chore: add base CircleCI config.
mindctrl 209fe59
chore: Remove unused CircleCI config parts
mindctrl f7a320b
ci: Add GHA_* parameters to CircleCI config
mindctrl 171016b
chore: fix test that checks for active plugin count.
mindctrl 86532aa
chore: Add blakewilson/wp-enforce-semver dependency
mindctrl ab3b445
chore: Instantiate EnforceSemVer class
mindctrl 46fdd79
chore: Change support link to GitHub issues
mindctrl f29354a
ci: Add stub for wp-product-info.yml workflow
mindctrl 74c6230
chore: Tell SonarQube to ignore "useless instantiation".
mindctrl 9f39f13
chore: Remove NOSCAN directive in favor of phpcs:ignore.
mindctrl 03dd9e9
ci: Test temporarily removing conditions for deploy workflow
mindctrl dc037db
ci: download latest release zip
mindctrl 2d13641
ci: adjust unzip command
mindctrl 05d4e8a
ci: adjust unzip paths
mindctrl e7a601a
ci: adjust paths
mindctrl 2e57369
ci: debug
mindctrl 969b184
ci: add the dash :facepalm:
mindctrl 02defea
ci: mkdir build
mindctrl 90ea24a
ci: update persist path. Add temp debug info.
mindctrl f2dd398
ci: add temp debug to json job
mindctrl 0896ad7
ci: move zip to build dir for later deployment
mindctrl 8e6bfd8
ci: remove duplicate mkdir
mindctrl a6747a2
ci: temp remove branch rules on staging deploy
mindctrl ff7f79e
ci: temp debug post_zip job
mindctrl ae68f52
ci: adjust slug to match wp-product-info service route
mindctrl 680b10a
ci: add build version to zip file name when moving to build directory
mindctrl 5c64f60
chore: remove debug statements
mindctrl 2c9bd3d
chore: Rename main plugin file.
mindctrl 1aee962
test: load renamed plugin file when bootstrapping tests
mindctrl 075cf94
chore: update phpcs config to load renamed plugin file
mindctrl 5f21816
ci: restore conditional triggers in CircleCI workflow
mindctrl 831ae27
chore: Customize semver notice text.
mindctrl bb42c8b
test: confirm callback to customize semver notice text is attached.
mindctrl ed1598e
chore: remove .zipignore.
mindctrl 33c3d6e
chore: update plugin filename in versionPlugin.js
mindctrl 5829908
chore: update plugin directory name in _lib.sh
mindctrl b230797
chore: rename package name in composer.json
mindctrl dbc6071
chore: rename zip artifact in release workflow
mindctrl 4e94575
chore: update text domain in phpcs config
mindctrl f615be5
chore: update textdomain to wpgraphql-content-blocks
mindctrl c9afb25
chore: temp remove conditional triggers in CircleCI workflow
mindctrl af7bfb4
ci: restore conditionals in deploy workflow
mindctrl 45aea24
chore: add changeset
mindctrl dc8dd04
Revert plugin rename.
mindctrl 9c67f57
ci: update CircleCI config to run deploy jobs on tags
mindctrl d70b65d
chore: remove wp-product-info deploy workflow.
mindctrl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@wpengine/wp-graphql-content-blocks": minor | ||
--- | ||
|
||
Added support for automatic updates hosted from WP Engine infrastructure. Includes warnings when major versions with potential breaking changes are released. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
# Notes: | ||
# - Jobs initially start from /home/circleci/project | ||
# - Plugin located at /home/circleci/project/wp-graphql-content-blocks | ||
|
||
version: 2.1 | ||
|
||
orbs: | ||
php: circleci/[email protected] | ||
wp-product-orb: wpengine/[email protected] | ||
node: circleci/[email protected] | ||
|
||
jobs: | ||
plugin-unzip: | ||
executor: wp-product-orb/default | ||
environment: | ||
WPE_SESSION_DIR: ./.wpe | ||
parameters: | ||
slug: | ||
type: string | ||
filename: | ||
type: string | ||
steps: | ||
- attach_workspace: | ||
at: . | ||
- wp-product-orb/variable_load | ||
- run: | ||
name: "Unzip plugin files" | ||
command: | | ||
cd ~/project | ||
mkdir build | ||
curl -sL https://github.com/wpengine/wp-graphql-content-blocks/releases/latest/download/wp-graphql-content-blocks.zip > <<parameters.slug>>.zip | ||
unzip -o -d <<parameters.slug>> <<parameters.slug>>.zip | ||
ls -laR | ||
- wp-product-orb/get_version_from_php: | ||
filename: <<parameters.slug>>/<<parameters.filename>> | ||
return_var: BUILD_VERSION | ||
- wp-product-orb/variable: | ||
var: BUILD_VERSION | ||
value: $BUILD_VERSION | ||
- run: | ||
name: "Move zip file to build directory" | ||
command: | | ||
mv <<parameters.slug>>.zip build/<<parameters.slug>>.$BUILD_VERSION.zip | ||
- run: | ||
name: "DEBUG" | ||
command: | | ||
ls -laR | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- . | ||
|
||
plugin-build-json: | ||
executor: wp-product-orb/parser | ||
environment: | ||
WPE_SESSION_DIR: ./.wpe | ||
parameters: | ||
slug: | ||
type: string | ||
steps: | ||
- attach_workspace: | ||
at: . | ||
- run: | ||
command: | | ||
cd ~/project | ||
- wp-product-orb/variable_load | ||
- wp-product-orb/parse_wp_readme: | ||
infile: <<parameters.slug>>/readme.txt | ||
outfile: build/<<parameters.slug>>.$BUILD_VERSION.json | ||
- store_artifacts: | ||
path: build | ||
- run: | ||
name: "DEBUG" | ||
command: | | ||
pwd | ||
ls -laR | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- build | ||
|
||
plugin-deploy: | ||
executor: wp-product-orb/authenticate | ||
environment: | ||
WPE_SESSION_DIR: ./.wpe | ||
parameters: | ||
auth_url: | ||
type: string | ||
upload_url: | ||
type: string | ||
slug: | ||
type: string | ||
steps: | ||
- attach_workspace: | ||
at: . | ||
- wp-product-orb/variable_load | ||
- wp-product-orb/authenticate: | ||
user: WPE_LDAP_USER | ||
pass: WPE_LDAP_PASS | ||
url: <<parameters.auth_url>> | ||
- run: | ||
name: "DEBUG" | ||
command: | | ||
pwd | ||
ls -laR | ||
- wp-product-orb/post_zip: | ||
url: <<parameters.upload_url>>/<<parameters.slug>> | ||
zip: build/<<parameters.slug>>.$BUILD_VERSION.zip | ||
json: build/<<parameters.slug>>.$BUILD_VERSION.json | ||
version: $BUILD_VERSION | ||
|
||
workflows: | ||
deploy: | ||
jobs: | ||
- plugin-unzip: | ||
slug: wpgraphql-content-blocks | ||
filename: wp-graphql-content-blocks.php | ||
# Run this job when a tag is published. | ||
filters: | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /^v.*/ | ||
- plugin-build-json: | ||
slug: wpgraphql-content-blocks | ||
requires: | ||
- plugin-unzip | ||
# Run this job when a tag is published. | ||
filters: | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /^v.*/ | ||
- plugin-deploy: | ||
name: "plugin-deploy-staging" | ||
slug: wpgraphql-content-blocks | ||
requires: | ||
- plugin-unzip | ||
- plugin-build-json | ||
filters: | ||
branches: | ||
only: | ||
- main | ||
- canary | ||
tags: | ||
only: /^v.*/ | ||
context: wpe-ldap-creds | ||
auth_url: https://auth-staging.wpengine.io/v1/tokens | ||
upload_url: https://wp-product-info-staging.wpesvc.net/v1/plugins | ||
- plugin-deploy: | ||
name: "plugin-deploy-production" | ||
slug: wp-graphql-content-blocks | ||
requires: | ||
- "plugin-deploy-staging" | ||
filters: | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
# Run this job when a tag is published. | ||
only: /^v.*/ | ||
context: wpe-ldap-creds | ||
auth_url: https://auth.wpengine.io/v1/tokens | ||
upload_url: https://wp-product-info.wpesvc.net/v1/plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated all these to run directly in CircleCI when tags are created, instead of using the GHA to trigger Circle. I ran into some known bugs with the Circle trigger action. This also simplifies things.