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
Boxiang Sun
gitlab-ce
Commits
f6223ffb
Commit
f6223ffb
authored
Oct 06, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move CI build page to CE project
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
ad627e40
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
249 additions
and
3 deletions
+249
-3
app/assets/stylesheets/ci/builds.scss
app/assets/stylesheets/ci/builds.scss
+7
-1
app/assets/stylesheets/generic/common.scss
app/assets/stylesheets/generic/common.scss
+4
-0
app/controllers/projects/builds_controller.rb
app/controllers/projects/builds_controller.rb
+25
-0
app/views/projects/builds/_build.html.haml
app/views/projects/builds/_build.html.haml
+50
-0
app/views/projects/builds/show.html.haml
app/views/projects/builds/show.html.haml
+159
-0
app/views/projects/commit/ci.html.haml
app/views/projects/commit/ci.html.haml
+2
-2
config/routes.rb
config/routes.rb
+2
-0
No files found.
app/assets/stylesheets/ci/builds.scss
View file @
f6223ffb
.
ci-body
{
.
build-page
{
pre
.trace
{
pre
.trace
{
background
:
#111111
;
background
:
#111111
;
color
:
#fff
;
color
:
#fff
;
...
@@ -67,4 +67,10 @@
...
@@ -67,4 +67,10 @@
color
:
#3084bb
!
important
;
color
:
#3084bb
!
important
;
}
}
}
}
.build-top-menu
{
margin-top
:
0
;
margin-bottom
:
2px
;
}
}
}
app/assets/stylesheets/generic/common.scss
View file @
f6223ffb
...
@@ -381,6 +381,10 @@ table {
...
@@ -381,6 +381,10 @@ table {
&
.no-bottom
{
&
.no-bottom
{
margin-bottom
:
0
;
margin-bottom
:
0
;
}
}
&
.no-top
{
margin-top
:
0
;
}
}
}
.dropzone
.dz-preview
.dz-progress
{
.dropzone
.dz-preview
.dz-progress
{
...
...
app/controllers/projects/builds_controller.rb
0 → 100644
View file @
f6223ffb
class
Projects::BuildsController
<
Projects
::
ApplicationController
before_action
:ci_project
before_action
:build
layout
"project"
def
show
@builds
=
@ci_project
.
commits
.
find_by_sha
(
@build
.
sha
).
builds
.
order
(
'id DESC'
)
@builds
=
@builds
.
where
(
"id not in (?)"
,
@build
.
id
).
page
(
params
[
:page
]).
per
(
20
)
@commit
=
@build
.
commit
respond_to
do
|
format
|
format
.
html
format
.
json
do
render
json:
@build
.
to_json
(
methods: :trace_html
)
end
end
end
private
def
build
@build
||=
ci_project
.
builds
.
unscoped
.
find_by
(
id:
params
[
:id
])
end
end
app/views/projects/builds/_build.html.haml
0 → 100644
View file @
f6223ffb
-
gl_project
=
build
.
project
.
gl_project
%tr
.build
%td
.status
=
ci_status_with_icon
(
build
.
status
)
%td
.build-link
=
link_to
namespace_project_build_path
(
gl_project
.
namespace
,
gl_project
,
build
)
do
%strong
Build ##{build.id}
-
if
defined?
(
ref
)
%td
=
build
.
ref
%td
=
build
.
stage
%td
=
build
.
name
.pull-right
-
if
build
.
tags
.
any?
-
build
.
tag_list
.
each
do
|
tag
|
%span
.label.label-primary
=
tag
-
if
build
.
trigger_request
%span
.label.label-info
triggered
-
if
build
.
allow_failure
%span
.label.label-danger
allowed to fail
%td
.duration
-
if
build
.
duration
#{
duration_in_words
(
build
.
finished_at
,
build
.
started_at
)
}
%td
.timestamp
-
if
build
.
finished_at
%span
#{
time_ago_in_words
build
.
finished_at
}
ago
-
if
build
.
project
.
coverage_enabled?
%td
.coverage
-
if
build
.
coverage
#{
build
.
coverage
}
%
%td
-
if
defined?
(
controls
)
&&
current_user
&&
can?
(
current_user
,
:manage_builds
,
gl_project
)
.pull-right
-
if
build
.
active?
=
link_to
cancel_ci_project_build_path
(
build
.
project
,
build
,
return_to:
request
.
original_url
),
title:
'Cancel build'
do
%i
.fa.fa-remove.cred
-
elsif
build
.
commands
.
present?
=
link_to
retry_ci_project_build_path
(
build
.
project
,
build
,
return_to:
request
.
original_url
),
method: :post
,
title:
'Retry build'
do
%i
.fa.fa-repeat
app/views/projects/builds/show.html.haml
0 → 100644
View file @
f6223ffb
.build-page
.gray-content-block
Build for commit
%strong
.monospace
=
link_to
@build
.
commit
.
short_sha
,
ci_status_path
(
@build
.
commit
)
from
%code
#{
@build
.
ref
}
#up-build-trace
-
if
@commit
.
matrix_for_ref?
(
@build
.
ref
)
%ul
.center-top-menu.build-top-menu
-
@commit
.
builds_without_retry_for_ref
(
@build
.
ref
).
each
do
|
build
|
%li
{
class:
(
'active'
if
build
==
@build
)
}
=
link_to
namespace_project_build_path
(
@project
.
namespace
,
@project
,
build
)
do
=
ci_icon_for_status
(
build
.
status
)
%span
-
if
build
.
name
=
build
.
name
-
else
=
build
.
id
-
unless
@commit
.
builds_without_retry_for_ref
(
@build
.
ref
).
include?
(
@build
)
%li
.active
%a
Build ##{@build.id}
·
%i
.fa.fa-warning-sign
This build was retried.
.gray-content-block.second-block
.build-head
.clearfix
=
ci_status_with_icon
(
@build
.
status
)
-
if
@build
.
duration
%span
%i
.fa.fa-time
#{
duration_in_words
(
@build
.
finished_at
,
@build
.
started_at
)
}
.pull-right
=
@build
.
updated_at
.
stamp
(
'19:00 Aug 27'
)
.row.prepend-top-default
.col-md-9
.clearfix
-
if
@build
.
active?
.autoscroll-container
%button
.btn.btn-success.btn-sm
#autoscroll-button
{
:type
=>
"button"
,
:data
=>
{
:state
=>
'disabled'
}}
enable autoscroll
.clearfix
.scroll-controls
=
link_to
'#up-build-trace'
,
class:
'btn'
do
%i
.fa.fa-angle-up
=
link_to
'#down-build-trace'
,
class:
'btn'
do
%i
.fa.fa-angle-down
%pre
.trace
#build-trace
%code
.bash
=
preserve
do
=
raw
@build
.
trace_html
%div
#down-build-trace
.col-md-3
-
if
@build
.
coverage
.build-widget
%h4
.title
Test coverage
%h1
#{
@build
.
coverage
}
%
.build-widget
%h4
.title
Build
-
if
current_user
&&
can?
(
current_user
,
:manage_builds
,
@project
)
.pull-right
-
if
@build
.
active?
=
link_to
"Cancel"
,
cancel_ci_project_build_path
(
@ci_project
,
@build
),
class:
'btn btn-sm btn-danger'
-
elsif
@build
.
commands
.
present?
=
link_to
"Retry"
,
retry_ci_project_build_path
(
@ci_project
,
@build
),
class:
'btn btn-sm btn-primary'
,
method: :post
-
if
@build
.
duration
%p
%span
.attr-name
Duration:
#{
duration_in_words
(
@build
.
finished_at
,
@build
.
started_at
)
}
%p
%span
.attr-name
Created:
#{
time_ago_in_words
(
@build
.
created_at
)
}
ago
-
if
@build
.
finished_at
%p
%span
.attr-name
Finished:
#{
time_ago_in_words
(
@build
.
finished_at
)
}
ago
%p
%span
.attr-name
Runner:
-
if
@build
.
runner
&&
current_user
&&
current_user
.
admin
\
#{
link_to
"##{@build.runner.id}"
,
ci_admin_runner_path
(
@build
.
runner
.
id
)
}
-
elsif
@build
.
runner
\##{@build.runner.id}
-
if
@build
.
trigger_request
.build-widget
%h4
.title
Trigger
%p
%span
.attr-name
Token:
#{
@build
.
trigger_request
.
trigger
.
short_token
}
-
if
@build
.
trigger_request
.
variables
%p
%span
.attr-name
Variables:
%code
-
@build
.
trigger_request
.
variables
.
each
do
|
key
,
value
|
#{
key
}
=
#{
value
}
.build-widget
%h4
.title
Commit
.pull-right
%small
#{
build_commit_link
@build
}
%p
%span
.attr-name
Branch:
#{
build_ref_link
@build
}
%p
%span
.attr-name
Author:
#{
@build
.
commit
.
git_author_name
}
%p
%span
.attr-name
Message:
#{
@build
.
commit
.
git_commit_message
}
-
if
@build
.
tags
.
any?
.build-widget
%h4
.title
Tags
-
@build
.
tag_list
.
each
do
|
tag
|
%span
.label.label-primary
=
tag
-
if
@builds
.
present?
.build-widget
%h4
.title
#{
pluralize
(
@builds
.
count
,
"other build"
)
}
for
#{
@build
.
short_sha
}
:
%table
.table.builds
-
@builds
.
each_with_index
do
|
build
,
i
|
%tr
.build
%td
=
ci_icon_for_status
(
build
.
status
)
%td
=
link_to
namespace_project_build_path
(
@project
.
namespace
,
@project
,
@build
)
do
-
if
build
.
name
=
build
.
name
-
else
%span
##{build.id}
%td
.status
=
build
.
status
=
paginate
@builds
:javascript
new
CiBuild
(
"
#{
namespace_project_build_path
(
@project
.
namespace
,
@project
,
@build
)
}
"
,
"
#{
@build
.
status
}
"
)
app/views/projects/commit/ci.html.haml
View file @
f6223ffb
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
-
if
@ci_project
&&
@ci_project
.
coverage_enabled?
-
if
@ci_project
&&
@ci_project
.
coverage_enabled?
%th
Coverage
%th
Coverage
%th
%th
=
render
partial:
"
ci
/builds/build"
,
collection:
@ci_commit
.
builds_without_retry
.
for_ref
(
ref
),
controls:
true
=
render
partial:
"
projects
/builds/build"
,
collection:
@ci_commit
.
builds_without_retry
.
for_ref
(
ref
),
controls:
true
-
if
@ci_commit
.
retried_builds
.
any?
-
if
@ci_commit
.
retried_builds
.
any?
%h3
%h3
...
@@ -59,4 +59,4 @@
...
@@ -59,4 +59,4 @@
-
if
@ci_project
&&
@ci_project
.
coverage_enabled?
-
if
@ci_project
&&
@ci_project
.
coverage_enabled?
%th
Coverage
%th
Coverage
%th
%th
=
render
partial:
"
ci
/builds/build"
,
collection:
@ci_commit
.
retried_builds
,
ref:
true
=
render
partial:
"
projects
/builds/build"
,
collection:
@ci_commit
.
retried_builds
,
ref:
true
config/routes.rb
View file @
f6223ffb
...
@@ -592,6 +592,8 @@ Gitlab::Application.routes.draw do
...
@@ -592,6 +592,8 @@ Gitlab::Application.routes.draw do
end
end
end
end
resources
:builds
,
only:
[
:show
]
resources
:hooks
,
only:
[
:index
,
:create
,
:destroy
],
constraints:
{
id:
/\d+/
}
do
resources
:hooks
,
only:
[
:index
,
:create
,
:destroy
],
constraints:
{
id:
/\d+/
}
do
member
do
member
do
get
:test
get
:test
...
...
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