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
Jérome Perrin
gitlab-ce
Commits
4eb53036
Commit
4eb53036
authored
Dec 07, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes after review
parent
2dc907bc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
24 deletions
+19
-24
app/helpers/environment_helper.rb
app/helpers/environment_helper.rb
+4
-6
app/views/projects/builds/show.html.haml
app/views/projects/builds/show.html.haml
+1
-1
spec/features/projects/builds_spec.rb
spec/features/projects/builds_spec.rb
+14
-17
No files found.
app/helpers/environment_helper.rb
View file @
4eb53036
...
...
@@ -14,14 +14,12 @@ module EnvironmentHelper
end
end
def
deployment_link
(
deployment
,
text
)
def
deployment_link
(
deployment
,
text
:
nil
)
return
unless
deployment
if
text
link_to
text
,
[
deployment
.
project
.
namespace
.
becomes
(
Namespace
),
deployment
.
project
,
deployment
.
deployable
]
else
link_to
"#
#{
deployment
.
iid
}
"
,
[
deployment
.
project
.
namespace
.
becomes
(
Namespace
),
deployment
.
project
,
deployment
.
deployable
]
end
link_label
=
text
?
text
:
"#
#{
deployment
.
iid
}
"
link_to
link_label
,
[
deployment
.
project
.
namespace
.
becomes
(
Namespace
),
deployment
.
project
,
deployment
.
deployable
]
end
def
last_deployment_link_for_environment_build
(
project
,
build
)
...
...
app/views/projects/builds/show.html.haml
View file @
4eb53036
...
...
@@ -46,7 +46,7 @@
-
else
This build is creating a deployment to
#{
environment_link_for_build
(
@build
.
project
,
@build
)
}
-
if
environment
.
try
(
:last_deployment
)
and will overwrite the
#{
deployment_link
(
environment
.
last_deployment
,
'latest deployment'
)
}
and will overwrite the
#{
deployment_link
(
environment
.
last_deployment
,
text:
'latest deployment'
)
}
.prepend-top-default
-
if
@build
.
erased?
...
...
spec/features/projects/builds_spec.rb
View file @
4eb53036
...
...
@@ -229,39 +229,36 @@ feature 'Builds', :feature do
end
context
'when build starts environment'
do
let
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
context
'build is successfull and has deployment'
do
it
'shows a link for the build'
do
environment
=
create
(
:environment
,
project:
project
)
pipeline
=
create
(
:ci_pipeline
,
project:
project
)
deployment
=
create
(
:deployment
)
build1
=
create
(
:ci_build
,
:success
,
environment:
environment
.
name
,
deployments:
[
deployment
],
pipeline:
pipeline
)
let
(
:deployment
)
{
create
(
:deployment
)
}
let
(
:build
)
{
create
(
:ci_build
,
:success
,
environment:
environment
.
name
,
deployments:
[
deployment
],
pipeline:
pipeline
)
}
visit
namespace_project_build_path
(
project
.
namespace
,
project
,
build1
)
it
'shows a link for the build'
do
visit
namespace_project_build_path
(
project
.
namespace
,
project
,
build
)
expect
(
page
).
to
have_link
environment
.
name
end
end
context
'build is complete and not successfull'
do
it
'shows a link for the build'
do
environment
=
create
(
:environment
,
project:
project
)
pipeline
=
create
(
:ci_pipeline
,
project:
project
)
build1
=
create
(
:ci_build
,
:failed
,
environment:
environment
.
name
,
pipeline:
pipeline
)
let
(
:build
)
{
create
(
:ci_build
,
:failed
,
environment:
environment
.
name
,
pipeline:
pipeline
)
}
visit
namespace_project_build_path
(
project
.
namespace
,
project
,
build1
)
it
'shows a link for the build'
do
visit
namespace_project_build_path
(
project
.
namespace
,
project
,
build
)
expect
(
page
).
to
have_link
environment
.
name
end
end
context
'build creates a new deployment'
do
it
'shows a link to lastest deployment'
do
environment
=
create
(
:environment
,
project:
project
)
create
(
:deployment
,
environment:
environment
,
sha:
project
.
commit
.
id
)
pipeline
=
create
(
:ci_pipeline
,
project:
project
)
build1
=
create
(
:ci_build
,
:success
,
environment:
environment
.
name
,
pipeline:
pipeline
)
let!
(
:deployment
)
{
create
(
:deployment
,
environment:
environment
,
sha:
project
.
commit
.
id
)
}
let
(
:build
)
{
create
(
:ci_build
,
:success
,
environment:
environment
.
name
,
pipeline:
pipeline
)
}
visit
namespace_project_build_path
(
project
.
namespace
,
project
,
build1
)
it
'shows a link to lastest deployment'
do
visit
namespace_project_build_path
(
project
.
namespace
,
project
,
build
)
expect
(
page
).
to
have_link
(
'latest deployment'
)
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