Fix increase release tag(new api change it seems)
This commit is contained in:
parent
57cd131f38
commit
14cb3eb2dd
|
@ -214,14 +214,25 @@ class Project < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def increase_release_tag(project_version, message)
|
||||
file = Github_blobs_api.contents github_get_organization + '/' + name, path: '/' + name + '.spec', ref: project_version rescue nil
|
||||
begin
|
||||
file = Github_blobs_api.contents github_get_organization + '/' + name, path: '/' + name + '.spec', ref: project_version
|
||||
rescue => e
|
||||
Raven.capture_exception(e)
|
||||
return false
|
||||
end
|
||||
if file
|
||||
decoded_content = Base64.decode64(file.content)
|
||||
new_content = Project.replace_release_tag decoded_content
|
||||
return if new_content == decoded_content
|
||||
Github_blobs_api.update_contents github_get_organization + '/' + name, '/' + name + '.spec',\
|
||||
message, file.sha, new_content, branch: project_version rescue nil
|
||||
begin
|
||||
Github_blobs_api.update_contents github_get_organization + '/' + name, name + '.spec',\
|
||||
message, file.sha, new_content, branch: project_version
|
||||
rescue => e
|
||||
Raven.capture_message(e)
|
||||
return false
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
protected
|
||||
|
|
Loading…
Reference in New Issue