Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

chore: update deploy script for working with local packages #245

Merged
merged 2 commits into from
Mar 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions scripts/fhir-works-deploy.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
#!/bin/bash -e

read -n 1 -p "This script adds local dependencies to your 'fhir-works-on-aws-deployment' package during build. It will then revert your 'package.json' to the last version of the package in Git. Have you committed the 'package.json' file in your 'fhir-works-on-aws-deployment' package to Git (y/n)?" answer
if [ $answer != "y" ]
then
printf "\nPlease commit the package.json file in your 'fhir-works-on-aws-deployment' package to Git"
exit
fi

packages=(
"fhir-works-on-aws-authz-rbac"
"fhir-works-on-aws-persistence-ddb"
Expand Down Expand Up @@ -36,19 +29,15 @@ done

printf "\nFor deployment package, remove old pregenerated files, add all other packages as dependencies, install all dependencies again"
cd fhir-works-on-aws-deployment
rm -rf node_modules build/* dist/*
rm -rf node_modules build/* dist/* .yalc
yalc add fhir-works-on-aws-interface
for i in "${packages[@]}"
do
yalc add $i
done
sed -i.bak 's#file:.yalc#./.yalc#g' package.json && rm package.json.bak
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method will allow the script to work on linux and macOS
https://stackoverflow.com/a/44864004/14310364

yarn install


printf "\nReverting package.json changes. Serverless pack does not play well with local dependencies added by yalc\n"

git checkout package.json

printf "\nYou can now go to your deployment package and deploy using serverless. You can deploy using the command 'serverless deploy --aws-profile <PROFILE> --stage <STAGE>'"
printf "\nYou can now go to your deployment package and deploy using serverless. You can deploy using the command 'serverless deploy --aws-profile <PROFILE> --stage <STAGE>'"

cd ..