-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OAuth で複数ワークスペースにインストールできるようにする #43
Comments
移行作業Firebase Functions の configClient ID と Client Secret を追加 $ firebase functions:config:set \
slack.client_id="012345678.1234567..." \
slack.client_secret="01234567890abcdef..." 適当な値の state secret を設定 $ firebase functions:config:set rota.state_secret="01234567890abcdef..." bot token を Function の config から削除 $ firebase functions:config:unset slack.bot_token 再デプロイ $ firebase deploy --only functions |
Firestore のマイグレーションRotation の新しいフィールド $ yarn global add fireway サービスアカウントとその鍵を作成して、ローカルの環境変数 $ export GOOGLE_APPLICATION_CREDENTIALS="/home/user/Downloads/service-account-file.json" マイグレーション処理を記述した module.exports.migrate = async ({ firestore }) => {
const rotationsRef = await firestore.collection("rotations").get();
await Promise.all(
rotationsRef.docs.map((doc) =>
doc.ref.update({ installationId: "T000000" })
)
);
}; dryrun。 $ fireway migrate --dryrun
Found 1 migration files
Making firestore read-only
Executing 1 migration files
Running v0.0.1__set-installationId.js
Updating rotations/1596764607560 {"installationId":"T000000"}
Updating rotations/1597627527824 {"installationId":"T000000"}
Updating rotations/1598233875660 {"installationId":"T000000"}
(略)
Updating rotations/1632881658931 {"installationId":"T000000"}
Uploading the results for v0.0.1__set-installationId.js
Setting fireway/0-0.0.1-set-installationId {"installed_rank":0,"description":"set-installationId","version":"0.0.1","script":"v0.0.1__set-installationId.js","type":"js","checksum":"0e6ebd4d4ba744f97acae0647fc8fa0e","installed_by":"mashabow","installed_on":"2021-10-04T15:57:33.722Z","execution_time":80,"success":true}
Finished all firestore migrations
Files scanned:1 executed:1
Docs added:0 created:0 updated:28 set:0 deleted:0 よさそうだったので実際に実行。 $ fireway migrate
Found 1 migration files
Executing 1 migration files
Running v0.0.1__set-installationId.js
Updating rotations/1596764607560 {"installationId":"T000000"}
Updating rotations/1597627527824 {"installationId":"T000000"}
Updating rotations/1598233875660 {"installationId":"T000000"}
(略)
Updating rotations/1632881658931 {"installationId":"T000000"}
Uploading the results for v0.0.1__set-installationId.js
Setting fireway/0-0.0.1-set-installationId {"installed_rank":0,"description":"set-installationId","version":"0.0.1","script":"v0.0.1__set-installationId.js","type":"js","checksum":"ac7633f1604ca3fc92a2f65b7987efe9","installed_by":"mashabow","installed_on":"2021-10-04T16:02:43.287Z","execution_time":247,"success":true}
Finished all firestore migrations
Files scanned:1 executed:1
Docs added:0 created:0 updated:28 set:0 deleted:0 |
ワークスペースへインストールUntitled.movちなみに、インストール直後はアプリのホーム画面が開く。 Firestore に 追記:bot token は暗号化して保存するようにした。#48 参照。 |
#46 で実装。
参考:
org-wide app installation はまだ有効化していない。enterprise grid について自分がよくわかっていない。
The text was updated successfully, but these errors were encountered: