Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
770bcf71
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
770bcf71
编写于
8月 30, 2017
作者:
Z
Zeger-Jan van de Weg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Form for setting project auto devops settings
上级
6ed49040
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
62 addition
and
19 deletion
+62
-19
app/controllers/projects/pipelines_settings_controller.rb
app/controllers/projects/pipelines_settings_controller.rb
+5
-7
app/controllers/projects/settings/ci_cd_controller.rb
app/controllers/projects/settings/ci_cd_controller.rb
+5
-0
app/models/project.rb
app/models/project.rb
+1
-0
app/views/admin/application_settings/_form.html.haml
app/views/admin/application_settings/_form.html.haml
+6
-2
app/views/projects/pipelines_settings/_show.html.haml
app/views/projects/pipelines_settings/_show.html.haml
+39
-5
db/migrate/20170828093725_create_project_auto_dev_ops.rb
db/migrate/20170828093725_create_project_auto_dev_ops.rb
+1
-1
db/schema.rb
db/schema.rb
+2
-3
lib/gitlab/import_export/import_export.yml
lib/gitlab/import_export/import_export.yml
+2
-1
spec/lib/gitlab/import_export/all_models.yml
spec/lib/gitlab/import_export/all_models.yml
+1
-0
未找到文件。
app/controllers/projects/pipelines_settings_controller.rb
浏览文件 @
770bcf71
...
...
@@ -6,7 +6,7 @@ class Projects::PipelinesSettingsController < Projects::ApplicationController
end
def
update
if
@project
.
update
_attributes
(
update_params
)
if
@project
.
update
(
update_params
)
flash
[
:notice
]
=
"Pipelines settings for '
#{
@project
.
name
}
' were successfully updated."
redirect_to
project_settings_ci_cd_path
(
@project
)
else
...
...
@@ -16,14 +16,12 @@ class Projects::PipelinesSettingsController < Projects::ApplicationController
private
def
create_params
params
.
require
(
:pipeline
).
permit
(
:ref
)
end
def
update_params
params
.
require
(
:project
).
permit
(
:runners_token
,
:builds_enabled
,
:build_allow_git_fetch
,
:build_timeout_in_minutes
,
:build_coverage_regex
,
:public_builds
,
:auto_cancel_pending_pipelines
,
:ci_config_path
:runners_token
,
:builds_enabled
,
:build_allow_git_fetch
,
:build_timeout_in_minutes
,
:build_coverage_regex
,
:public_builds
,
:auto_cancel_pending_pipelines
,
:ci_config_path
,
auto_devops_attributes:
[
:id
,
:domain
,
:enabled
]
)
end
end
app/controllers/projects/settings/ci_cd_controller.rb
浏览文件 @
770bcf71
...
...
@@ -8,6 +8,7 @@ module Projects
define_secret_variables
define_triggers_variables
define_badges_variables
define_auto_devops_variables
end
private
...
...
@@ -42,6 +43,10 @@ module Projects
badge
.
new
(
@project
,
@ref
).
metadata
end
end
def
define_auto_devops_variables
@auto_devops
=
@project
.
auto_devops
||
ProjectAutoDevops
.
new
end
end
end
end
app/models/project.rb
浏览文件 @
770bcf71
...
...
@@ -191,6 +191,7 @@ class Project < ActiveRecord::Base
accepts_nested_attributes_for
:variables
,
allow_destroy:
true
accepts_nested_attributes_for
:project_feature
accepts_nested_attributes_for
:import_data
accepts_nested_attributes_for
:auto_devops
delegate
:name
,
to: :owner
,
allow_nil:
true
,
prefix:
true
delegate
:members
,
to: :team
,
prefix:
true
...
...
app/views/admin/application_settings/_form.html.haml
浏览文件 @
770bcf71
...
...
@@ -217,13 +217,17 @@
.help-block
0 for unlimited
%fieldset
%legend
Continuous Integration and
Continuous
Deployment
%legend
Continuous Integration and Deployment
.form-group
.col-sm-offset-2.col-sm-10
.checkbox
=
f
.
label
:auto_devops_enabled
do
=
f
.
check_box
:auto_devops_enabled
Allow projects to get automaticly configured to use GitLab CI/CD.
Enabled Auto DevOps (Beta) for projects by default
.help-block
It will automatically build, test, and deploy applications based on a predefined CI/CD configuration
-
# Fix this link
=
link_to
icon
(
'question-circle'
),
help_page_path
(
'user/admin_area/settings/continuous_integration'
,
anchor:
'maximum-artifacts-size'
)
.form-group
.col-sm-offset-2.col-sm-10
.checkbox
...
...
app/views/projects/pipelines_settings/_show.html.haml
浏览文件 @
770bcf71
...
...
@@ -5,10 +5,44 @@
.col-lg-8
=
form_for
@project
,
url:
project_pipelines_settings_path
(
@project
)
do
|
f
|
%fieldset
.builds-feature
-
unless
@repository
.
gitlab_ci_yml
.form-group
%p
Pipelines need to be configured before you can begin using Continuous Integration.
=
link_to
'Get started with Pipelines'
,
help_page_path
(
'ci/quick_start/README'
),
class:
'btn btn-info'
%p
Pipelines need to have AutoDevOps enabled or have a .gitlab-ci.yml configured before you can begin using Continious Integration and Delivery.
=
f
.
label
:auto_devops_enabled
,
'Auto DevOps (Beta)'
,
class:
'label-light'
%p
Auto DevOps will automatically build, test, and deploy your application based on a predefined CI/CD configuration.
=
link_to
'Learn more about Auto DevOps'
,
help_page_path
(
'ci/quick_start/README'
)
#TODO fix the link
=
f
.
fields_for
:auto_devops_attributes
,
@auto_devops
do
|
form
|
.radio
=
form
.
radio_button
:enabled
,
true
%strong
Enable Auto DevOps
%br
%span
.descr
The Auto DevOps pipeline configuration will be used when ther is no .gitlab-ci.yml
in the repository.
.radio
=
form
.
radio_button
:enabled
,
false
%strong
Disable Auto DevOps
%br
%span
.descr
A specific .gitlab-ci.yml file needs to be specified before you can begin using Continious Integration and Delivery
.radio
=
form
.
radio_button
:enabled
,
nil
%strong
Instance default (status:
#{
current_application_settings
.
auto_devops_enabled?
}
)
%br
%span
.descr
Follow the instance default to either have Auto DevOps enabled or disabled when there is no .gitlab-ci.yml file specified
%br
%p
Define a domain used by Auto DevOps to deploy towards, this is required for deploys to succeed.
=
link_to
'Learn more about deploying with Auto DevOps'
,
help_page_path
(
'ci/quick_start/README'
)
#TODO fix the link
=
form
.
text_field
:domain
,
class:
'form-control'
,
placeholder:
'domain.com'
%br
%p
%strong
Project specific pipeline configuration
Define a project specific pipeline configuration by creating a .gitlab-ci.yml file.
=
link_to
'Learn more about pipelines'
,
help_page_path
(
'ci/quick_start/README'
),
class:
'btn btn-info'
%hr
.form-group.append-bottom-default
=
f
.
label
:runners_token
,
"Runner token"
,
class:
'label-light'
...
...
db/migrate/20170828093725_create_project_auto_dev_ops.rb
浏览文件 @
770bcf71
...
...
@@ -8,7 +8,7 @@ class CreateProjectAutoDevOps < ActiveRecord::Migration
def
up
create_table
:project_auto_devops
do
|
t
|
t
.
belongs_to
:project
,
index:
true
t
.
boolean
:enabled
,
default:
true
t
.
boolean
:enabled
,
default:
nil
,
null:
true
t
.
string
:domain
end
...
...
db/schema.rb
浏览文件 @
770bcf71
...
...
@@ -250,7 +250,6 @@ ActiveRecord::Schema.define(version: 20170828093725) do
add_index
"ci_builds"
,
[
"commit_id"
,
"status"
,
"type"
],
name:
"index_ci_builds_on_commit_id_and_status_and_type"
,
using: :btree
add_index
"ci_builds"
,
[
"commit_id"
,
"type"
,
"name"
,
"ref"
],
name:
"index_ci_builds_on_commit_id_and_type_and_name_and_ref"
,
using: :btree
add_index
"ci_builds"
,
[
"commit_id"
,
"type"
,
"ref"
],
name:
"index_ci_builds_on_commit_id_and_type_and_ref"
,
using: :btree
add_index
"ci_builds"
,
[
"id"
],
name:
"index_for_ci_builds_retried_migration"
,
where:
"(retried IS NULL)"
,
using: :btree
,
opclasses:
{
"id)"
=>
"WHERE"
}
add_index
"ci_builds"
,
[
"project_id"
],
name:
"index_ci_builds_on_project_id"
,
using: :btree
add_index
"ci_builds"
,
[
"runner_id"
],
name:
"index_ci_builds_on_runner_id"
,
using: :btree
add_index
"ci_builds"
,
[
"stage_id"
],
name:
"index_ci_builds_on_stage_id"
,
using: :btree
...
...
@@ -1122,8 +1121,8 @@ ActiveRecord::Schema.define(version: 20170828093725) do
t
.
integer
"project_id"
t
.
boolean
"enabled"
,
default:
true
t
.
string
"domain"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
datetime
_with_timezone
"created_at"
,
null:
false
t
.
datetime
_with_timezone
"updated_at"
,
null:
false
end
add_index
"project_auto_devops"
,
[
"project_id"
],
name:
"index_project_auto_devops_on_project_id"
,
using: :btree
...
...
lib/gitlab/import_export/import_export.yml
浏览文件 @
770bcf71
...
...
@@ -50,6 +50,7 @@ project_tree:
-
:push_event_payload
-
:stages
-
:statuses
-
:project_auto_devops
-
:triggers
-
:pipeline_schedules
-
:services
...
...
spec/lib/gitlab/import_export/all_models.yml
浏览文件 @
770bcf71
...
...
@@ -256,6 +256,7 @@ project:
-
environments
-
deployments
-
project_feature
-
auto_devops
-
pages_domains
-
authorized_users
-
project_authorizations
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录