0

I am using maven rpm plugin. My rpm is just kind of zip which can be extracted to different environment variables for example dev , prod etc

I want to fail rpm install if there is no environment variable called install-env

Secondly how can I read and use this environment variable inside install script which is used by rpm.

Thanks

user2230605
  • 2,390
  • 6
  • 27
  • 45
  • 2
    You should not do that. See http://stackoverflow.com/q/8258647/3489429 – msuchy Sep 21 '15 at 11:41
  • Thanks , there is comment in that. QUOTE << I think what you want is to have your pre or install scripts auto detect the environment somehow, maybe by having a file somewhere they can examine. I'll also point out that from an RPM user's perspective, having a package named *-qa.rpm is a lot more intuitive than passing some random parameter. >> I am planning to to do this , read the environment variable from script in that , do you still think its not good idea? – user2230605 Sep 21 '15 at 21:41
  • *I* would not do that. You will have a package which will behave differently in different environments. If you send it by accident to customer or to production and they have there by some accident the file which define qa env., then you will have problem and you will have hard time to detect it. (I've been there, happened to me). When you name those package differently (and they will have different content), then it is very easy to detect it once customer/production send you report (e.g. using sos tool). – msuchy Sep 22 '15 at 20:23
  • So you are suggesting to create different packages for different environments ? That might not be best practice as per what I read in CI book by Thought works – user2230605 Sep 22 '15 at 21:12
  • Yes. Different packages for different environments. Of course best option is to have one package for both prod and stage. But prod and stage should have the same environment and the package must have same content and behaviour (no "if qa-env" etc.). Otherwise you are testing something little bit different from what you will have in production. However I understand that it is not always possible. – msuchy Sep 22 '15 at 21:22

0 Answers0