テーマをプログラムでインストールする

If you want to install themes via your app.yml, use the following format:

run:
  - exec: echo "Beginning of custom commands"

  - file:
      path: /tmp/mythemes.yml
      contents: |
        discourse-gifs:
          url: https://github.com/discourse/discourse-gifs.git
          add_to_all_themes: true

  - exec:
      cd: $home
      cmd: su discourse -c 'bundle exec rake themes:install < /tmp/mythemes.yml'

  - exec: echo "End of custom commands"
「いいね!」 11

ああ、これが可能でとても嬉しいです…マルチサイトインスタンス全体でテーマを読み込む方法を探していましたが、これが最も簡単な方法かもしれません。ありがとうございます!

「いいね!」 2

ローカルデバイスからzipファイルでテーマをインポートするプログラムによる方法を探している人が他にいる場合:

export THEME_ARCHIVE=<abolute-path-to-file>
bundle exec rake themes:install:archive

または

THEME_ARCHIVE=<abolute-path-to-file> bundle exec rake themes:install:archive

が役立ちます。

「いいね!」 6

(tar.gzにも対応)

「いいね!」 2