Skip to content

Commit f5f7e7e

Browse files
authored
Deploy to separate org-specific bots (#140)
1 parent 7ed33c0 commit f5f7e7e

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

scripts/deploy.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,17 @@
22

33
set -e
44

5+
orgs=(`echo $ORG_LIST`)
6+
team=$NOW_TEAM
7+
token=$NOW_TOKEN
8+
59
yarn global add now@11.0.6
6-
APP_URL=$(now --npm -t $NOW_TOKEN --public -e PRIVATE_KEY=@private-key -e APP_ID=@app-id -e BUILDKITE_TOKEN=@buildkite-token -e WEBHOOK_SECRET=@webhook-secret -e NODE_ENV="production")
7-
now scale $APP_URL sfo 1 --token=$NOW_TOKEN
8-
now alias set $APP_URL fusion-probot -t $NOW_TOKEN
9-
now rm probot-app-workflow --safe -t $NOW_TOKEN -y
10+
# we use private github apps for this bot, which can't be installed on
11+
# multiple orgs, so we need a separate deployment for each org
12+
for org in "${orgs[@]}"; do
13+
app_name="$org-bot"
14+
app_url=$(now --npm --name=$app_name -T $team -t $token --public -e PRIVATE_KEY="@probot-$org-private-key" -e APP_ID="@probot-$org-app-id" -e WEBHOOK_SECRET="@probot-$org-webhook-secret" -e BUILDKITE_TOKEN=@buildkite-token -e NODE_ENV="production")
15+
now scale $app_url sfo 1 -T $team --token=$token
16+
now alias set $app_url $app_name -T $team -t $token
17+
now rm $app_name --safe -T $team -t $token -y || true
18+
done

0 commit comments

Comments
 (0)