Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d2df9a11
Commit
d2df9a11
authored
Dec 29, 2021
by
Andrejs Cunskis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Detect if knapsack gcs credentials is a file path or json string
parent
ccf33f48
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
qa/qa/tools/knapsack_report.rb
qa/qa/tools/knapsack_report.rb
+7
-7
No files found.
qa/qa/tools/knapsack_report.rb
View file @
d2df9a11
...
...
@@ -95,10 +95,7 @@ module QA
#
# @return [Fog::Storage::GoogleJSON]
def
client
@client
||=
Fog
::
Storage
::
Google
.
new
(
google_project:
PROJECT
,
google_json_key_location:
gcs_credentials
)
@client
||=
Fog
::
Storage
::
Google
.
new
(
google_project:
PROJECT
,
**
gcs_credentials
)
end
# Base path of knapsack report
...
...
@@ -132,13 +129,16 @@ module QA
@report_name
||=
ENV
[
"CI_JOB_NAME"
].
split
(
" "
).
first
.
tr
(
":"
,
"-"
)
end
#
Path to
GCS credentials json
# GCS credentials json
#
# @return [
String
]
# @return [
Hash
]
def
gcs_credentials
@gcs_credentials
||
=
ENV
[
"QA_KNAPSACK_REPORT_GCS_CREDENTIALS"
]
||
raise
(
json_key
=
ENV
[
"QA_KNAPSACK_REPORT_GCS_CREDENTIALS"
]
||
raise
(
"QA_KNAPSACK_REPORT_GCS_CREDENTIALS env variable is required!"
)
return
{
google_json_key_location:
json_key
}
if
File
.
exist?
(
json_key
)
{
google_json_key_string:
json_key
}
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment