Skip to content
This repository has been archived by the owner on Sep 23, 2019. It is now read-only.

MirosTruckstop/mt-wp-photo-analysis-plugin

Repository files navigation

MT WordPress Photo Analysis Plugin

Build Status

Setup

Requirements

  1. Create a service account with the required role

    gcloud iam service-accounts create mt-website --display-name "mt-website"
    id="mt-website@${GCP_PROJECT}.iam.gserviceaccount.com"
    gcloud iam service-accounts add-iam-policy-binding "${id}" \
        --member="serviceAccount:${id}" \
        --role="roles/pubsub.publisher"
  2. Create a key for that service account

    gcloud iam service-accounts keys create keyfile.json --iam-account="${id}"
  3. Set the content of the keyfile.json as constant GCP_APPLICATION_KEY in the wp-config.php file

    define('GCP_APPLICATION_KEY', '{
        "type": "service_account",
        [...]
    }');
  4. Set the JWT used by the cloud function in the wp-config.php file

    define('GCP_JWT', 'JWT-HERE');

Development

Requirements

  • PHP and Composer (dependency manager for PHP) are installed

Steps

  1. Install the requirements: composer install

Sync required files

rsync -r --relative *.php src vendor/autoload.php vendor/composer <host>:<wordpress-dir>/wp-content/plugins/mt-wp-photo-analysis/

Releases

No releases published

Packages

No packages published

Languages