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
46eeaafc
Commit
46eeaafc
authored
Apr 20, 2018
by
Dylan Griffith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display help text below auto devops domain with nip.io domain name (#45561)
parent
416a5450
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
50 additions
and
6 deletions
+50
-6
app/helpers/auto_devops_helper.rb
app/helpers/auto_devops_helper.rb
+9
-0
app/models/project.rb
app/models/project.rb
+1
-0
app/views/projects/settings/ci_cd/_autodevops_form.html.haml
app/views/projects/settings/ci_cd/_autodevops_form.html.haml
+3
-1
changelogs/unreleased/45584-add-nip-io-domain-suggestion-in-auto-devops.yml
...sed/45584-add-nip-io-domain-suggestion-in-auto-devops.yml
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+8
-5
spec/features/projects/settings/pipelines_settings_spec.rb
spec/features/projects/settings/pipelines_settings_spec.rb
+23
-0
spec/lib/gitlab/import_export/all_models.yml
spec/lib/gitlab/import_export/all_models.yml
+1
-0
No files found.
app/helpers/auto_devops_helper.rb
View file @
46eeaafc
...
@@ -24,6 +24,15 @@ module AutoDevopsHelper
...
@@ -24,6 +24,15 @@ module AutoDevopsHelper
end
end
end
end
def
cluster_ingress_ip
(
project
)
project
.
cluster_ingresses
.
where
(
"external_ip is not null"
)
.
limit
(
1
)
.
pluck
(
:external_ip
)
.
first
end
private
private
def
missing_auto_devops_domain?
(
project
)
def
missing_auto_devops_domain?
(
project
)
...
...
app/models/project.rb
View file @
46eeaafc
...
@@ -217,6 +217,7 @@ class Project < ActiveRecord::Base
...
@@ -217,6 +217,7 @@ class Project < ActiveRecord::Base
has_one
:cluster_project
,
class_name:
'Clusters::Project'
has_one
:cluster_project
,
class_name:
'Clusters::Project'
has_many
:clusters
,
through: :cluster_project
,
class_name:
'Clusters::Cluster'
has_many
:clusters
,
through: :cluster_project
,
class_name:
'Clusters::Cluster'
has_many
:cluster_ingresses
,
through: :clusters
,
source: :application_ingress
,
class_name:
'Clusters::Applications::Ingress'
# Container repositories need to remove data from the container registry,
# Container repositories need to remove data from the container registry,
# which is not managed by the DB. Hence we're still using dependent: :destroy
# which is not managed by the DB. Hence we're still using dependent: :destroy
...
...
app/views/projects/settings/ci_cd/_autodevops_form.html.haml
View file @
46eeaafc
...
@@ -35,7 +35,9 @@
...
@@ -35,7 +35,9 @@
=
_
(
'Domain'
)
=
_
(
'Domain'
)
=
form
.
text_field
:domain
,
class:
'form-control'
,
placeholder:
'domain.com'
=
form
.
text_field
:domain
,
class:
'form-control'
,
placeholder:
'domain.com'
.help-block
.help-block
=
s_
(
'CICD|You need to specify a domain if you want to use Auto Review Apps and Auto Deploy stages.'
)
=
s_
(
'CICD|A domain is required to use Auto Review Apps and Auto Deploy Stages.'
)
-
if
cluster_ingress_ip
=
cluster_ingress_ip
(
@project
)
=
s_
(
'%{nip_domain} can be used as an alternative to a custom domain.'
).
html_safe
%
{
nip_domain:
"<code>
#{
cluster_ingress_ip
}
.nip.io</code>"
.
html_safe
}
=
link_to
icon
(
'question-circle'
),
help_page_path
(
'topics/autodevops/index.md'
,
anchor:
'auto-devops-base-domain'
),
target:
'_blank'
=
link_to
icon
(
'question-circle'
),
help_page_path
(
'topics/autodevops/index.md'
,
anchor:
'auto-devops-base-domain'
),
target:
'_blank'
=
f
.
submit
'Save changes'
,
class:
"btn btn-success prepend-top-15"
=
f
.
submit
'Save changes'
,
class:
"btn btn-success prepend-top-15"
changelogs/unreleased/45584-add-nip-io-domain-suggestion-in-auto-devops.yml
0 → 100644
View file @
46eeaafc
---
title
:
Display help text below auto devops domain with nip.io domain name (#45561)
merge_request
:
18496
author
:
type
:
added
locale/gitlab.pot
View file @
46eeaafc
...
@@ -8,8 +8,8 @@ msgid ""
...
@@ -8,8 +8,8 @@ msgid ""
msgstr ""
msgstr ""
"Project-Id-Version: gitlab 1.0.0\n"
"Project-Id-Version: gitlab 1.0.0\n"
"Report-Msgid-Bugs-To: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-05-
09 09:24
+0200\n"
"POT-Creation-Date: 2018-05-
14 10:49
+0200\n"
"PO-Revision-Date: 2018-05-
09 09:24
+0200\n"
"PO-Revision-Date: 2018-05-
14 10:49
+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"Language: \n"
...
@@ -72,6 +72,9 @@ msgstr[1] ""
...
@@ -72,6 +72,9 @@ msgstr[1] ""
msgid "%{loadingIcon} Started"
msgid "%{loadingIcon} Started"
msgstr ""
msgstr ""
msgid "%{nip_domain} can be used as an alternative to a custom domain."
msgstr ""
msgid "%{number_commits_behind} commits behind %{default_branch}, %{number_commits_ahead} commits ahead"
msgid "%{number_commits_behind} commits behind %{default_branch}, %{number_commits_ahead} commits ahead"
msgstr ""
msgstr ""
...
@@ -737,6 +740,9 @@ msgstr ""
...
@@ -737,6 +740,9 @@ msgstr ""
msgid "CI/CD settings"
msgid "CI/CD settings"
msgstr ""
msgstr ""
msgid "CICD|A domain is required to use Auto Review Apps and Auto Deploy Stages."
msgstr ""
msgid "CICD|An explicit %{ci_file} needs to be specified before you can begin using Continuous Integration and Delivery."
msgid "CICD|An explicit %{ci_file} needs to be specified before you can begin using Continuous Integration and Delivery."
msgstr ""
msgstr ""
...
@@ -767,9 +773,6 @@ msgstr ""
...
@@ -767,9 +773,6 @@ msgstr ""
msgid "CICD|The Auto DevOps pipeline configuration will be used when there is no %{ci_file} in the project."
msgid "CICD|The Auto DevOps pipeline configuration will be used when there is no %{ci_file} in the project."
msgstr ""
msgstr ""
msgid "CICD|You need to specify a domain if you want to use Auto Review Apps and Auto Deploy stages."
msgstr ""
msgid "Can run untagged jobs"
msgid "Can run untagged jobs"
msgstr ""
msgstr ""
...
...
spec/features/projects/settings/pipelines_settings_spec.rb
View file @
46eeaafc
...
@@ -75,6 +75,29 @@ describe "Projects > Settings > Pipelines settings" do
...
@@ -75,6 +75,29 @@ describe "Projects > Settings > Pipelines settings" do
expect
(
project
.
auto_devops
).
not_to
be_enabled
expect
(
project
.
auto_devops
).
not_to
be_enabled
expect
(
project
.
auto_devops
.
domain
).
to
eq
(
'test.com'
)
expect
(
project
.
auto_devops
.
domain
).
to
eq
(
'test.com'
)
end
end
context
'when there is a cluster with ingress and external_ip'
do
before
do
cluster
=
create
(
:cluster
,
projects:
[
project
])
cluster
.
create_application_ingress!
(
external_ip:
'192.168.1.100'
)
end
it
'shows the help text with the nip.io domain as an alternative to custom domain'
do
visit
project_settings_ci_cd_path
(
project
)
expect
(
page
).
to
have_content
(
'192.168.1.100.nip.io can be used as an alternative to a custom domain'
)
end
end
context
'when there is no ingress'
do
before
do
create
(
:cluster
,
projects:
[
project
])
end
it
'alternative to custom domain is not shown'
do
visit
project_settings_ci_cd_path
(
project
)
expect
(
page
).
not_to
have_content
(
'can be used as an alternative to a custom domain'
)
end
end
end
end
end
end
end
end
spec/lib/gitlab/import_export/all_models.yml
View file @
46eeaafc
...
@@ -185,6 +185,7 @@ project:
...
@@ -185,6 +185,7 @@ project:
-
cluster
-
cluster
-
clusters
-
clusters
-
cluster_project
-
cluster_project
-
cluster_ingresses
-
creator
-
creator
-
group
-
group
-
namespace
-
namespace
...
...
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