diff options
Diffstat (limited to 'tooling/bin/update_job_metrics_field')
-rwxr-xr-x | tooling/bin/update_job_metrics_field | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tooling/bin/update_job_metrics_field b/tooling/bin/update_job_metrics_field new file mode 100755 index 00000000000..65cc3d1ff7f --- /dev/null +++ b/tooling/bin/update_job_metrics_field @@ -0,0 +1,20 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +require_relative '../lib/tooling/job_metrics' + +unless ENV['CI_JOB_METRICS_ENABLED'] == 'true' + puts "[job-metrics] Feature disabled because CI_JOB_METRICS_ENABLED is not set to true." + exit 0 +end + +field_name = ARGV.shift +field_value = ARGV.shift + +if field_name.nil? || field_value.nil? + puts 'usage: update_job_metric_field <field_name> <field_value>' + exit 1 +end + +puts "[job-metrics] Updating job metrics field for the CI/CD job." +Tooling::JobMetrics.new.update_field(field_name, field_value) |