ios - Getting CFBundleVersion from within Jenkins to use it as a variable, something like ${APP_VERSION} -


what i'd able add tag commits jenkins building from. right tag commits jenkins build number want add in app version listed in info.plist cfbundleversion in front of that.

what want know is, how can grab value using jenkins or otherwise , able use parameter/variable within jenkins?

i've seen references using plistbuddy set value assume there's way use same value. though how , how can use in jenkins don't know.


for further clarification using git publisher in jenkins create tag , push format

jenkinsbuild-$build_number

this results in tag on commit in git - jenkinsbuild-303

what want, assuming app @ version 3.5 tag reads - jenkinsbuild-3.5-303

i managed piece solution answer @agy linked to. here's did:

  1. in build section jenkins configuration, added following 2 lines 'execute shell' step after xcode step:

    app_version=$(/usr/libexec/plistbuddy -c "print :cfbundleshortversionstring" "path plist")     echo app_version=$app_version > appversion.properties; 
  2. after that, added 'inject environment variables' step (i think part of envinject plugin), added "appversion.properties" properties file path field.

  3. after done, app_version available environment variable in subsequent shell command steps.


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -