diff --git a/scripts/check-and-add-beta.sh b/scripts/check-and-add-beta.sh index e80176c81e..f426c0bb71 100755 --- a/scripts/check-and-add-beta.sh +++ b/scripts/check-and-add-beta.sh @@ -20,7 +20,7 @@ else # Create ed file echo "5i ## Beta -[This release is in beta. Click here to see changes since ${latestReleaseVersion}.](https://github.com/maghirardelli/service-workbench-on-aws-github-actions/compare/v${latestReleaseVersion}...mainline) +[This release is in beta. Click here to see changes since ${latestReleaseVersion}.](https://github.com/awslabs/service-workbench-on-aws/compare/v${latestReleaseVersion}...mainline) . w diff --git a/scripts/environment-deploy.sh b/scripts/environment-deploy.sh index 1f55ac2ff4..d89e3a6f22 100755 --- a/scripts/environment-deploy.sh +++ b/scripts/environment-deploy.sh @@ -6,53 +6,7 @@ pushd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null [[ $UTIL_SOURCED != yes && -f ./util.sh ]] && source ./util.sh popd > /dev/null -# Install -install_dependencies "$@" - -function disableStats { - COMPONENT_DIR=$1 - pushd "$SOLUTION_DIR/$COMPONENT_DIR" > /dev/null - # Disable serverless stats (only strictly needs to be done one time) - $EXEC sls slstats --disable -s "$STAGE" - popd > /dev/null -} - -function componentDeploy { - COMPONENT_DIR=$1 - COMPONENT_NAME=$2 - - pushd "$SOLUTION_DIR/$COMPONENT_DIR" > /dev/null - printf "\nDeploying component: %s ...\n\n" "$COMPONENT_NAME" - $EXEC sls deploy -s "$STAGE" - printf "\nDeployed component: %s successfully \n\n" "$COMPONENT_NAME" - popd > /dev/null -} - -function goComponentDeploy() { - COMPONENT_DIR=$1 - COMPONENT_NAME=$2 - - pushd "$SOLUTION_DIR/$COMPONENT_DIR" > /dev/null - printf "\nDeploying Go component: %s ...\n\n" "$COMPONENT_NAME" - $EXEC sls deploy-go -s "$STAGE" - printf "\nDeployed Go component: %s successfully \n\n" "$COMPONENT_NAME" - popd > /dev/null -} - -disableStats "infrastructure" -componentDeploy "infrastructure" "Infrastructure" -componentDeploy "backend" "Backend" -componentDeploy "edge-lambda" "Edge-Lambda" -componentDeploy "post-deployment" "Post-Deployment" -goComponentDeploy "environment-tools" "Environment-Tools" - -# We now need to invoke the post deployment lambda (we can do this locally) -#$EXEC sls invoke local -f postDeployment -s $STAGE -printf "\nInvoking post-deployment steps\n\n" -pushd "$SOLUTION_DIR/post-deployment" > /dev/null -$EXEC sls invoke -f postDeployment -l -s "$STAGE" -popd > /dev/null - +# Dynamically set versionNumber and versionDate # Get the first header (not Changelog) in CHANGELOG.md versionLine="$(cat CHANGELOG.md | grep -m 1 "[0-9]\+\.[0-9]\+\.[0-9]\+\|Beta")" @@ -69,7 +23,7 @@ else fi # Is there a stage.yml file? -FILE=main/config/settings/${STAGE}.yml +FILE="main/config/settings/$STAGE.yml" if [ -f "$FILE" ] then # Yes-->Is there a versionDate and versionNumber key? @@ -81,7 +35,7 @@ then if ([ "$oldVersionNumber" != "$versionNumber" ]) || ([ "$oldVersionDate" != "$versionDate" ]) then # Yes-->Replace new with old - sed -i -e "s/versionNumber: '$oldVersionNumber/versionNumber: '$versionNumber/" $FILE + sed -i -e "s/versionNumber: '$oldVersionNumber/versionNumber: '$versionNumber/" "$FILE" sed -i -e "s/versionDate: '$oldVersionDate/versionDate: '$versionDate/" $FILE fi else @@ -102,6 +56,53 @@ versionNumber: '${versionNumber}' versionDate: '${versionDate}'" >> "$FILE" fi +# Install +install_dependencies "$@" + +function disableStats { + COMPONENT_DIR=$1 + pushd "$SOLUTION_DIR/$COMPONENT_DIR" > /dev/null + # Disable serverless stats (only strictly needs to be done one time) + $EXEC sls slstats --disable -s "$STAGE" + popd > /dev/null +} + +function componentDeploy { + COMPONENT_DIR=$1 + COMPONENT_NAME=$2 + + pushd "$SOLUTION_DIR/$COMPONENT_DIR" > /dev/null + printf "\nDeploying component: %s ...\n\n" "$COMPONENT_NAME" + $EXEC sls deploy -s "$STAGE" + printf "\nDeployed component: %s successfully \n\n" "$COMPONENT_NAME" + popd > /dev/null +} + +function goComponentDeploy() { + COMPONENT_DIR=$1 + COMPONENT_NAME=$2 + + pushd "$SOLUTION_DIR/$COMPONENT_DIR" > /dev/null + printf "\nDeploying Go component: %s ...\n\n" "$COMPONENT_NAME" + $EXEC sls deploy-go -s "$STAGE" + printf "\nDeployed Go component: %s successfully \n\n" "$COMPONENT_NAME" + popd > /dev/null +} + +disableStats "infrastructure" +componentDeploy "infrastructure" "Infrastructure" +componentDeploy "backend" "Backend" +componentDeploy "edge-lambda" "Edge-Lambda" +componentDeploy "post-deployment" "Post-Deployment" +goComponentDeploy "environment-tools" "Environment-Tools" + +# We now need to invoke the post deployment lambda (we can do this locally) +#$EXEC sls invoke local -f postDeployment -s $STAGE +printf "\nInvoking post-deployment steps\n\n" +pushd "$SOLUTION_DIR/post-deployment" > /dev/null +$EXEC sls invoke -f postDeployment -l -s "$STAGE" +popd > /dev/null + # Deploy UI pushd "$SOLUTION_DIR/ui" > /dev/null