Copy custom file in discourse container while build

AI-generated summary

Copy custom file in discourse container while build

Jishan_Ansari is trying to copy custom files into the Discourse container during build using app.yml. They have successfully run several exec commands to copy files but encounter an error when using the mv command.

merefield suggests looking at how other plugins handle this in their setup instructions.

Jishan_Ansari asks if there’s another way to achieve this, and pfaffman responds that the issue might be due to the file not being present or the destination not existing, and suggests checking the logs. pfaffman also recommends using a plugin to achieve this.

Jishan_Ansari reports that copying a Ruby script file is working, but customizing the Ruby code is resulting in a 502 Bad Gateway error.

any one help me
i make custom code add in app.yml

run:
  - exec: chmod -R 777 /var/www/discourse/customize
  - exec: chmod -R 777 /var/www/discourse/app/controllers/
  - exec: mkdir -p /var/www/discourse/controll
  - exec: chmod -R 777 /var/www/discourse/controll
  - exec: chown discourse:discourse /var/www/discourse/controll
  - exec: cp /var/www/discourse/customize/static_controller.rb /var/www/discourse/controll
  - exec: cp /var/www/discourse/customize/routes.rb /var/www/discourse/controll
  - exec: cp /var/www/discourse/customize/site_settings.yml /var/www/discourse/controll

run:
  - exec: echo "Copying file to /var/www/discourse/app/controller"
  - exec: chmod -R 777 /var/www/discourse/config

all things running successfully
but i use mv command its break the code

  - exec: mv /var/www/discourse/controll/routes.rb /var/www/discourse/config

Look at how Discourse Chatbot 🤖 or Discourse Frotz 🧙 do it in the setup instructions.

any another way

My best guess is that the file you’re trying to copy isn’t there or the destination doesn’t exist. The answer should be in the logs.

You should probably do whatever you’re trying to do in a plugin.

ruby script file copy done but main issue i customised ruby code than its give error 502 bad gateway