Skip to content

Instantly share code, notes, and snippets.

@davetheninja
Created December 30, 2009 03:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davetheninja/265824 to your computer and use it in GitHub Desktop.
Save davetheninja/265824 to your computer and use it in GitHub Desktop.
def get_project_name
return ENV['TEAMCITY_PROJECT_NAME'].to_s unless ENV['TEAMCITY_PROJECT_NAME'].nil?
return "PROJECT_NAME_NOT_SET"
end
def get_version
buildnumber = ENV['BUILD_NUMBER'].to_s unless ENV['BUILD_NUMBER'].nil?
svnrevision = ENV['BUILD_VCS_NUMBER_' + SIMPLIFIED_VCS_NAME].to_s unless ENV['BUILD_VCS_NUMBER_' + SIMPLIFIED_VCS_NAME].nil?
majorversion = ENV['MAJORVERSION'].to_s unless ENV['MAJORVERSION'].nil?
minorversion = ENV['MINORVERSION'].to_s unless ENV['MINORVERSION'].nil?
if (buildnumber.nil?)
return "0.0.0.0"
else
return majorversion + "." + minorversion + "." + svnrevision + "." + buildnumber
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment