-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdeploy-trigger
executable file
·36 lines (27 loc) · 1.01 KB
/
deploy-trigger
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
PACKAGE_JSON="package.json"
REACT_STABLE_VERSION="18.3.1"
NEXTJS_STABLE_VERSION="14.2.5"
REACT_BETA_VERSION="19.0.0-rc-19bd26be-20240815"
NEXTJS_BETA_VERSION="15.0.0-canary.116"
if [ -z "$ENV" ]; then
echo "Please set the ENV environment variable before running this script. Exiting now."
exit 1
fi
# Update versions using the sed command
sed -i '' -e 's/"next": ".*"/"next": "'$NEXTJS_STABLE_VERSION'"/' \
-e 's/"react": ".*"/"react": "'$REACT_STABLE_VERSION'"/'\
-e 's/"react-dom": ".*"/"react-dom": "'$REACT_STABLE_VERSION'"/'\
"$PACKAGE_JSON"
echo "Replacing package.json with stable version."
rm -rf node_modules
bun i
bunx trigger.dev@beta deploy --env $ENV
# Revert the changes to the package.json file
sed -i '' -e 's/"next": ".*"/"next": "'$NEXTJS_BETA_VERSION'"/' \
-e 's/"react": ".*"/"react": "'$REACT_BETA_VERSION'"/'\
-e 's/"react-dom": ".*"/"react-dom": "'$REACT_BETA_VERSION'"/'\
"$PACKAGE_JSON"
echo "Reverting package.json to beta version."
rm -rf node_modules
bun i