From 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 17 Dec 2020 11:59:07 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-7-stable-ee --- scripts/get-job-id | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100755 scripts/get-job-id (limited to 'scripts/get-job-id') diff --git a/scripts/get-job-id b/scripts/get-job-id deleted file mode 100755 index a5d34dc545b..00000000000 --- a/scripts/get-job-id +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -require 'gitlab' -require 'optparse' - -# -# Configure credentials to be used with gitlab gem -# -Gitlab.configure do |config| - config.endpoint = 'https://gitlab.com/api/v4' - config.private_token = ENV['GITLAB_BOT_MULTI_PROJECT_PIPELINE_POLLING_TOKEN'] -end - -options = {} -OptionParser.new do |opts| - opts.on("-s", "--scope=SCOPE", "Find job with matching scope") do |scope| - options[:scope] = scope - end -end.parse! - -class PipelineJobFinder - def initialize(project_id, pipeline_id, job_name, options) - @project_id = project_id - @pipeline_id = pipeline_id - @job_name = job_name - @options = options - end - - def execute - Gitlab.pipeline_jobs(@project_id, @pipeline_id, @options).auto_paginate do |job| - break job if job.name == @job_name - end - end -end - -project_id, pipeline_id, job_name = ARGV - -job = PipelineJobFinder.new(project_id, pipeline_id, job_name, options).execute - -return if job.nil? - -puts job.id -- cgit v1.2.3