Skip to content
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

Add new command to generate IntelliJ run configurations #48

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

bernd
Copy link
Member

@bernd bernd commented Nov 26, 2024

The new idea run-configs create command creates IntelliJ run configurations for the Graylog Server, Data Node, and the DEV web server.

$ graylog-project idea rc create -h
This command adds default IntelliJ run configurations for Graylog Server,
Data Node, and the web development server.

The run configurations are created in the $PWD/.run/ directory.

Examples:
    # Create default run configurations
    graylog-project idea run-configs create

    # Create default run configurations and .env files (requires installation of EnvFile plugin in IntelliJ)
    graylog-project idea run-configs create -E

    # Create run configurations for two Server and three Data Node instances
    graylog-project idea run-configs create --instances server=2,data-node=3

Usage:
  graylog-project idea run-configs create [flags]

Aliases:
  create, c

Flags:
  -E, --env-file                Use .env files (requires the IntelliJ EnvFile plugin)
  -f, --force                   Overwrite existing run configurations
  -h, --help                    help for create
  -i, --instances stringToInt   Number of instances - example: server=1,data-node=3 (default [server=2,data-node=2])
      --root-password string    The root user password (default "admin")
$ graylog-project idea rc create
Created run configuration: .run/project-generated-data-node-1.run.xml
Created run configuration: .run/project-generated-data-node-2.run.xml
Created run configuration: .run/project-generated-server-1.run.xml
Created run configuration: .run/project-generated-server-2.run.xml
Created run configuration: .run/project-generated-web-1.run.xml
Created compound configuration: .run/project-generated-compound-data-nodes.run.xml
Created compound configuration: .run/project-generated-compound-all.run.xml
Created compound configuration: .run/project-generated-compound-servers.run.xml
$ graylog-project idea rc create --env-file
Created run configuration: .run/project-generated-web-1.run.xml
Created run env file: .env.web-1
Created run configuration: .run/project-generated-data-node-1.run.xml
Created run env file: .env.data-node-1
Created run configuration: .run/project-generated-data-node-2.run.xml
Created run env file: .env.data-node-2
Created run configuration: .run/project-generated-server-1.run.xml
Created run env file: .env.server-1
Created run configuration: .run/project-generated-server-2.run.xml
Created run env file: .env.server-2
Created compound configuration: .run/project-generated-compound-servers.run.xml
Created compound configuration: .run/project-generated-compound-data-nodes.run.xml
Created compound configuration: .run/project-generated-compound-all.run.xml

image

@bernd bernd marked this pull request as ready for review November 27, 2024 12:24
The renameio library doesn't work on Windows so we have to provide a
wrapper.
@bernd bernd requested a review from a team November 27, 2024 12:50
The Data Node can auto-detect the correct location so we don't have to
put the version number into the environment.
Copy link
Contributor

@thll thll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only scanned over the code but I tested the CLI command. Works great 👍

bernd added 2 commits December 4, 2024 11:49
On Linux the *.localhost hostnames work automatically. On other
operating systems the users have to add the names to /etc/hosts.
@thll
Copy link
Contributor

thll commented Dec 13, 2024

@bernd: Now that Graylog2/graylog2-server#20181 is merged, should we proceed with this PR?

@bernd
Copy link
Member Author

bernd commented Dec 13, 2024

Aye! Let's finish it up in the new year. 🙂

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

Successfully merging this pull request may close these issues.

2 participants