Skip to content

Add setting for a startup/pre-connect script #386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
code-asher opened this issue Apr 3, 2024 · 1 comment
Closed

Add setting for a startup/pre-connect script #386

code-asher opened this issue Apr 3, 2024 · 1 comment
Assignees

Comments

@code-asher
Copy link
Member

code-asher commented Apr 3, 2024

The script can be a URL (or maybe even a path on the remote filesystem) that would get downloaded (if it is a URL) and executed after the IDE is downloaded, but before connecting and launching the backend. This will allow customizing things like the extensions to install or whatever other preparations need to be done.

The script should be passed all the arguments for the IDE:

  • IDE installation location on disk (in particular the script will likely want the location of the launcher, like idea.sh for Intellij, to execute idea.sh installPlugins)
  • Build number
  • Product code
  • Others?

Questions

  • Do we only run it when first downloading an IDE? Or run it before every time we connect? Or only run it before the first launch, without regard to whether it was downloaded or pre-installed?
  • Do we need to confirm launching the script with the user?
About to execute https://coder.com/jetbrains-launcher.sh.  Is that OK?

[Yes] [No] [Show contents]
  • Can we assume cURL is installed to download the script directly on the remote or should we download the script from the plugin and transfer it over SSH?

Other ideas:

  • It could be a generic command to run instead of a script? Then if you need a script you would set it to curl <url> | bash for example. Not sure this has much utility over just always requiring a script, but it does parallel the header command setting.
  • If the utility is specifically only to install extensions, we could instead have a setting that takes a list of extensions to install, and the plugin can handle the actual installations.
@kirillk
Copy link
Contributor

kirillk commented Apr 11, 2024

@code-asher

  1. We need this script to be executed in the bin directory in the backend IDE. Maybe the setting could be workDir+script pair or by default set it to bin, I'd keep it as simple as this.
  2. We need the script to be executed on every backend start. It might be a setting if we want to run it when the backend is running. In our case we only need to run when the backend is not running.
  3. We don't need any parameters passed, the script infers all on itself provided it's run inside bin
  4. We don't need to ask the user permission to run the script, it should be transparent and hassle-free.
  5. We can assume cURL is available, what we are going to do is to run this: curl -sL https://go.prod.netflix.net/install-jetbrains-dropship | bash
  6. This utility talks to our internal services, downloads plugin binaries and generates a local repo and installed/updates it all. This may be more than that.

The way I see it it's a setting we could provision with JB Toolbox Enterpise to all users to configure the plugin. It's just a simple script to run and maybe choosing a workDir (or bin by default)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants