From fefe9c86fc277b486ed8006faeb437566a15fbba 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 --- bin/build-plugin-zip.sh | 1 + bin/github-deploy.sh | 7 ++++++- bin/wordpress-deploy.sh | 5 +++++ package.json | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/bin/build-plugin-zip.sh b/bin/build-plugin-zip.sh index 29ae04bc7f5..476193e9c53 100755 --- a/bin/build-plugin-zip.sh +++ b/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/bin/github-deploy.sh b/bin/github-deploy.sh index fafc9670033..3dc755f6777 100644 --- a/bin/github-deploy.sh +++ b/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/bin/wordpress-deploy.sh b/bin/wordpress-deploy.sh index 781defc526b..c4eddf23ef4 100644 --- a/bin/wordpress-deploy.sh +++ b/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/package.json b/package.json index c9178a20d0b..ee76bd07dce 100644 --- a/package.json +++ b/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",