erseco
(Ernesto Serrano)
2018 年 1 月 15 日午前 11:35
1
移行スクリプトを作成中で、s3_upload_bucket サイト設定をプログラムから設定したいと考えています。Docker インスタンス内で設定する方法は見つけました:
echo 'SiteSetting.s3_upload_bucket="mybucket"' | bundle exec rails c
ただし、| パイプが含まれているため、docker exec -it app <command> と連結するとエラーが発生します。
この問題を回避する方法はありますか?
よろしくお願いいたします。
pfaffman
(Jay Pfaffman)
2018 年 1 月 15 日午後 12:21
2
Just add that SiteSetting like to your importer. I’ve added similar code to disable outgoing mail to several importers. You can help grep the importer directory for "Site* for examples.
erseco
(Ernesto Serrano)
2018 年 1 月 15 日午後 1:38
3
I found the solution!
echo "SiteSetting.sso_url='newurl'" | docker exec -w /var/www/discourse -i app bundle exec rails c
pfaffman
(Jay Pfaffman)
2018 年 1 月 15 日午後 1:46
4
I’m not clear what kind of migration script you’re writing. I do then in ruby and it’s easy to change site settings there.
This is a great trick, though!