Custom code run after app building in app.yml file

Hi @Discourse
Can I run a custom code in the app.yml file when rebuilding the app??

Any custom commands to run after building

run:

  • exec:
    cd: /var/discourse
    cmd:
    - /var/discourse/rebuild/apply.sh

Apply.sh file content:-

docker cp ./rebuild/static_controller.rb app:/var/www/discourse/app/controllers/static_controller.rb

docker cp ./rebuild/routes.rb app:/var/www/discourse/config/routes.rb

docker cp ./rebuild/site_settings.yml app:/var/www/discourse/config/site_settings.yml

./launcher restart app

Are you sure you want to overwrite those files wholesale rather than modify them?

1 Like

yes @Stephen, I am sure to rewrite these files

I also run the patch command after rebuilding the app then they copy the file to docker images

/rebuild/apply.sh

But I am curious to execute custom code in the app.yml file

I think that will do what you want.

You’d be better off solving your problem auth a plugin.