Skip to content

PMET-public/magento-cloud-extension

Repository files navigation

Installation (how to update below)

Quick Install Video

Magento Cloud Chrome Extension

https://github.com/PMET-public/magento-cloud-extension/releases

Details

To install the Magento Cloud Extension:

  1. Download the release zip file and unzip
  2. Chrome settings (⋮) → More Tools → Extensions
  3. Turn on "Developer Mode"
  4. Click "Load Unpacked"
  5. Select unzipped folder from step #1.

Incognito Access:

  1. Click "Details" for the extension
  2. Turn on "Allow in incognito"

To install the Magento Cloud CLI & setup ssh keys:

  1. Clicks the "Commands" tab in the extension
  2. Click "Prerequisites"
  3. Copy and paste those commands in your terminal
  4. Note that you may be asked to login once ~/.magento-cloud/bin/magento-cloud login

Done

Automatic Updates

  1. Quick the update link in the extension
  2. Paste the cmd copied to your clipboard in the terminal
  3. If you haven't previously, you may get a dialog to grant the terminal permission to access your Downloads folder in recent versions of OSX.

How to Manually Update - 1 min video (for older versions)

Quick Install Video

  1. Quick the update link in the extension
  2. Download & open zip file
  3. Chrome settings (⋮) → More Tools → Extensions
  4. Remove old extension
  5. Turn on "Developer Mode" (if not already on)
  6. Click "Load Unpacked"
  7. Select unzipped folder at Downloads > mcm-chrome-ext

Done

Recommended IDE & Extensions

IDE: VSC

IDE Extensions:

  1. Bash Debug
  2. BASH IDE
  3. Bats
  4. shellcheck

The included .vscode/launch.json has some useful debug scenarios pre-configured that you can use to step through.

Developer Setup

Currently tested & built on node 10.x

  1. clone, install dependencies, and build
git clone --recurse-submodules git@github.com:PMET-public/magento-cloud-extension.git
cd magento-cloud-extension
fnm use
npm i
./node_modules/gulp/bin/gulp.js -f gulpfile.mjs dev-build
  1. install extension as above

See the zip gulp task for packaging.

Publishing

When changes on a versioned branch are ready for release, tag that release with the version # locally and push the tag. GitHub UI currently no longer allows creating tags with the same name a branch.

git tag 0.0.38; git push origin refs/tags/0.0.38

Create a release from the GitHub releases page and upload the packaged zip and publish it. Finally, merge the branch into master (which will cause the master's manifest version to update and be detected by the chrome extensions).

Note: by using "versioned" branches, we can continue to update the scripts on that version without re-releasing the chrome extension for minor changes.

Troubleshooting

Besides the IDE tools listed above, you can set an environmental var debug=1 that invokes the set +x option which enables additional output.

Example: (Note the debug=1 directly preceding bash at the end.)

# example c&p cmd
curl -sS https://raw.githubusercontent.com/PMET-public/magento-cloud-extension/0.0.30/sh-scripts/{lib.sh,reindex.sh} | env ext_ver=0.0.30 tab_url=https://khb-del-me-vnrx66q-a6terwtbk67os.demo.magentosite.cloud debug=1 bash

# example output
+ set -e
+ red='\033[0;31m'
+ green='\033[0;32m'
+ yellow='\033[1;33m'
+ no_color='\033[0m'
+ input_src=/dev/tty
+ [[ -n '' ]]
+ cli_required_version=1.36.4
+ [[ /Users/kbentrup == \/\a\p\p ]]
+ cli_path=/Users/kbentrup/.magento-cloud/bin/magento-cloud
++ /Users/kbentrup/.magento-cloud/bin/magento-cloud --version
++ perl -pe 's/.*?([\d\.]+)/\1/'
+ cli_actual_version=1.36.4
+ [[ 1.36.4 != \1\.\3\6\.\4 ]]
....