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
fca02e24
Commit
fca02e24
authored
Mar 27, 2018
by
Eric Eastwood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update styling and use Gitlab::Utils.to_boolean
parent
de0c4730
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
9 deletions
+26
-9
app/helpers/page_layout_helper.rb
app/helpers/page_layout_helper.rb
+2
-1
app/serializers/status_entity.rb
app/serializers/status_entity.rb
+8
-7
changelogs/unreleased/add-canary-favicon.yml
changelogs/unreleased/add-canary-favicon.yml
+5
-0
spec/helpers/page_layout_helper_spec.rb
spec/helpers/page_layout_helper_spec.rb
+5
-0
spec/serializers/status_entity_spec.rb
spec/serializers/status_entity_spec.rb
+5
-0
vendor/gitlab-ci-yml/autodeploy/Kubernetes-with-canary.gitlab-ci.yml
...ab-ci-yml/autodeploy/Kubernetes-with-canary.gitlab-ci.yml
+1
-1
No files found.
app/helpers/page_layout_helper.rb
View file @
fca02e24
...
...
@@ -39,8 +39,9 @@ module PageLayoutHelper
end
def
favicon
return
'favicon-yellow.ico'
if
ENV
[
'CANARY'
]
==
'true'
return
'favicon-yellow.ico'
if
Gitlab
::
Utils
.
to_boolean
(
ENV
[
'CANARY'
])
return
'favicon-blue.ico'
if
Rails
.
env
.
development?
'favicon.ico'
end
...
...
app/serializers/status_entity.rb
View file @
fca02e24
...
...
@@ -7,13 +7,14 @@ class StatusEntity < Grape::Entity
expose
:details_path
expose
:favicon
do
|
status
|
dir
=
'ci_favicons'
if
ENV
[
'CANARY'
]
dir
=
File
.
join
(
dir
,
'canary'
)
elsif
Rails
.
env
.
development?
dir
=
File
.
join
(
dir
,
'dev'
)
end
dir
=
if
Gitlab
::
Utils
.
to_boolean
(
ENV
[
'CANARY'
])
File
.
join
(
'ci_favicons'
,
'canary'
)
elsif
Rails
.
env
.
development?
File
.
join
(
'ci_favicons'
,
'dev'
)
else
'ci_favicons'
end
ActionController
::
Base
.
helpers
.
image_path
(
File
.
join
(
dir
,
"
#{
status
.
favicon
}
.ico"
))
end
...
...
changelogs/unreleased/add-canary-favicon.yml
0 → 100644
View file @
fca02e24
---
title
:
Add yellow favicon to differientate canary environment
merge_request
:
12477
author
:
type
:
changed
spec/helpers/page_layout_helper_spec.rb
View file @
fca02e24
...
...
@@ -50,6 +50,11 @@ describe PageLayoutHelper do
allow
(
Rails
).
to
receive
(
:env
).
and_return
(
ActiveSupport
::
StringInquirer
.
new
(
'development'
))
expect
(
helper
.
favicon
).
to
eq
'favicon-blue.ico'
end
it
'has yellow favicon for canary'
do
stub_env
(
'CANARY'
,
'true'
)
expect
(
helper
.
favicon
).
to
eq
'favicon-yellow.ico'
end
end
describe
'page_image'
do
...
...
spec/serializers/status_entity_spec.rb
View file @
fca02e24
...
...
@@ -25,5 +25,10 @@ describe StatusEntity do
allow
(
Rails
.
env
).
to
receive
(
:development?
)
{
true
}
expect
(
entity
.
as_json
[
:favicon
]).
to
match_asset_path
(
'/assets/ci_favicons/dev/favicon_status_success.ico'
)
end
it
'contains a canavary namespaced favicon if canary env'
do
stub_env
(
'CANARY'
,
'true'
)
expect
(
entity
.
as_json
[
:favicon
]).
to
match_asset_path
(
'/assets/ci_favicons/canary/favicon_status_success.ico'
)
end
end
end
vendor/gitlab-ci-yml/autodeploy/Kubernetes-with-canary.gitlab-ci.yml
View file @
fca02e24
...
...
@@ -28,7 +28,7 @@ build:
canary
:
stage
:
canary
script
:
-
CANARY=true
command canary
-
command canary
environment
:
name
:
production
url
:
http://$CI_PROJECT_PATH_SLUG.$KUBE_DOMAIN
...
...
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