-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: verify_amplify_backend_compatability
- Loading branch information
Showing
3 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: 0.2 | ||
env: | ||
shell: bash | ||
variables: | ||
NODE_OPTIONS: --max-old-space-size=8096 | ||
phases: | ||
build: | ||
commands: | ||
- source ./shared-scripts.sh && _verifyAmplifyBackendCompatability |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,6 +132,54 @@ function _lint { | |
loadCacheFromBuildJob | ||
chmod +x codebuild_specs/scripts/lint_pr.sh && ./codebuild_specs/scripts/lint_pr.sh | ||
} | ||
function _verifyAmplifyBackendCompatability { | ||
echo "Verify Amplify Backend Compatability" | ||
|
||
# Install NVM and set Node.js version | ||
echo "Installing NVM and setting Node.js version" | ||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash | ||
export NVM_DIR="$HOME/.nvm" | ||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" | ||
nvm install 18.16.0 | ||
nvm use 18.16.0 | ||
|
||
loadCacheFromBuildJob | ||
|
||
# Increase buffer size to avoid error when git operations return large response on CI | ||
git config http.version HTTP/1.1 | ||
git config http.postBuffer 157286400 | ||
|
||
git checkout -b _vab | ||
git symbolic-ref HEAD --short | ||
git rev-parse HEAD | ||
|
||
# Fetching git tags from upstream | ||
# For forked repo only | ||
# Can be removed when using team account | ||
echo "fetching tags" | ||
git fetch --tags https://github.com/aws-amplify/amplify-category-api | ||
# Create the folder to avoid failure when no packages are published due to no change detected | ||
rm -rf ../verdaccio-cache && mkdir ../verdaccio-cache | ||
|
||
git config user.email [email protected] | ||
git config user.name "Doesnt Matter" | ||
|
||
source ./shared-scripts.sh && _publishLocalWorkspace | ||
setNpmRegistryUrlToLocal | ||
npm config get registry | ||
|
||
cd .. | ||
git clone https://github.com/aws-amplify/amplify-backend.git | ||
cd amplify-backend | ||
npm update | ||
git diff package-lock.json | grep -e 'graphql-api-construct' -e 'data-construct' | ||
npm run build && npm run test | ||
|
||
cd $CODEBUILD_SRC_DIR | ||
unsetNpmRegistryUrl | ||
npm config get registry | ||
yarn verdaccio-stop | ||
} | ||
function _publishToLocalRegistry { | ||
echo "Publish To Local Registry" | ||
loadCacheFromBuildJob | ||
|