Copy custom file in discourse container while build

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

  - 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

  - 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 🤖 (Now smarter than ChatGPT!*) or Discourse Frotz - an Interactive Fiction game bot 🧙 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.

1 Like

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