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

Change resulting filesystem structure, moving everything in project dir. #1

Merged
merged 7 commits into from
May 3, 2016

Conversation

dennisoelkers
Copy link
Member

Instead of having/expecting project/server/plugin repos on the same level in the filesystem hierarchy, this PR is changing it so graylog-project dir contains all of the aforementioned. This makes it a bit less cluttered for developers because everything is under one directory.

mvn archetype:generate -DarchetypeGroupId=org.graylog -DarchetypeArtifactId=graylog-plugin-archetype -DartifactId=$pluginname

sed 's,\(../graylog2-server/graylog2-web-interface\),../\1/,' < ${buildConfigFilename}.sample > ${buildConfigFilename}
echo ${pluginname}/ >> ${prefix}/.gitignore
Copy link
Member

Choose a reason for hiding this comment

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

I would move the cloned repositories into modules/ or something similar and ignore the whole directory in .gitignore. Otherwise there will be modified files in the project. Also, this would add the directory multiple times if a user runs this script more than once.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not a bad idea, but this would require more work (changing the plugin's build.conf.js, changing webpack.combined.config.js of our web interface, etc.), which is not too difficult, but introduces more things which could go wrong. OTOH having the directory in .gitignore multiple times (what happens only when a plugin dir is created, removed and recreated with the exact same name) wouldn't harm anybody.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I don't get where the difference is between putting all repos into graylog-project/<repo> or into graylog-project/modules/<repo> from a build.conf.js perspective. Wouldn't the move into graylog-project/<repo> require a change to build.conf.js aswell? Can you elaborate?

Copy link
Member Author

Choose a reason for hiding this comment

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

The default build.conf.js.sample has a path to the web interface checkout defaulting to ../graylog2-server/graylog2-web-interface which works fine in this case. If we put all plugins into a subdir, we would need to change that. Same for webpack.combined.config.js which is looking for plugins in ../graylog-plugin-*.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, okay. The we misunderstood each other, or rather I got the bootstrap-plugin script wrong. My suggestion was to move plugins and server into modules/. 😃

Copy link
Member Author

Choose a reason for hiding this comment

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

That was a misunderstanding indeed :) After reading your initial commit it was actually clear enough, sorry!

Copy link
Member Author

Choose a reason for hiding this comment

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

I am now keeping the modules in the dir, because of the issues with maven-archetype (https://issues.apache.org/jira/browse/ARCHETYPE-311) and management of pom modules, but I am now adding dirs to .gitignore only if they are not present yet.

@dennisoelkers dennisoelkers force-pushed the change-directory-structure branch 3 times, most recently from 46c08aa to aea211b Compare April 27, 2016 14:46
Instead of having/expecting project/server/plugin repos on the same
level in the filesystem hierarchy, this PR is changing it so
graylog-project dir contains all of the aforementioned. This makes it a
bit less cluttered for developers because everything is under one
directory.
The latter is done to make sure that there was at least one `npm
install` run for a newly created plugin, otherwise the web interface dev
mode will fail.
@dennisoelkers dennisoelkers force-pushed the change-directory-structure branch from aea211b to 3752ca6 Compare April 27, 2016 14:49
@bernd bernd self-assigned this May 3, 2016
@bernd
Copy link
Member

bernd commented May 3, 2016

LGTM 👍

@bernd bernd merged commit 129db69 into master May 3, 2016
@bernd bernd deleted the change-directory-structure branch May 3, 2016 10:15
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