-
Notifications
You must be signed in to change notification settings - Fork 24
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 support for filtering #1
Comments
Would something like this work?
Re "where to copy files from", I think this is covered already by just specifying whatever you want as |
Comments and questions:
|
I guess it is a separate issue, but with regards to "where to copy files from". Yes, this is supported by copyFile and copyDirectory. However, I want to use the default "copy rules" that are in effect for src/main/unix/files and scripts as much as possible. The design suggestion in bullet 1 in my previous comment this would be hidden for the user, but the implementation would use a folder containing filtered files instead of the unfiltered templates. |
(1) is a good idea that will control filtering on/off on the implicit (2) yes, this will be how everything is implemented. (3) The value is the exact value that will be used as a value for every regexp match. As outlined in the original example you would do something like this:
But as you say, using the build-in filtering mechanism would be useful. This means that having this:
would imply this:
|
An alternative approach which is less work and possibly cleaner as it separates copying from filtering:
Pros:
Cons:
|
Any ETA on Filtering? I am about to have to rewrite our packaging but need filtering to make this particular plugin work. |
The code in the repository should work for the zip packaging. Which packaging are you using? |
Thanks for the reply I am using solaris and rpm's. I have a set of files for the pre and post functions that I want to use as a dependency for each project and have them filtered with application specific information (user, groups, perms). Any plans to expand the filtering to work with all packages types? |
Planned, yes, timeframe, no. Given that people want it makes it more likely, but I don't have any workhours to spend on it now so don't hold your breath. It is doable to implement yourself if you have the time, use the zip code as a start. |
@cholden14 Is this still something you need? I'm working on this now. |
Yes sir it is! Sent from my iPhone On Feb 13, 2013, at 6:06 AM, Trygve Laugstøl [email protected] wrote:
|
Let me know when you've been able to try it out. I'm working on updating the handbook too. |
Trygve I will look as soon as I can, might be Wednesday Thank you! Sent from my iPhone On Feb 18, 2013, at 8:45 AM, Trygve Laugstøl [email protected] wrote:
|
Trygvis, Forgive me but which filtering option did you implement? I mean in terms of basic syntax? Thanks |
Example syntax:
However, while updating the handbook I ran into an issue. Only the keys I've more or less fixed the code so that all properties (system, user and project) are used and getting the regexp to work. |
Trygvis, Having trouble getting this to build.. keeps wanting to upload to the sonatype. Any suggestions? |
Nevermind.. idiot typo.. testing the filtering today Trygvis |
Trygvis, Ok done some testing and keep getting null pointer exceptions for any of my substitution attempts:
any thoughts? |
That filter won't work, I tried to document it so if you did read it please let me know what I can improve. It is quite crude yet. Also check out the integration tests for some examples: https://github.com/trygvis/unix-maven-plugin/blob/master/unix-maven-plugin/src/it/test-zip-1/pom4test.xml Please paste the NPE, that's something that obviously needs fixing :) |
Trygvis, OK So I have the following properties specified in what I refer to as my packaging module: com.theice.tribe:tribe-assembly:zip some_user some_group 2044 1501 some_groups some_groups start_script deploy_location crontab_file postinstallhook.shMy files to filter look like so for the properties to filter:
I have also tried:
In my files to filter what should they places I want substituted to look like? Sorry to be so dense on this but I bet it's something simple I am missing. I have looked over the examples and I think this should work or maybe I simply can't filter the solaris specific postinstall/preinstall files? Thanks for your help! |
Your file should look like what you have tried:
I don't have any tests for pkg, only rpm so if you could try that fast that would be nice. You can also try to run the plugin in debugging mode with -Dmaven.unix.debug and/or -X. Feel free to email me the logs privately. You should see output like this:
Note that you should NOT have any |
Use case:
We have a bunch of Java applications installed using Solaris PKGs. To avoid duplication it would be nice to be able to use templates and just specify the differences using properties.
Example usage:
It seems likely that it is necessary to add configuration option to specify where the different files should be fetched from. E.g. target/unix/files/ and target/unix/scripts instead of src/main/unix/files and src/main/unix/scripts.
See also http://jira.codehaus.org/browse/MUNIX-8 and http://jira.codehaus.org/browse/MUNIX-9.
The text was updated successfully, but these errors were encountered: