Skip to content

Commit

Permalink
chore: install and use nvm
Browse files Browse the repository at this point in the history
  • Loading branch information
phani-srikar committed Sep 17, 2024
1 parent d9f127b commit 89702f4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/amplify-data-construct/.jsii
Original file line number Diff line number Diff line change
Expand Up @@ -4027,5 +4027,5 @@
},
"types": {},
"version": "1.10.1",
"fingerprint": "81nZ0YKg8Kuycn9Ui4woozV7lwHHvUUdFvd4O3KTz7o="
"fingerprint": "/SMB2Lkwd6A1xECqmjCm9stGEZyFZY3jS+8OCiIxypI="
}
2 changes: 1 addition & 1 deletion packages/amplify-graphql-api-construct/.jsii
Original file line number Diff line number Diff line change
Expand Up @@ -8944,5 +8944,5 @@
}
},
"version": "1.13.0",
"fingerprint": "HGa6D4aDfvLBiiR3WW3yS3JZ900W0ZAPO8pqOSoy/k4="
"fingerprint": "R5vukYdRYxs19GKFj1aCuAX2QPZw3a2VEs2GtlFfy+w="
}
23 changes: 23 additions & 0 deletions shared-scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,29 @@ function _setShell {
echo "Setting Shell"
yarn config set script-shell $(which bash)
}

function _installNVM {
echo "Installing latest version of NVM"
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"
}

function _installNode {
nodeVersion=$1
if [ -z "$nodeVersion" ]; then
echo "Node version is not provided"
exit 1
fi
echo "Installing $nodeVersion version of nodejs"
nvm install $nodeVersion
nvm use $nodeVersion
}

function _buildLinux {
_setShell
_installNVM
_installNode 18
echo "Linux Build"
node --version
yarn run production-build
Expand All @@ -92,6 +113,8 @@ function _buildLinux {
# used when build is not necessary for codebuild project
function _installLinux {
_setShell
_installNVM
_installNode 18
echo "Linux Install"
yarn run production-install
storeCacheForBuildJob
Expand Down

0 comments on commit 89702f4

Please sign in to comment.