lib/release_tools/release_metadata_uploader.rb
def upload(name, data)
      json = JSON.pretty_generate(format_release_metadata(data))
      message = "Add release data for #{name}"
      path = file_path_for(name)

      begin
        GitlabOpsClient.create_file(PROJECT, path, BRANCH, json, message)
      rescue Gitlab::Error::BadRequest
        # If a CI job running this code fails later on and is retried, the JSON
        # file may already exist. Instead of erroring out again, we update the
        # existing file. If that also fails, manual intervention is likely
        # needed anyway; so we don't handle that case explicitly.
        GitlabOpsClient.edit_file(PROJECT, path, BRANCH, json, message)
      end
    end
# The project on ops.gitlab.net to store the release metadata in.
The project on ops.gitlab.net to store the release metadata in.
The project on ops . gitlab . net to store the release metadata in .
def upload(name, data)
      json = JSON.pretty_generate(format_release_metadata(data))
      message = "Add release data for #{name}"
      path = file_path_for(name)
      begin
        GitlabOpsClient.create_file(PROJECT, path, BRANCH, json, message)
      rescue Gitlab::Error::BadRequest
        GitlabOpsClient.edit_file(PROJECT, path, BRANCH, json, message)
      end
    end
def upload ( name , data ) json = JSON . pretty_generate ( format_release_metadata ( data ) ) message = "Add release data for #{name}" path = file_path_for ( name ) begin GitlabOpsClient . create_file ( PROJECT , path , BRANCH , json , message ) rescue Gitlab :: Error :: BadRequest GitlabOpsClient . edit_file ( PROJECT , path , BRANCH , json , message ) end end
The project on ops.gitlab.net to store the release metadata in.
The project on ops . gitlab . net to store the release metadata in .
# If a CI job running this code fails later on and is retried, the JSON # file may already exist. Instead of erroring out again, we update the # existing file. If that also fails, manual intervention is likely # needed anyway; so we don't handle that case explicitly.
name
data