From bbadbf674acf191290edb1b02ff073da163b6516 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Thu, 11 Jul 2019 12:05:20 +0100 Subject: [PATCH] Update build scripts to include vendor directory --- plugins/woocommerce-blocks/bin/build-plugin-zip.sh | 1 + plugins/woocommerce-blocks/bin/github-deploy.sh | 7 ++++++- plugins/woocommerce-blocks/bin/wordpress-deploy.sh | 5 +++++ plugins/woocommerce-blocks/package.json | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/plugins/woocommerce-blocks/bin/build-plugin-zip.sh b/plugins/woocommerce-blocks/bin/build-plugin-zip.sh index 29ae04bc7f5..476193e9c53 100755 --- a/plugins/woocommerce-blocks/bin/build-plugin-zip.sh +++ b/plugins/woocommerce-blocks/bin/build-plugin-zip.sh @@ -77,6 +77,7 @@ fi # Run the build. status "Installing dependencies... 📦" +composer install --no-dev PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm install status "===========================" npm list webpack diff --git a/plugins/woocommerce-blocks/bin/github-deploy.sh b/plugins/woocommerce-blocks/bin/github-deploy.sh index fafc9670033..3dc755f6777 100644 --- a/plugins/woocommerce-blocks/bin/github-deploy.sh +++ b/plugins/woocommerce-blocks/bin/github-deploy.sh @@ -53,7 +53,7 @@ echo "Before proceeding:" echo " • Ensure you have checked out the branch you wish to release" echo " • Ensure you have committed/pushed all local changes" echo " • Did you remember to update versions, changelogs, and stable tags in the readme and plugin files?" -echo " • If you are running this script directory instead of via '$ npm run deploy', ensure you have built assets." +echo " • If you are running this script directory instead of via '$ npm run deploy', ensure you have built assets and installed composer in --no-dev mode." echo output 3 "Do you want to continue? [y/N]: " read -r PROCEED @@ -102,6 +102,11 @@ git add build/. --force git add . git commit -m "Adding /build directory to release" +# Force add vendor directory and commit. +git add vendor/. --force +git add . +git commit -m "Adding /vendor directory to release" + # Push branch upstream git push origin $BRANCH diff --git a/plugins/woocommerce-blocks/bin/wordpress-deploy.sh b/plugins/woocommerce-blocks/bin/wordpress-deploy.sh index 781defc526b..c4eddf23ef4 100644 --- a/plugins/woocommerce-blocks/bin/wordpress-deploy.sh +++ b/plugins/woocommerce-blocks/bin/wordpress-deploy.sh @@ -137,6 +137,11 @@ if [ ! -d "$GIT_PATH/build" ]; then exit 1 fi +if [ ! -d "$GIT_PATH/vendor" ]; then + output 3 "Vendor directory not found in tag. Aborting." + exit 1 +fi + # Checkout SVN repository if not exists if [ ! -d "$SVN_PATH" ]; then output 2 "No SVN directory found, fetching files..." diff --git a/plugins/woocommerce-blocks/package.json b/plugins/woocommerce-blocks/package.json index 5cb58f18709..4ce1a2f558c 100644 --- a/plugins/woocommerce-blocks/package.json +++ b/plugins/woocommerce-blocks/package.json @@ -16,7 +16,7 @@ }, "license": "GPL-3.0+", "scripts": { - "deploy": "npm run build --loglevel error && sh ./bin/github-deploy.sh", + "deploy": "composer install --no-dev && npm run build --loglevel error && sh ./bin/github-deploy.sh", "release": "sh ./bin/wordpress-deploy.sh", "prepack": "npm install && npm run lint && npm run test && npm run build", "build": "cross-env BABEL_ENV=default NODE_ENV=production webpack",