File tree Expand file tree Collapse file tree 5 files changed +10
-40
lines changed Expand file tree Collapse file tree 5 files changed +10
-40
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,14 @@ variables:
108
108
paths :
109
109
- gems
110
110
111
+ .build-package : &build-package
112
+ - bundle exec rake cache:populate
113
+ - bundle exec rake cache:restore
114
+ - bundle exec rake build:project
115
+ - bundle exec rake build:package:sync
116
+ - bundle exec rake cache:bundle
117
+ - bundle exec rake build:component_shas
118
+
111
119
before_script :
112
120
- echo "PIPELINE_TYPE detected as ${PIPELINE_TYPE}"
113
121
# Exit early if building on an OS for which we don't provide the specified
Original file line number Diff line number Diff line change 44
44
stage : package
45
45
script :
46
46
- support/import_gpg_secrets.sh
47
- - bundle exec rake cache:populate
48
- - bundle exec rake cache:restore
49
- - bundle exec rake build:project build:package:sync
50
- - bundle exec rake cache:bundle
51
- - bundle exec rake build:component_shas
47
+ - !reference [.build-package]
52
48
# Run package size checks on nightlies. The job will create alerts, so we
53
49
# don't need it to fail and block the pipeline. Hence the `|| true`.
54
50
- if [ -n "$NIGHTLY" ]; then
Original file line number Diff line number Diff line change 62
62
- bundle install -j $(nproc)
63
63
- bundle binstubs --all
64
64
65
- .build-package : &build-package
66
- - bundle exec rake cache:populate
67
- - bundle exec rake cache:restore
68
- - bundle exec rake build:project
69
- - bundle exec rake cache:bundle
70
- - bundle exec rake build:component_shas
71
-
72
65
.trigger-package-common :
73
66
extends : .trigger-package-cache
74
67
variables :
Original file line number Diff line number Diff line change @@ -23,22 +23,6 @@ def qa_image
23
23
Gitlab ::Util . get_env ( 'QA_IMAGE' ) || "#{ Gitlab ::Util . get_env ( 'CI_REGISTRY' ) } /#{ Build ::Info ::Components ::GitLabRails . project_path } /#{ Build ::Info ::Package . name } -qa:#{ Build ::Info ::Components ::GitLabRails . ref ( prepend_version : false ) } "
24
24
end
25
25
26
- def release_bucket
27
- # Tag builds are releases and they get pushed to a specific S3 bucket
28
- # whereas regular branch builds use a separate one
29
- downloads_bucket = Gitlab ::Util . get_env ( 'RELEASE_BUCKET' ) || "downloads-packages"
30
- builds_bucket = Gitlab ::Util . get_env ( 'BUILDS_BUCKET' ) || "omnibus-builds"
31
- Check . on_tag? ? downloads_bucket : builds_bucket
32
- end
33
-
34
- def release_bucket_region
35
- Gitlab ::Util . get_env ( 'RELEASE_BUCKET_REGION' ) || "eu-west-1"
36
- end
37
-
38
- def release_bucket_s3_endpoint
39
- Gitlab ::Util . get_env ( 'RELEASE_BUCKET_S3_ENDPOINT' ) || "s3.amazonaws.com"
40
- end
41
-
42
26
def gcp_release_bucket
43
27
# All tagged builds are pushed to the release bucket
44
28
# whereas regular branch builds use a separate one
Original file line number Diff line number Diff line change @@ -71,24 +71,13 @@ namespace :build do
71
71
end
72
72
end
73
73
74
- desc "Sync packages to aws and gcp"
74
+ desc "Sync packages to gcp"
75
75
task :sync do
76
76
Gitlab ::Util . section ( 'build:package:sync' , collapsed : Build ::Check . on_tag? ) do
77
77
puts '---- Syncing packages to GCP'
78
78
puts GCloudHelper . gcs_sync! ( 'pkg/' )
79
79
paths = Dir . glob ( 'pkg/**/*' ) . select { |f | File . file? ( f ) } . map { |p | p . gsub ( %r[^pkg/] , '' ) }
80
80
puts GCloudHelper . signed_urls ( paths )
81
-
82
- puts '---- Syncing packages to AWS'
83
- release_bucket = Build ::Info . release_bucket
84
- release_bucket_region = Build ::Info . release_bucket_region
85
- release_bucket_s3_endpoint = Build ::Info . release_bucket_s3_endpoint
86
- puts "AWS S3 Sync: Copying pkg/ contents to #{ release_bucket_s3_endpoint } "
87
- system ( *%W[ aws s3 --endpoint-url https://#{ release_bucket_s3_endpoint } sync pkg/ s3://#{ release_bucket } --no-progress --acl public-read --region #{ release_bucket_region } ] )
88
- files = Dir . glob ( 'pkg/**/*' ) . select { |f | File . file? f }
89
- files . each do |file |
90
- puts file . gsub ( 'pkg' , "https://#{ release_bucket } .#{ release_bucket_s3_endpoint } " ) . gsub ( '+' , '%2B' )
91
- end
92
81
end
93
82
end
94
83
You can’t perform that action at this time.
0 commit comments