lib/cicd/builder/mixlib/environment.rb in cicd-builder-0.9.13 vs lib/cicd/builder/mixlib/environment.rb in cicd-builder-0.9.14
- old
+ new
@@ -37,9 +37,21 @@
@vars[:project_name] = ENV['PROJECT_NAME']
end
if ENV.has_key?('RELEASE')
@vars[:release] = ENV['RELEASE']
+ elsif File.exists?((version_file=File.join(ENV['REPO_DIR'], 'RELEASE')))
+ @vars[:release] = File.readlines(version_file).shift
+ else
+ raise "'RELEASE' was not provided in either environment or #{version_file} file"
+ end
+
+ if ENV.has_key?('VERSION')
+ @vars[:version] = ENV['VERSION']
+ elsif File.exists?((version_file=File.join(ENV['REPO_DIR'], 'VERSION')))
+ @vars[:version] = File.readlines(version_file).shift
+ else
+ raise "'VERSION' was not provided in either environment or #{version_file} file"
end
if ENV.has_key?('BUILD_STORE')
@vars[:build_store] = "#{ENV['BUILD_STORE']}"
end
\ No newline at end of file