0

In execute shell in build settings I have PROJECT_VERSION variable. I would like to use it in FTP Publishers -> Transfer -> Source files in that way:

build/project_${PROJECT_VERSION}.zip

but it seems to not be working. How to export this information? I tried also "export" command but it also doesn't work.

Piotr Wasilewicz
  • 1,751
  • 2
  • 15
  • 26

1 Answers1

0

Do you really have to specify the project version? I usually use a wildcard to specify source files when transferring using SSH at least. E.g.

build/project_*.zip

Otherwise you could take a look at this: How to set an environment variable programmatically in Jenkins/Hudson?

Community
  • 1
  • 1
juppman
  • 163
  • 1
  • 8
  • Ok... I can use * in Source files (if I have only one) but I need also add this PROJECT_VERSION to "Remote directory". I want use it in that way: SOMETHING/iOS/${PROJECT_VERSION} - there I can't use *. – Piotr Wasilewicz Jul 21 '16 at 08:47
  • You could use the solution given here: http://stackoverflow.com/a/10626193/5533897 – juppman Jul 21 '16 at 08:51
  • @piotr-wasilewicz Another possibility would be to place the built zip files at`build/${PROJECT_VERSION}/project_${PROJECT_VERSION}.zip` and then set "Source files" to `build/**/*.zip`, "Remove prefix" to `build` and "Remote directory" to `SOMETHING/iOS. But this may be a bit ugly ;) – juppman Jul 21 '16 at 09:06
  • Your previous solution (stackoverflow.com/a/10626193/5533897) works great. Thank you! – Piotr Wasilewicz Jul 21 '16 at 09:27