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
53fccf8d
Commit
53fccf8d
authored
May 05, 2020
by
ddavison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Pipeline resource
Add pipelines method to project resource
parent
504fc45d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
0 deletions
+62
-0
qa/qa.rb
qa/qa.rb
+1
-0
qa/qa/resource/pipeline.rb
qa/qa/resource/pipeline.rb
+53
-0
qa/qa/resource/project.rb
qa/qa/resource/project.rb
+8
-0
No files found.
qa/qa.rb
View file @
53fccf8d
...
...
@@ -72,6 +72,7 @@ module QA
autoload
:DeployKey
,
'qa/resource/deploy_key'
autoload
:DeployToken
,
'qa/resource/deploy_token'
autoload
:ProtectedBranch
,
'qa/resource/protected_branch'
autoload
:Pipeline
,
'qa/resource/pipeline'
autoload
:CiVariable
,
'qa/resource/ci_variable'
autoload
:Runner
,
'qa/resource/runner'
autoload
:PersonalAccessToken
,
'qa/resource/personal_access_token'
...
...
qa/qa/resource/pipeline.rb
0 → 100644
View file @
53fccf8d
# frozen_string_literal: true
module
QA
module
Resource
class
Pipeline
<
Base
attribute
:project
do
Resource
::
Project
.
fabricate!
do
|
project
|
project
.
name
=
'project-with-pipeline'
end
end
attribute
:id
attribute
:status
attribute
:ref
attribute
:sha
# array in form
# [
# { key: 'UPLOAD_TO_S3', variable_type: 'file', value: true },
# { key: 'SOMETHING', variable_type: 'env_var', value: 'yes' }
# ]
attribute
:variables
def
initialize
@ref
=
'master'
@variables
=
[]
end
def
fabricate!
project
.
visit!
Page
::
Project
::
Menu
.
perform
(
&
:click_ci_cd_pipelines
)
Page
::
Project
::
Pipeline
::
Index
.
perform
(
&
:click_run_pipeline_button
)
Page
::
Project
::
Pipeline
::
New
.
perform
(
&
:click_run_pipeline_button
)
end
def
api_get_path
"/projects/
#{
project
.
id
}
/pipelines/
#{
id
}
"
end
def
api_post_path
"/projects/
#{
project
.
id
}
/pipeline"
end
def
api_post_body
{
ref:
ref
,
variables:
variables
}
end
end
end
end
qa/qa/resource/project.rb
View file @
53fccf8d
...
...
@@ -100,6 +100,10 @@ module QA
"
#{
api_get_path
}
/runners"
end
def
api_pipelines_path
"
#{
api_get_path
}
/pipelines"
end
def
api_put_path
"/projects/
#{
id
}
"
end
...
...
@@ -161,6 +165,10 @@ module QA
parse_body
(
response
)
end
def
pipelines
parse_body
(
get
(
Runtime
::
API
::
Request
.
new
(
api_client
,
api_pipelines_path
).
url
))
end
def
share_with_group
(
invitee
,
access_level
=
Resource
::
Members
::
AccessLevel
::
DEVELOPER
)
post
Runtime
::
API
::
Request
.
new
(
api_client
,
"/projects/
#{
id
}
/share"
).
url
,
{
group_id:
invitee
.
id
,
group_access:
access_level
}
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