# File lib/buildr/core/build.rb, line 521 def applies_to? if File.exist? '.git/config' true else curr_pwd = Dir.pwd Dir.chdir('..') do return false if curr_pwd == Dir.pwd # Means going up one level is not possible. applies_to? end end end
Fails if one of these 2 conditions are not met:
1. the repository is clean: no content staged or unstaged 2. some remote repositories are defined but the current branch does not track any
# File lib/buildr/core/build.rb, line 537 def check super uncommitted = Git.uncommitted_files fail "Uncommitted files violate the First Principle Of Release!\n#{uncommitted.join("\n")}" unless uncommitted.empty? fail "You are releasing from a local branch that does not track a remote!" unless Git.remote end
Add a tag reference in .git/refs/tags and push it to the remote if any. If a tag with the same name already exists it will get deleted (in both local and remote repositories).
# File lib/buildr/core/build.rb, line 546 def tag_release(tag) unless this_version == extract_version info "Committing buildfile with version number #{extract_version}" Git.commit File.basename(Buildr.application.buildfile.to_s), message Git.push if Git.remote end info "Tagging release #{tag}" Git.git 'tag', '-d', tag rescue nil Git.git 'push', Git.remote, ":refs/tags/#{tag}" rescue nil if Git.remote Git.git 'tag', '-a', tag, '-m', "[buildr] Cutting release #{tag}" Git.git 'push', Git.remote, 'tag', tag if Git.remote end
# File lib/buildr/core/build.rb, line 559 def update_version_to_next super info "Current version is now #{extract_version}" Git.commit File.basename(Buildr.application.buildfile.to_s), message Git.push if Git.remote end