Skip to content
Snippets Groups Projects
Commit bfea8c35 authored by Kamil Trzcińśki's avatar Kamil Trzcińśki
Browse files

Support bootstrap artifact

parent e5f94a3f
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -184,6 +184,18 @@ module Ci
end
end
 
after_transition any => [:success] do |build|
if build.bootstrap? && build.job_artifacts_gitlab_ci_yaml
# very hacky way to inject ci_yaml_file!
build.job_artifacts_gitlab_ci_yaml.each_blob do |blob|
build.pipeline.instance_variable_set(:@ci_yaml_file, blob)
end
Ci::PopulatePipelineService.new(build.project, build.user).execute(
build.pipeline, nil, nil, save_on_errors: true)
end
end
before_transition any => [:failed] do |build|
next unless build.project
next if build.retries_max.zero?
Loading
Loading
@@ -832,5 +844,9 @@ module Ci
def project_destroyed?
project.pending_delete?
end
def bootstrap?
self.name = 'bootstrap'
end
end
end
Loading
Loading
@@ -9,7 +9,7 @@ module Ci
NotSupportedAdapterError = Class.new(StandardError)
 
TEST_REPORT_FILE_TYPES = %w[junit].freeze
NON_ERASABLE_FILE_TYPES = %w[trace].freeze
NON_ERASABLE_FILE_TYPES = %w[trace gitlab_ci_yaml].freeze
DEFAULT_FILE_NAMES = {
archive: nil,
metadata: nil,
Loading
Loading
@@ -19,7 +19,8 @@ module Ci
sast: 'gl-sast-report.json',
dependency_scanning: 'gl-dependency-scanning-report.json',
container_scanning: 'gl-container-scanning-report.json',
dast: 'gl-dast-report.json'
dast: 'gl-dast-report.json',
gitlab_ci_yaml: 'gitlab-ci.yml'
}.freeze
 
TYPE_AND_FORMAT_PAIRS = {
Loading
Loading
@@ -31,7 +32,8 @@ module Ci
sast: :gzip,
dependency_scanning: :gzip,
container_scanning: :gzip,
dast: :gzip
dast: :gzip,
gitlab_ci_yaml: :gzip
}.freeze
 
belongs_to :project
Loading
Loading
@@ -76,7 +78,8 @@ module Ci
dependency_scanning: 6, ## EE-specific
container_scanning: 7, ## EE-specific
dast: 8, ## EE-specific
codequality: 9 ## EE-specific
codequality: 9, ## EE-specific
gitlab_ci_yaml: 10
}
 
enum file_format: {
Loading
Loading
Loading
Loading
@@ -26,7 +26,7 @@ module Ci
 
sequence.build! do |pipeline, sequence|
if sequence.complete?
complete_block.call
complete_block.call if complete_block
pipeline.process!
end
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment