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
73467bd1
Commit
73467bd1
authored
Nov 02, 2016
by
Annabel Dunstone Gray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add switch statement & last_deployment method
parent
52c06647
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
app/assets/stylesheets/pages/builds.scss
app/assets/stylesheets/pages/builds.scss
+6
-0
app/models/ci/build.rb
app/models/ci/build.rb
+6
-0
app/views/projects/builds/show.html.haml
app/views/projects/builds/show.html.haml
+19
-3
No files found.
app/assets/stylesheets/pages/builds.scss
View file @
73467bd1
...
@@ -46,6 +46,12 @@
...
@@ -46,6 +46,12 @@
border
:
1px
solid
$border-color
;
border
:
1px
solid
$border-color
;
padding
:
12px
$gl-padding
;
padding
:
12px
$gl-padding
;
border-radius
:
$border-radius-default
;
border-radius
:
$border-radius-default
;
svg
{
position
:
relative
;
top
:
1px
;
margin-right
:
5px
;
}
}
}
}
}
...
...
app/models/ci/build.rb
View file @
73467bd1
...
@@ -125,6 +125,12 @@ module Ci
...
@@ -125,6 +125,12 @@ module Ci
!
self
.
pipeline
.
statuses
.
latest
.
include?
(
self
)
!
self
.
pipeline
.
statuses
.
latest
.
include?
(
self
)
end
end
def
last_deployment
return
@last_deployment
if
defined?
(
@last_deployment
)
@last_deployment
=
Deployment
.
where
(
deployable:
self
).
order
(
id: :desc
).
last
end
def
depends_on_builds
def
depends_on_builds
# Get builds of the same type
# Get builds of the same type
latest_builds
=
self
.
pipeline
.
builds
.
latest
latest_builds
=
self
.
pipeline
.
builds
.
latest
...
...
app/views/projects/builds/show.html.haml
View file @
73467bd1
...
@@ -26,12 +26,28 @@
...
@@ -26,12 +26,28 @@
=
link_to
namespace_project_runners_path
(
@build
.
project
.
namespace
,
@build
.
project
)
do
=
link_to
namespace_project_runners_path
(
@build
.
project
.
namespace
,
@build
.
project
)
do
Runners page
Runners page
-
if
@build
.
stage
==
'deploy'
-
if
@build
.
deploy
.prepend-top-default
.prepend-top-default
.environment-information
.environment-information
=
ci_icon_for_status
(
@build
.
status
)
=
ci_icon_for_status
(
@build
.
status
)
This build is the most recent deployment to
=
link_to
@build
.
environment
,
namespace_project_environment_path
(
@project
.
namespace
,
@project
,
@build
.
environment
)
-
if
@build
.
last_deployment
This build is the most recent deployment to
=
link_to
@build
.
environment
,
namespace_project_environment_path
(
@project
.
namespace
,
@project
,
@build
.
environment
)
-
else
-
case
@build
.
status
-
when
'failed'
,
'canceled'
The deployment of this build to
=
link_to
@build
.
environment
,
namespace_project_environment_path
(
@project
.
namespace
,
@project
,
@build
.
environment
)
did not complete
-
when
'pending'
,
'running'
This build is creating a deployment to
=
link_to
@build
.
environment
,
namespace_project_environment_path
(
@project
.
namespace
,
@project
,
@build
.
environment
)
and will overwrite the latest deployment
-
when
'success'
This build is an out-of-date deployment to
=
link_to
@build
.
environment
,
namespace_project_environment_path
(
@project
.
namespace
,
@project
,
@build
.
environment
)
View the most recent deployment #24869
.prepend-top-default
.prepend-top-default
-
if
@build
.
erased?
-
if
@build
.
erased?
...
...
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