# Como instalar o componente de tema com app.yaml ou do dispositivo local?

**URL:** https://meta.discourse.org/t/how-to-install-theme-component-with-app-yaml-or-from-local-device/226093
**Category:** Support
**Created:** [Maio 4, 2022, 10:53am UTC](https://meta.discourse.org/t/how-to-install-theme-component-with-app-yaml-or-from-local-device/226093 "2022-05-04T10:53:16Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Yaoqi\_Yan](https://avatars.discourse-cdn.com/v4/letter/y/898d66/32.png) [@Yaoqi\_Yan](https://meta.discourse.org/u/Yaoqi_Yan)
#### Post date: [Maio 4, 2022, 10:53am UTC](https://meta.discourse.org/t/how-to-install-theme-component-with-app-yaml-or-from-local-device/226093/1 "2022-05-04T10:53:16Z")

</div>

Meu servidor discourse está em K8s.  
Posso instalar um componente de tema (por exemplo, discoTOC) com a configuração app.yaml abaixo? Se não, como instalar do meu dispositivo local? (o k8s não tem permissão para acessar o github).

```plaintext
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/xxx.git

```

---

<div class="post-metadata">

### Author: ![Yaoqi\_Yan](https://avatars.discourse-cdn.com/v4/letter/y/898d66/32.png) [@Yaoqi\_Yan](https://meta.discourse.org/u/Yaoqi_Yan)
#### Post date: [Maio 4, 2022, 11:07am UTC](https://meta.discourse.org/t/how-to-install-theme-component-with-app-yaml-or-from-local-device/226093/2 "2022-05-04T11:07:11Z")

</div>

Tentei instalar o discoTOC (baixado do github) do dispositivo local, mas recebi o erro abaixo

\u003e _Import Error: about.json does not exist, or is invalid. Are you sure this is a Discourse Theme?_

 ![Screen Shot 2022-05-04 at 7.04.05 PM](https://global.discourse-cdn.com/meta/original/4X/f/d/b/fdb22f3416af042843c4dda817cad3e8e5312337.png)

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [Maio 4, 2022, 1:28pm UTC](https://meta.discourse.org/t/how-to-install-theme-component-with-app-yaml-or-from-local-device/226093/3 "2022-05-04T13:28:32Z")

</div>

Tentei o mesmo em meu site de teste e funcionou para mim? Você pegou o arquivo certo?

[https://github.com/discourse/DiscoTOC](https://github.com/discourse/DiscoTOC)

 ![download do github](https://global.discourse-cdn.com/meta/original/4X/1/c/3/1c32659a389fb868b325f470ceddccb9e2666a26.png)

 ![discoTOC-main.zip](https://global.discourse-cdn.com/meta/original/4X/c/1/3/c1370ce7bc77932203909be6abc01fd75ad96c06.png)

---

<div class="post-metadata">

### Author: ![Yaoqi\_Yan](https://avatars.discourse-cdn.com/v4/letter/y/898d66/32.png) [@Yaoqi\_Yan](https://meta.discourse.org/u/Yaoqi_Yan)
#### Post date: [Maio 4, 2022, 1:50pm UTC](https://meta.discourse.org/t/how-to-install-theme-component-with-app-yaml-or-from-local-device/226093/4 "2022-05-04T13:50:35Z")

</div>

Obrigado pela sua resposta. Funciona.  
O ponto é usar o arquivo zip baixado do GitHub.  
Descompactar e recompactar o arquivo não funciona no MAC

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [Maio 4, 2022, 4:39pm UTC](https://meta.discourse.org/t/how-to-install-theme-component-with-app-yaml-or-from-local-device/226093/5 "2022-05-04T16:39:27Z")

</div>

> [@Yaoqi\_Yan](#):
>
> Posso instalar um componente de tema (por exemplo, discoTOC) com a configuração do app.yaml abaixo?

Temos um guia sobre isso, veja:

> [@Install a Theme programatically](https://meta.discourse.org/t/installing-a-theme-programatically/191843?u=falco):
>
> 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"

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [Maio 4, 2022, 4:46pm UTC](https://meta.discourse.org/t/how-to-install-theme-component-with-app-yaml-or-from-local-device/226093/6 "2022-05-04T16:46:22Z")

</div>

Isso funcionaria se você não puder acessar o GitHub?

---

<div class="post-metadata">

### Author: ![Yaoqi\_Yan](https://avatars.discourse-cdn.com/v4/letter/y/898d66/32.png) [@Yaoqi\_Yan](https://meta.discourse.org/u/Yaoqi_Yan)
#### Post date: [Maio 5, 2022, 3:58am UTC](https://meta.discourse.org/t/how-to-install-theme-component-with-app-yaml-or-from-local-device/226093/7 "2022-05-05T03:58:07Z")

</div>

Sim. A instalação local do dispositivo funciona.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [Junho 4, 2022, 3:58am UTC](https://meta.discourse.org/t/how-to-install-theme-component-with-app-yaml-or-from-local-device/226093/8 "2022-06-04T03:58:43Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
