Skip to content

Commit

Permalink
chore: simplify APIX bundle deployment (#1194)
Browse files Browse the repository at this point in the history
- added `yarn deploy:apix`
  • Loading branch information
jkaster authored Oct 18, 2022
1 parent ba7ded8 commit 39dc3bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"dedupe:dev": "yarn-deduplicate -s fewer yarn.lock && yarn",
"dedupe:list": "yarn-deduplicate --list",
"dedupe:ci": "yarn-deduplicate -s fewer --fail --list yarn.lock",
"deploy:apix": "packages/extension-api-explorer/bin/deploy",
"dev:apix": "yarn workspace @looker/api-explorer develop",
"dev:hack": "yarn workspace @looker/hackathon develop",
"dev:xapix": "yarn workspace @looker/extension-api-explorer develop",
Expand Down
15 changes: 9 additions & 6 deletions packages/extension-api-explorer/bin/deploy
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,23 @@ else
commit_msg="$@"
fi

SRC=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd "${SRC}"/../../..
ROOT=$(pwd)

echo "Installing all package dependencies"
cd ../.. && yarn
yarn
echo "Rebuilding all packages"
yarn build


cd packages/extension-api-explorer
cd "${ROOT}"/packages/extension-api-explorer
echo "Removing existing bundle"
rm -rf dist/
echo "Creating extension-api-explorer production bundle"
yarn bundle
path_to_bundle=$(pwd)"/dist/bundle.js"
BUNDLE=$(pwd)"/dist/bundle.js"

cd ../../..
cd "${ROOT}"/..
if [ -d "extension-api-explorer" ]
then
cd extension-api-explorer && git branch --set-upstream-to=origin/main && git pull || exit 1
Expand All @@ -38,7 +41,7 @@ fi

echo "Copying extension bundle into repo"
git checkout main || { echo "Error checking out branch"; exit 1; }
cp ${path_to_bundle} .
cp "${BUNDLE}" .
echo "Pushing changes to remote"
git add bundle.js && git commit -m "${commit_msg}" && git push || { exit 1; }
echo "The extension's bundle commit hash is:"
Expand Down

0 comments on commit 39dc3bc

Please sign in to comment.