RE: Published jars for test, pilot, and production environments?

2009-05-21 Thread Vonnahme, Paul
 Vonnahme, Paul wrote on 05/19/2009 01:26 PM:
  I'm hoping someone else is in a similar situation. We have some 
  utility jars used by multiple projects. These jars have three 
  different versions: one each for our test, pilot, and production 
  environments. Therefore I believe each of the versions needs to be 
  published so it will be available for multiple apps to use.
 
 
 Is there any reason not to use varying statuses for the 
 different environments?
 
 http://ant.apache.org/ivy/history/trunk/settings/statuses.html
 
 You could either use the default 
 release/milestone/integration statuses to map to your 
 environments, or use your own.
 
 In your ivy.xml,
 
dependency org=principal name=utility_jar 
 rev=latest.${ivy.build.env}/

[OT] I wasn't aware you could use ant variables in the ivy.xml files.  Very 
good to know, and I'm sure it will come in handy as I continue to experiment 
with ivy.

 
 and run in test environment:
ant -Divy.build.env=integration compile
 
 You can even default the property in ivysettings.xml, with an 
 override=false setting, to ensure your command-line param 
 takes precedence.
 
 Now just publish your utility modules with the appropriate 
 statuses, and everything should Just Work, right?

I tried this out, and at first it seemed like the answer I had been looking 
for.  However, then I noticed a few resolves that weren't happening how I 
expected.  I found this in the documentation 
(http://ant.apache.org/ivy/history/latest-milestone/ivyfile/dependency.html):
latest.[any status]
selects the latest revision of the dependency module with **at least the 
specified status**.  (Emphasis mine)

For our environment if I run:
ant -Divy.build.env=pilot compile
I would need it to compile only with dependencies that have a pilot status.  
Since ivy statuses are hierarchical, I would run the risk of pulling a 
dependency from a higher status.  

One way I could guarantee the status would be to put
status name=${ivy.build.env} integration=false/
as my highest level status.  

I will continue to experiment more with this option as well the option of 
multiple repositories.

Thanks to all for your responses.

Paul



-Message Disclaimer-

This e-mail message is intended only for the use of the individual or
entity to which it is addressed, and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
If you are not the intended recipient, any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately by
reply email to conn...@principal.com and delete or destroy all copies of
the original message and attachments thereto. Email sent to or from the
Principal Financial Group or any of its member companies may be retained
as required by law or regulation.

Nothing in this message is intended to constitute an Electronic signature
for purposes of the Uniform Electronic Transactions Act (UETA) or the
Electronic Signatures in Global and National Commerce Act (E-Sign)
unless a specific statement to the contrary is included in this message.

While this communication may be used to promote or market a transaction
or an idea that is discussed in the publication, it is intended to provide
general information about the subject matter covered and is provided with
the understanding that The Principal is not rendering legal, accounting,
or tax advice. It is not a marketed opinion and may not be used to avoid
penalties under the Internal Revenue Code. You should consult with
appropriate counsel or other advisors on all matters pertaining to legal,
tax, or accounting obligations and requirements.



Re: Published jars for test, pilot, and production environments?

2009-05-21 Thread Mitch Gitman
Few responses inline.

On Thu, May 21, 2009 at 10:37 AM, Vonnahme, Paul 
vonnahme.p...@principal.com wrote:

 [OT] I wasn't aware you could use ant variables in the ivy.xml files.  Very
 good to know, and I'm sure it will come in handy as I continue to experiment
 with ivy.


Small correction. You can use Ant properties (not variables) in
ivysettings.xml files, *not *ivy.xml files as you say.


 
  and run in test environment:
 ant -Divy.build.env=integration compile
 
  You can even default the property in ivysettings.xml, with an
  override=false setting, to ensure your command-line param
  takes precedence.
 
  Now just publish your utility modules with the appropriate
  statuses, and everything should Just Work, right?

 I tried this out, and at first it seemed like the answer I had been looking
 for.  However, then I noticed a few resolves that weren't happening how I
 expected.  I found this in the documentation (
 http://ant.apache.org/ivy/history/latest-milestone/ivyfile/dependency.html
 ):
 latest.[any status]
 selects the latest revision of the dependency module with **at least the
 specified status**.  (Emphasis mine)

 For our environment if I run:
ant -Divy.build.env=pilot compile
 I would need it to compile only with dependencies that have a pilot status.
  Since ivy statuses are hierarchical, I would run the risk of pulling a
 dependency from a higher status.


If I were you and I really insisted on (A) having one Ivy repository for all
my different statuses/stages and (B) not distinguishing between integration
and milestone/release via the revision value itself, then I would ask
myself, Isn't this default rule really what I want after all?

Suppose I have a web service project that is depending on a domain project
and I know I haven't had to make any changes to the domain project since its
last release to support the new pilot of your web service, then that at
least the specified status rule makes perfect sense. You don't want to have
to produce a new pilot version of your domain project to support a new pilot
version of your web service project.

Beyond that, if you found out after all that you were happy with that rule,
you might as well just make pilot correspond to the built-in milestone
status, although integration/milestone/release vs. integration/pilot/release
is a trivial matter.



 One way I could guarantee the status would be to put
status name=${ivy.build.env} integration=false/
 as my highest level status.


It sounds like to accomplish this, you would have to dynamically import an
Ivy settings fragment into your main Ivy settings, like
ivysettings-statuses-${ivy.build.env}.xml. Then if the build env is
integration, the imported file defines only one status, integration. If the
build env is pilot, the imported file defines two status, integration and
pilot. Etc.

So it sounds like this could be done, although I would still question the
motivation.



 I will continue to experiment more with this option as well the option of
 multiple repositories.

 Thanks to all for your responses.

 Paul



 -Message Disclaimer-

 This e-mail message is intended only for the use of the individual or
 entity to which it is addressed, and may contain information that is
 privileged, confidential and exempt from disclosure under applicable law.
 If you are not the intended recipient, any dissemination, distribution or
 copying of this communication is strictly prohibited. If you have
 received this communication in error, please notify us immediately by
 reply email to conn...@principal.com and delete or destroy all copies of
 the original message and attachments thereto. Email sent to or from the
 Principal Financial Group or any of its member companies may be retained
 as required by law or regulation.

 Nothing in this message is intended to constitute an Electronic signature
 for purposes of the Uniform Electronic Transactions Act (UETA) or the
 Electronic Signatures in Global and National Commerce Act (E-Sign)
 unless a specific statement to the contrary is included in this message.

 While this communication may be used to promote or market a transaction
 or an idea that is discussed in the publication, it is intended to provide
 general information about the subject matter covered and is provided with
 the understanding that The Principal is not rendering legal, accounting,
 or tax advice. It is not a marketed opinion and may not be used to avoid
 penalties under the Internal Revenue Code. You should consult with
 appropriate counsel or other advisors on all matters pertaining to legal,
 tax, or accounting obligations and requirements.




Re: Published jars for test, pilot, and production environments?

2009-05-19 Thread Kirby Files

Vonnahme, Paul wrote on 05/19/2009 01:26 PM:

I'm hoping someone else is in a similar situation. We have some
utility jars used by multiple projects. These jars have three
different versions: one each for our test, pilot, and production
environments. Therefore I believe each of the versions needs to be
published so it will be available for multiple apps to use.

When an app builds, it should get the latest version of the jar depending on 
the environment.  The ivy.xml would contain:
 dependency org=principal name=utility_jar 
rev=latest.integration/   .

I'd like to do something like:
 ant compile -Denv=test
for it to build with the latest test jar, -Denv=pilot to build with the latest 
pilot jar, etc.

My idea is to have three different versions of the settings file,
and just change the root of a resolver based on the environment.
   property name=ivy.shared.default.root 
value=/IvyRepository/test/
would specify the root of the 'shared' resolver for the test
environment.  /IvyRepository/pilot would exist for pilot, etc.


Is there any reason not to use varying statuses for the different 
environments?


http://ant.apache.org/ivy/history/trunk/settings/statuses.html

You could either use the default release/milestone/integration 
statuses to map to your environments, or use your own.


In your ivy.xml,

  dependency org=principal name=utility_jar 
rev=latest.${ivy.build.env}/


and run in test environment:
  ant -Divy.build.env=integration compile

You can even default the property in ivysettings.xml, with an 
override=false setting, to ensure your command-line param takes 
precedence.


Now just publish your utility modules with the appropriate statuses, 
and everything should Just Work, right?


Thanks,


Kirby Files
Software Architect
Masergy Communications
kfi...@masergy.com


Re: Published jars for test, pilot, and production environments?

2009-05-19 Thread Alan Hohn


On Tue, 19 May 2009, Kirby Files wrote:

Is there any reason not to use varying statuses for the different 
environments?


http://ant.apache.org/ivy/history/trunk/settings/statuses.html



This is a good solution if you can have separate downstream projects that 
fetch the JARs for each environment. If your situation is more complicated 
and you need to fetch different versions of an upstream JAR into the same 
downstream project for different purposes (unit test, deployment, etc.), 
look into Ivy configurations. They're designed to do exactly what you 
want.


In our project we have a unit testing version of some of our projects 
(uses in-memory database support, etc.) and Ivy configurations let us grab 
one version of the JAR to run tests in the downstream and then grab a 
different version when it's time to package an EAR file.


http://ant.apache.org/ivy/history/2.1.0-rc1/tutorial/conf.html

Best regards,
Alan



Re: Published jars for test, pilot, and production environments?

2009-05-19 Thread Mitch Gitman
Alan, I agree that configurations are a powerful--indeed a
necessary--feature of Ivy. But I would also maintain that Ivy confs are
about features, not about the problem Paul is trying to address, which is
distinguishing between integration and release builds. For that problem I
believe the techniques at hand come down to some combination of:

   - Depending on status=latest.integration, etc. And Kirby above offers a
   good technique for changing latest.${...} on the fly.
   - Maintaining separate integration and release Ivy repositories.
   - Establishing versioning conventions (probably in concert with the
   version control system) that lead to integration publications having
   distinctly different revisions than release publications. That is, you can
   tell just by looking at the form of rev=... whether it's integration or
   release.

Consider it this way. Even if you have an Ivy conf to give you your
in-memory database, you're still going to need the other Ivy conf to give
you your real database--*even for your continuous integration builds*. Now
you could say, What about the database connection strings? Wouldn't they
qualify for different Ivy confs, so you would need one Ivy conf for dev and
another for QA and yet another for production? I would maintain that even
here you're blurring the line, but then application configuration is a whole
'nuther topic in its own right.

On Tue, May 19, 2009 at 2:11 PM, Alan Hohn li...@anvard.org wrote:


 On Tue, 19 May 2009, Kirby Files wrote:

  Is there any reason not to use varying statuses for the different
 environments?

 http://ant.apache.org/ivy/history/trunk/settings/statuses.html


 This is a good solution if you can have separate downstream projects that
 fetch the JARs for each environment. If your situation is more complicated
 and you need to fetch different versions of an upstream JAR into the same
 downstream project for different purposes (unit test, deployment, etc.),
 look into Ivy configurations. They're designed to do exactly what you want.

 In our project we have a unit testing version of some of our projects (uses
 in-memory database support, etc.) and Ivy configurations let us grab one
 version of the JAR to run tests in the downstream and then grab a different
 version when it's time to package an EAR file.

 http://ant.apache.org/ivy/history/2.1.0-rc1/tutorial/conf.html

 Best regards,
 Alan