Skip to content

Commit

Permalink
chore: update deployment script
Browse files Browse the repository at this point in the history
  • Loading branch information
facuspagnuolo committed May 13, 2024
1 parent b9312f2 commit f1fe05e
Showing 1 changed file with 15 additions and 21 deletions.
36 changes: 15 additions & 21 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,26 @@ set -o errexit
# Run graph build
yarn build:$NETWORK

# Studio deployments
platform_base=studio
platform_zkevm=studio

# Load platform
if [[ -z $PLATFORM ]]; then
PLATFORM_VAR=platform_$NETWORK
PLATFORM=${!PLATFORM_VAR}
# Check deployment version
if [[ -z $VERSION_LABEL ]]; then
echo 'Please make sure a version label is provided'
exit 1
fi

# Deploy subgraph
if [ "$PLATFORM" == "studio" ]; then
echo "Deploying $NETWORK to subgraph studio"
if [[ -z $VERSION_LABEL ]]; then
echo 'Please make sure a version label is provided'
exit 1
fi
yarn graph deploy mimic-v3-$NETWORK --studio --deploy-key $GRAPH_KEY -l $VERSION_LABEL
# Define subgraph name
if [[ "$NETWORK" = "base" || "$NETWORK" = "zkevm" ]]; then
NAME=mimic-v3-$NETWORK
else
echo "Deploying $NETWORK to hosted service"
yarn graph deploy mimic-fi/v3-$NETWORK --product hosted-service --deploy-key $GRAPH_KEY
NAME=v3-$NETWORK
fi

# Deploy subgraph
echo "Deploying $NAME to subgraph studio"
yarn graph deploy mimic-v3-$NETWORK --studio --deploy-key $GRAPH_KEY -l $VERSION_LABEL

# Check deployer status
if [ $? -ne 0 ]; then
echo "Error trying to deploy subgraph with exit status $?"
echo "$output"
exit $?
echo "Error trying to deploy subgraph with exit status $?"
echo "$output"
exit $?
fi

0 comments on commit f1fe05e

Please sign in to comment.