2020-07-14 06:56:14 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [[ -d .vercel ]]; then
|
|
|
|
rm -r .vercel
|
|
|
|
fi
|
|
|
|
|
|
|
|
CONFIG_FILE=vercel.json
|
|
|
|
|
|
|
|
if [[ -n $CI_TAG ]]; then
|
|
|
|
PROJECT_NAME=docs-solana-com
|
|
|
|
else
|
|
|
|
eval "$(../ci/channel-info.sh)"
|
|
|
|
case $CHANNEL in
|
|
|
|
edge)
|
|
|
|
PROJECT_NAME=edge-docs-solana-com
|
|
|
|
;;
|
|
|
|
beta)
|
|
|
|
PROJECT_NAME=beta-docs-solana-com
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
PROJECT_NAME=docs
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
cat > "$CONFIG_FILE" <<EOF
|
|
|
|
{
|
|
|
|
"name": "$PROJECT_NAME",
|
2023-02-22 19:58:08 -08:00
|
|
|
"scope": "$VERCEL_SCOPE",
|
2020-11-03 12:53:17 -08:00
|
|
|
"redirects": [
|
2022-08-31 10:32:36 -07:00
|
|
|
{ "source": "/apps", "destination": "/developers" },
|
|
|
|
{ "source": "/developing/programming-model/overview", "destination": "/developers" },
|
2022-07-29 09:47:59 -07:00
|
|
|
{ "source": "/apps/backwards-compatibility", "destination": "/developing/backwards-compatibility" },
|
2021-03-10 15:02:26 -08:00
|
|
|
{ "source": "/apps/break", "destination": "/developing/on-chain-programs/examples" },
|
2022-07-29 09:47:59 -07:00
|
|
|
{ "source": "/apps/builtins", "destination": "/developing/runtime-facilities/programs" },
|
2021-03-10 15:02:26 -08:00
|
|
|
{ "source": "/apps/drones", "destination": "/developing/on-chain-programs/examples" },
|
|
|
|
{ "source": "/apps/hello-world", "destination": "/developing/on-chain-programs/examples" },
|
2020-11-19 13:34:21 -08:00
|
|
|
{ "source": "/apps/javascript-api", "destination": "/developing/clients/javascript-api" },
|
2023-02-08 18:40:05 -08:00
|
|
|
{ "source": "/apps/jsonrpc-api", "destination": "/api/http" },
|
|
|
|
{ "source": "/developing/clients/jsonrpc-api", "destination": "/api/http" },
|
2021-03-10 15:02:26 -08:00
|
|
|
{ "source": "/apps/programming-faq", "destination": "/developing/on-chain-programs/faq" },
|
2022-07-29 09:47:59 -07:00
|
|
|
{ "source": "/apps/rent", "destination": "/developing/programming-model/accounts#rent" },
|
|
|
|
{ "source": "/apps/sysvars", "destination": "/developing/runtime-facilities/sysvars" },
|
|
|
|
{ "source": "/apps/webwallet", "destination": "/wallet-guide" },
|
|
|
|
{ "source": "/implemented-proposals/cross-program-invocation", "destination": "/developing/programming-model/calling-between-programs" },
|
|
|
|
{ "source": "/implemented-proposals/program-derived-addresses", "destination": "/developing/programming-model/calling-between-programs#program-derived-addresses" },
|
|
|
|
{ "source": "/implemented-proposals/secp256k1_instruction", "destination": "/developing/runtime-facilities/programs#secp256k1-program" }
|
2020-11-03 12:53:17 -08:00
|
|
|
]
|
|
|
|
}
|
2020-07-14 06:56:14 -07:00
|
|
|
EOF
|
|
|
|
|
|
|
|
[[ -n $VERCEL_TOKEN ]] || {
|
|
|
|
echo "VERCEL_TOKEN is undefined. Needed for Vercel authentication."
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
vercel deploy . --local-config="$CONFIG_FILE" --confirm --token "$VERCEL_TOKEN" --prod
|