Per the docs, first parameter for the block is STDOUT + STDERR, 2nd one is STDIN:
https://ruby-doc.org/3.1.3/exts/pty/PTY.html#method-c-spawn
As it is now, the method looks like it's reading from STDIN, though in
fact it's reading from an incorrectly named parameter for STDOUT.
The `git` version in our discourse_test docker image was recently updated to include a permissions check before running any git commands. For this to pass, git operations must be performed by the user which owns the git repository's directory.
discourse_dev installs a temporary version of Discourse to create a pre-migrated database. Previously this was installing gems in the global bundler directory, which could lead to permissions errors. This commit makes it use a local vendor directory, just like we do in the production install of Discourse.
The slim images aren't able to run the full `rake docker:test` task, so having it as the entrypoint doesn't make sense. We only want it as the entrypoint on `discourse_test:release`
Some existing templates (e.g. those written by following [the multisite guide](https://meta.discourse.org/t/multisite-configuration-with-docker/14084) use the `after_bundle_exec` hook to run application code like `multisite:migrate`. Relatively recently, the ruby app has started depending on `yarn` dependencies for basic functionality, and therefore requires `yarn install` to have been run to avoid errors.
This commit moves the `yarn install` step before `bundle install`, so that existing users of the `after_bundle_exec` hook do not need to update their templates.
WARNING: apt does not have a stable CLI interface. Use with caution in
scripts.
Also apply some DEBIAN_FRONTEND=noninteractive because this is running
in CI.
Trying to run specs with RAILS_ENV=development ends up like:
```
/usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30: warning: ⛔️ WARNING: Sidekiq testing API enabled, but this is not the test environment. Your jobs will not go to Redis.
Randomized with seed 1716
FF
Failures:
1) CategoryBadge escapes HTML in category names / descriptions
Failure/Error: DB.test_transaction = ActiveRecord::Base.connection.current_transaction
NoMethodError:
undefined method `test_transaction=' for #<MiniSqlMultisiteConnection:0x000055a7662ea1e0>
# ./spec/rails_helper.rb:284:in `block (2 levels) in <top (required)>'
# ./spec/rails_helper.rb:277:in `block (2 levels) in <top (required)>'
```
`discourse-setup` will now ensure container definitions are
installed with `0600` permissions mode only.
`launcher` will now throw a warning when an existing container
definition is world-readable.
Also clean up leftover `launcher setup` logic which no longer exists.
Merge pre-existing logic into `check_prereqs` function.
If the user has overridden the `base_image` to something other than default, we
may not get the latest version of that image when bootstrapping.
To remedy, always pull the image to check the manifest after we parse it out.