I tried adding that the run block, below exec: echo "Beginning of custom commands", and I guess that was too late.
So I added it to hooks: -> after_code:
I got this:
I, [2022-07-24T12:13:24.641982 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'gem update uri'
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/local/lib/ruby/gems/2.7.0 directory.
I, [2022-07-24T12:13:29.392041 #1] INFO -- : Updating installed gems
Updating uri
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'gem update uri' failed with return #<Process::Status: pid 132 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "cmd"=>["su discourse -c 'gem update uri'"]}
I went ahead and removed the su discourse in case it would help. That seems to have progressed well, and I bumped into other error:
I, [2022-07-24T12:21:17.497935 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile'
sh: 1: yarn: not found
I, [2022-07-24T12:21:19.397390 #1] INFO -- :
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile' failed with return #<Process::Status: pid 5373 exit 127>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
I thought that then I should install yarn manually? I deleted all plugins, including docker_manager, just in case. It still asked for yarn, so I thought I might as well install it:
I, [2022-07-24T12:37:42.295754 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake plugin:pull_compatible_all'
WARNING: Plugins were activated before running `rake plugin:pull_compatible_all`
You should prefix this command with LOAD_PLUGINS=0
I, [2022-07-24T12:37:44.807237 #1] INFO -- :
I, [2022-07-24T12:37:44.807548 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
I, [2022-07-24T12:37:48.578845 #1] INFO -- :
I, [2022-07-24T12:37:48.579098 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile'
error Command "ember" not found.
I, [2022-07-24T12:37:50.795001 #1] INFO -- : yarn run v1.22.19
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile' failed with return #<Process::Status: pid 5409 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"assets_precompile", "cmd"=>["su discourse -c 'bundle exec rake themes:update assets:precompile'"]}
So it started complaining about ember. Even if I tried to install it manually.
Here’s how my after_code looks like right now:
hooks:
after_code:
- exec:
cd: $home
cmd:
- gem update uri
- npm install -g yarn
- npm install -g ember
#- exec:
# cd: $home/plugins
#cmd:
#- git clone https://github.com/discourse/docker_manager.git
I’m not sure that’s the right path