0

I have come across a slight problem in the setup that I have developed and was hoping for some advice on my release procedure.

As it stands, I use my development box to build with jenkins / maven. To build my application I created a delivery pipeline which looks as follows

enter image description here

Every time my application is built, it uses the name appname-1.0.war and I have seen that using the maven release plugin ( Maven versioning best practices ) we can get maven to increment the build number.

My issue however is this;

My prod build in the pipeline essentially builds the application with prod profiles on dev, when built, scp's the file to prod and then deploys to the relevant directory.

1) This therefore overwrites an existing application with the same name

2) If i use maven release plugin the filename will always be changing, so how can I scp the correct file if i don't know its name in advance?

Hopefully I have given enough details of the issue I face as I really would like a mechanism that allows me on production to roll back to a previous release as currently this is not possible.

Thanks

Community
  • 1
  • 1
Biscuit128
  • 5,218
  • 22
  • 89
  • 149
  • Is your build machine (from where you pick the source to SCP) a Linux/UNIX or Windows box? – Technext Sep 03 '14 at 08:45
  • linux box - fedora 20 – Biscuit128 Sep 03 '14 at 08:46
  • You are saying that the file that gets created by using `Maven Release` plugin keeps changing the name. Still, i feel there will be some pattern in it, correct? Can you please provide the file name(s)? – Technext Sep 03 '14 at 08:49
  • i am not using the maven release plugin yet because i won't be able to scp the file as the name will change - and jenkins is responsible for picking up this file and copying it – Biscuit128 Sep 03 '14 at 08:50
  • I believe you can run a bash at the post-build section calling a few commands to do that. If you store artifacts, as @Technext suggested, yes, you have a pattern. And if you call `git describe --abbrev=0 --tags` with a few cuts, you will end having the lastest tag created, which corresponds to the dynamic portion of the filename. Then, you may achive your goal by concatenating them... Hope this helps. If you try to get current version through mvn commands, you will end getting NEXT version. – Lovato Sep 03 '14 at 18:13

0 Answers0