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
0
Merge Requests
0
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
Kazuhiko Shiozaki
gitlab-ce
Commits
9e0e9342
Commit
9e0e9342
authored
Dec 28, 2015
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename method that returns url to CI build artifacts download
parent
612ab584
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
10 deletions
+14
-10
app/models/ci/build.rb
app/models/ci/build.rb
+1
-1
app/models/commit_status.rb
app/models/commit_status.rb
+5
-1
app/views/admin/builds/_build.html.haml
app/views/admin/builds/_build.html.haml
+2
-2
app/views/projects/builds/show.html.haml
app/views/projects/builds/show.html.haml
+2
-2
app/views/projects/commit_statuses/_commit_status.html.haml
app/views/projects/commit_statuses/_commit_status.html.haml
+2
-2
spec/models/build_spec.rb
spec/models/build_spec.rb
+2
-2
No files found.
app/models/ci/build.rb
View file @
9e0e9342
...
@@ -319,7 +319,7 @@ module Ci
...
@@ -319,7 +319,7 @@ module Ci
pending?
&&
!
any_runners_online?
pending?
&&
!
any_runners_online?
end
end
def
download_url
def
artifacts_
download_url
if
artifacts_file
.
exists?
if
artifacts_file
.
exists?
download_namespace_project_build_artifacts_path
(
project
.
namespace
,
project
,
self
)
download_namespace_project_build_artifacts_path
(
project
.
namespace
,
project
,
self
)
end
end
...
...
app/models/commit_status.rb
View file @
9e0e9342
...
@@ -131,7 +131,11 @@ class CommitStatus < ActiveRecord::Base
...
@@ -131,7 +131,11 @@ class CommitStatus < ActiveRecord::Base
false
false
end
end
def
download_url
def
artifacts_download_url
nil
end
def
artifacts_browse_url
nil
nil
end
end
end
end
app/views/admin/builds/_build.html.haml
View file @
9e0e9342
...
@@ -60,8 +60,8 @@
...
@@ -60,8 +60,8 @@
%td
%td
.pull-right
.pull-right
-
if
current_user
&&
can?
(
current_user
,
:download_build_artifacts
,
project
)
&&
build
.
download_url
-
if
current_user
&&
can?
(
current_user
,
:download_build_artifacts
,
project
)
&&
build
.
artifacts_file
.
exist?
=
link_to
build
.
download_url
,
title:
'Download artifacts'
do
=
link_to
build
.
artifacts_
download_url
,
title:
'Download artifacts'
do
%i
.fa.fa-download
%i
.fa.fa-download
-
if
current_user
&&
can?
(
current_user
,
:manage_builds
,
build
.
project
)
-
if
current_user
&&
can?
(
current_user
,
:manage_builds
,
build
.
project
)
-
if
build
.
active?
-
if
build
.
active?
...
...
app/views/projects/builds/show.html.haml
View file @
9e0e9342
...
@@ -89,13 +89,13 @@
...
@@ -89,13 +89,13 @@
Test coverage
Test coverage
%h1
#{
@build
.
coverage
}
%
%h1
#{
@build
.
coverage
}
%
-
if
current_user
&&
can?
(
current_user
,
:download_build_artifacts
,
@project
)
&&
@build
.
download_url
-
if
current_user
&&
can?
(
current_user
,
:download_build_artifacts
,
@project
)
&&
@build
.
artifacts_file
.
exist?
.build-widget.center
.build-widget.center
.panel.panel-default
.panel.panel-default
.panel-heading
Build artifacts
.panel-heading
Build artifacts
.panel-body
.panel-body
.btn-group
{
role: :group
}
.btn-group
{
role: :group
}
=
link_to
"Download"
,
@build
.
download_url
,
class:
'btn btn-sm btn-primary'
=
link_to
"Download"
,
@build
.
artifacts_
download_url
,
class:
'btn btn-sm btn-primary'
=
link_to
"Browse"
,
@build
.
artifacts_browse_url
,
class:
'btn btn-sm btn-primary'
=
link_to
"Browse"
,
@build
.
artifacts_browse_url
,
class:
'btn btn-sm btn-primary'
.build-widget
.build-widget
...
...
app/views/projects/commit_statuses/_commit_status.html.haml
View file @
9e0e9342
...
@@ -66,8 +66,8 @@
...
@@ -66,8 +66,8 @@
%td
%td
.pull-right
.pull-right
-
if
current_user
&&
can?
(
current_user
,
:download_build_artifacts
,
commit_status
.
project
)
&&
commit_status
.
download_url
-
if
current_user
&&
can?
(
current_user
,
:download_build_artifacts
,
commit_status
.
project
)
&&
commit_status
.
artifacts_file
.
exist?
=
link_to
commit_status
.
download_url
,
title:
'Download artifacts'
do
=
link_to
commit_status
.
artifacts_
download_url
,
title:
'Download artifacts'
do
%i
.fa.fa-download
%i
.fa.fa-download
-
if
current_user
&&
can?
(
current_user
,
:manage_builds
,
commit_status
.
project
)
-
if
current_user
&&
can?
(
current_user
,
:manage_builds
,
commit_status
.
project
)
-
if
commit_status
.
active?
-
if
commit_status
.
active?
...
...
spec/models/build_spec.rb
View file @
9e0e9342
...
@@ -368,8 +368,8 @@ describe Ci::Build, models: true do
...
@@ -368,8 +368,8 @@ describe Ci::Build, models: true do
end
end
end
end
describe
:download_url
do
describe
:
artifacts_
download_url
do
subject
{
build
.
download_url
}
subject
{
build
.
artifacts_
download_url
}
it
"should be nil if artifact doesn't exist"
do
it
"should be nil if artifact doesn't exist"
do
build
.
update_attributes
(
artifacts_file:
nil
)
build
.
update_attributes
(
artifacts_file:
nil
)
...
...
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