Skip to content

Commit 3b92f00

Browse files
committed
Move GCP bucket related information to GCloudHelper
This information is used only in GCloudHelper and no where else. So, it makes sense for it to stay in that class. Signed-off-by: Balasankar "Balu" C <[email protected]>
1 parent e982d7a commit 3b92f00

File tree

3 files changed

+9
-38
lines changed

3 files changed

+9
-38
lines changed

lib/gitlab/build/info.rb

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,6 @@
99
module Build
1010
class Info
1111
class << self
12-
def gcp_release_bucket
13-
# All tagged builds are pushed to the release bucket
14-
# whereas regular branch builds use a separate one
15-
gcp_pkgs_release_bucket = Gitlab::Util.get_env('GITLAB_COM_PKGS_RELEASE_BUCKET') || 'gitlab-com-pkgs-release'
16-
gcp_pkgs_builds_bucket = Gitlab::Util.get_env('GITLAB_COM_PKGS_BUILDS_BUCKET') || 'gitlab-com-pkgs-builds'
17-
Check.on_tag? ? gcp_pkgs_release_bucket : gcp_pkgs_builds_bucket
18-
end
19-
20-
def gcp_release_bucket_sa_file
21-
Gitlab::Util.get_env('GITLAB_COM_PKGS_SA_FILE')
22-
end
23-
2412
def log_level
2513
if Gitlab::Util.get_env('BUILD_LOG_LEVEL') && !Gitlab::Util.get_env('BUILD_LOG_LEVEL').empty?
2614
Gitlab::Util.get_env('BUILD_LOG_LEVEL')

lib/gitlab/gcloud_helper.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
require 'google/cloud/storage'
2-
require_relative './build/info.rb'
2+
3+
require_relative 'build/check'
4+
require_relative 'util'
35

46
class GCloudHelper
57
class << self
@@ -30,11 +32,15 @@ def upload_packages_and_print_urls(dir)
3032
private
3133

3234
def sa_file
33-
Build::Info.gcp_release_bucket_sa_file
35+
Gitlab::Util.get_env('GITLAB_COM_PKGS_SA_FILE')
3436
end
3537

3638
def pkgs_bucket
37-
Build::Info.gcp_release_bucket
39+
# All tagged builds are pushed to the release bucket
40+
# whereas regular branch builds use a separate one
41+
gcp_pkgs_release_bucket = Gitlab::Util.get_env('GITLAB_COM_PKGS_RELEASE_BUCKET') || 'gitlab-com-pkgs-release'
42+
gcp_pkgs_builds_bucket = Gitlab::Util.get_env('GITLAB_COM_PKGS_BUILDS_BUCKET') || 'gitlab-com-pkgs-builds'
43+
Build::Check.on_tag? ? gcp_pkgs_release_bucket : gcp_pkgs_builds_bucket
3844
end
3945
end
4046
end

spec/lib/gitlab/build/info_spec.rb

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)