Welcome to mirror list, hosted at ThFree Co, Russian Federation.

job.rb « resource « qa « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 96c502e567c6da514280745c7bd9be7ed95f6eeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# frozen_string_literal: true

module QA
  module Resource
    class Job < Base
      attr_accessor :id, :name, :project

      attributes :id,
                 :project

      def fabricate_via_api!
        resource_web_url(api_get)
      rescue ResourceNotFoundError
        super
      end

      def artifacts
        parse_body(api_get_from(api_get_path))[:artifacts]
      end

      def api_get_path
        "/projects/#{project.id}/jobs/#{id}"
      end

      def api_post_path
      end

      def api_post_body
        {
          artifacts: artifacts
        }
      end
    end
  end
end