Skip to content
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

Chore temp restore old plugin updater service #349

Merged
merged 3 commits into from
Feb 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
163 changes: 163 additions & 0 deletions .circleci/.circleci.yml
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: wpgraphql-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
Loading