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
Tatuya Kamada
gitlab-ce
Commits
0094d8f1
Commit
0094d8f1
authored
May 09, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `images` to `container_registry`
parent
51a8811e
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
35 additions
and
27 deletions
+35
-27
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+1
-1
app/models/ability.rb
app/models/ability.rb
+8
-4
app/models/ci/build.rb
app/models/ci/build.rb
+0
-1
app/models/project.rb
app/models/project.rb
+5
-3
app/views/projects/edit.html.haml
app/views/projects/edit.html.haml
+4
-4
config/gitlab.yml.example
config/gitlab.yml.example
+1
-0
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+6
-6
db/migrate/20160407120251_add_images_enabled_for_project.rb
db/migrate/20160407120251_add_images_enabled_for_project.rb
+1
-1
db/schema.rb
db/schema.rb
+1
-1
doc/permissions/permissions.md
doc/permissions/permissions.md
+2
-0
lib/api/entities.rb
lib/api/entities.rb
+1
-1
lib/api/projects.rb
lib/api/projects.rb
+5
-5
No files found.
app/controllers/projects_controller.rb
View file @
0094d8f1
...
...
@@ -235,7 +235,7 @@ class ProjectsController < Projects::ApplicationController
def
project_params
params
.
require
(
:project
).
permit
(
:name
,
:path
,
:description
,
:issues_tracker
,
:tag_list
,
:runners_token
,
:issues_enabled
,
:merge_requests_enabled
,
:snippets_enabled
,
:
images
_enabled
,
:issues_enabled
,
:merge_requests_enabled
,
:snippets_enabled
,
:
container_registry
_enabled
,
:issues_tracker_id
,
:default_branch
,
:wiki_enabled
,
:visibility_level
,
:import_url
,
:last_activity_at
,
:namespace_id
,
:avatar
,
:builds_enabled
,
:build_allow_git_fetch
,
:build_timeout_in_minutes
,
:build_coverage_regex
,
...
...
app/models/ability.rb
View file @
0094d8f1
...
...
@@ -203,7 +203,7 @@ class Ability
:admin_label
,
:read_commit_status
,
:read_build
,
:read_
image
,
:read_
container_registry
,
]
end
...
...
@@ -218,8 +218,8 @@ class Ability
:create_merge_request
,
:create_wiki
,
:push_code
,
:create_
image
,
:update_
image
,
:create_
container_registry
,
:update_
container_registry
,
]
end
...
...
@@ -246,7 +246,7 @@ class Ability
:admin_project
,
:admin_commit_status
,
:admin_build
,
:admin_
image
:admin_
container_registry
,
]
end
...
...
@@ -291,6 +291,10 @@ class Ability
rules
+=
named_abilities
(
'build'
)
end
unless
project
.
container_registry_enabled
rules
+=
named_abilities
(
'container_registry'
)
end
rules
end
...
...
app/models/ci/build.rb
View file @
0094d8f1
...
...
@@ -426,7 +426,6 @@ module Ci
variables
<<
{
key: :CI_BUILD_NAME
,
value:
name
,
public:
true
}
variables
<<
{
key: :CI_BUILD_STAGE
,
value:
stage
,
public:
true
}
variables
<<
{
key: :CI_BUILD_TRIGGERED
,
value:
'true'
,
public:
true
}
if
trigger_request
variables
<<
{
key: :CI_DOCKER_REGISTRY
,
value:
project
.
registry_repository_url
,
public:
true
}
if
project
.
registry_repository_url
variables
end
end
...
...
app/models/project.rb
View file @
0094d8f1
...
...
@@ -69,7 +69,7 @@ class Project < ActiveRecord::Base
default_value_for
:wiki_enabled
,
gitlab_config_features
.
wiki
default_value_for
:wall_enabled
,
false
default_value_for
:snippets_enabled
,
gitlab_config_features
.
snippets
default_value_for
:
images_enabled
,
gitlab_config_features
.
images
default_value_for
:
container_registry_enabled
,
gitlab_config_features
.
container_registry
default_value_for
(
:shared_runners_enabled
)
{
current_application_settings
.
shared_runners_enabled
}
# set last_activity_at to the same as created_at
...
...
@@ -375,8 +375,10 @@ class Project < ActiveRecord::Base
@repository
||=
Repository
.
new
(
path_with_namespace
,
self
)
end
def
registry_repository_url
"
#{
Gitlab
.
config
.
registry
.
host_with_port
}
/
#{
path_with_namespace
}
"
if
images_enabled?
&&
Gitlab
.
config
.
registry
.
enabled
def
container_registry_url
if
container_registry_enabled?
&&
Gitlab
.
config
.
registry
.
enabled
"
#{
Gitlab
.
config
.
registry
.
host_with_port
}
/
#{
path_with_namespace
}
"
end
end
def
commit
(
id
=
'HEAD'
)
...
...
app/views/projects/edit.html.haml
View file @
0094d8f1
...
...
@@ -88,11 +88,11 @@
.form-group
.col-sm-offset-2.col-sm-10
.checkbox
=
f
.
label
:
images
_enabled
do
=
f
.
check_box
:
images
_enabled
%strong
Images
=
f
.
label
:
container_registry
_enabled
do
=
f
.
check_box
:
container_registry
_enabled
%strong
Container Registry
%br
%span
.descr
Use Dock
er Registry for this repository
%span
.descr
Enable Contain
er Registry for this repository
=
render
'builds_settings'
,
f:
f
...
...
config/gitlab.yml.example
View file @
0094d8f1
...
...
@@ -98,6 +98,7 @@ production: &base
wiki: true
snippets: false
builds: true
container_registry: true
## Webhook settings
# Number of seconds to wait for HTTP response after sending webhook HTTP POST request (default: 10)
...
...
config/initializers/1_settings.rb
View file @
0094d8f1
...
...
@@ -230,12 +230,12 @@ Settings.gitlab['default_projects_features'] ||= {}
Settings
.
gitlab
[
'webhook_timeout'
]
||=
10
Settings
.
gitlab
[
'max_attachment_size'
]
||=
10
Settings
.
gitlab
[
'session_expire_delay'
]
||=
10080
Settings
.
gitlab
.
default_projects_features
[
'issues'
]
=
true
if
Settings
.
gitlab
.
default_projects_features
[
'issues'
].
nil?
Settings
.
gitlab
.
default_projects_features
[
'merge_requests'
]
=
true
if
Settings
.
gitlab
.
default_projects_features
[
'merge_requests'
].
nil?
Settings
.
gitlab
.
default_projects_features
[
'wiki'
]
=
true
if
Settings
.
gitlab
.
default_projects_features
[
'wiki'
].
nil?
Settings
.
gitlab
.
default_projects_features
[
'snippets'
]
=
false
if
Settings
.
gitlab
.
default_projects_features
[
'snippets'
].
nil?
Settings
.
gitlab
.
default_projects_features
[
'builds'
]
=
true
if
Settings
.
gitlab
.
default_projects_features
[
'builds'
].
nil?
Settings
.
gitlab
.
default_projects_features
[
'
images'
]
=
true
if
Settings
.
gitlab
.
default_projects_features
[
'images
'
].
nil?
Settings
.
gitlab
.
default_projects_features
[
'issues'
]
=
true
if
Settings
.
gitlab
.
default_projects_features
[
'issues'
].
nil?
Settings
.
gitlab
.
default_projects_features
[
'merge_requests'
]
=
true
if
Settings
.
gitlab
.
default_projects_features
[
'merge_requests'
].
nil?
Settings
.
gitlab
.
default_projects_features
[
'wiki'
]
=
true
if
Settings
.
gitlab
.
default_projects_features
[
'wiki'
].
nil?
Settings
.
gitlab
.
default_projects_features
[
'snippets'
]
=
false
if
Settings
.
gitlab
.
default_projects_features
[
'snippets'
].
nil?
Settings
.
gitlab
.
default_projects_features
[
'builds'
]
=
true
if
Settings
.
gitlab
.
default_projects_features
[
'builds'
].
nil?
Settings
.
gitlab
.
default_projects_features
[
'
container_registry'
]
=
true
if
Settings
.
gitlab
.
default_projects_features
[
'container_registry
'
].
nil?
Settings
.
gitlab
.
default_projects_features
[
'visibility_level'
]
=
Settings
.
send
(
:verify_constant
,
Gitlab
::
VisibilityLevel
,
Settings
.
gitlab
.
default_projects_features
[
'visibility_level'
],
Gitlab
::
VisibilityLevel
::
PRIVATE
)
Settings
.
gitlab
[
'repository_downloads_path'
]
=
File
.
join
(
Settings
.
shared
[
'path'
],
'cache/archive'
)
if
Settings
.
gitlab
[
'repository_downloads_path'
].
nil?
Settings
.
gitlab
[
'restricted_signup_domains'
]
||=
[]
...
...
db/migrate/20160407120251_add_images_enabled_for_project.rb
View file @
0094d8f1
class
AddImagesEnabledForProject
<
ActiveRecord
::
Migration
def
change
add_column
:projects
,
:
images
_enabled
,
:boolean
add_column
:projects
,
:
container_registry
_enabled
,
:boolean
end
end
db/schema.rb
View file @
0094d8f1
...
...
@@ -760,7 +760,7 @@ ActiveRecord::Schema.define(version: 20160421130527) do
t
.
integer
"pushes_since_gc"
,
default:
0
t
.
boolean
"last_repository_check_failed"
t
.
datetime
"last_repository_check_at"
t
.
boolean
"
images
_enabled"
t
.
boolean
"
container_registry
_enabled"
end
add_index
"projects"
,
[
"builds_enabled"
,
"shared_runners_enabled"
],
name:
"index_projects_on_builds_enabled_and_shared_runners_enabled"
,
using: :btree
...
...
doc/permissions/permissions.md
View file @
0094d8f1
...
...
@@ -27,6 +27,7 @@ documentation](../workflow/add-user/add-user.md).
| Manage issue tracker | | ✓ | ✓ | ✓ | ✓ |
| Manage labels | | ✓ | ✓ | ✓ | ✓ |
| See a commit status | | ✓ | ✓ | ✓ | ✓ |
| See a container registry | | ✓ | ✓ | ✓ | ✓ |
| Manage merge requests | | | ✓ | ✓ | ✓ |
| Create new merge request | | | ✓ | ✓ | ✓ |
| Create new branches | | | ✓ | ✓ | ✓ |
...
...
@@ -37,6 +38,7 @@ documentation](../workflow/add-user/add-user.md).
| Write a wiki | | | ✓ | ✓ | ✓ |
| Cancel and retry builds | | | ✓ | ✓ | ✓ |
| Create or update commit status | | | ✓ | ✓ | ✓ |
| Update a container registry | | | ✓ | ✓ | ✓ |
| Create new milestones | | | | ✓ | ✓ |
| Add new team members | | | | ✓ | ✓ |
| Push to protected branches | | | | ✓ | ✓ |
...
...
lib/api/entities.rb
View file @
0094d8f1
...
...
@@ -66,7 +66,7 @@ module API
expose
:owner
,
using:
Entities
::
UserBasic
,
unless:
->
(
project
,
options
)
{
project
.
group
}
expose
:name
,
:name_with_namespace
expose
:path
,
:path_with_namespace
expose
:issues_enabled
,
:merge_requests_enabled
,
:wiki_enabled
,
:builds_enabled
,
:snippets_enabled
,
:
images
_enabled
expose
:issues_enabled
,
:merge_requests_enabled
,
:wiki_enabled
,
:builds_enabled
,
:snippets_enabled
,
:
container_registry
_enabled
expose
:created_at
,
:last_activity_at
expose
:shared_runners_enabled
expose
:creator_id
...
...
lib/api/projects.rb
View file @
0094d8f1
...
...
@@ -94,7 +94,7 @@ module API
# builds_enabled (optional)
# wiki_enabled (optional)
# snippets_enabled (optional)
#
images
_enabled (optional)
#
container_registry
_enabled (optional)
# shared_runners_enabled (optional)
# namespace_id (optional) - defaults to user namespace
# public (optional) - if true same as setting visibility_level = 20
...
...
@@ -113,7 +113,7 @@ module API
:builds_enabled
,
:wiki_enabled
,
:snippets_enabled
,
:
images
_enabled
,
:
container_registry
_enabled
,
:shared_runners_enabled
,
:namespace_id
,
:public
,
...
...
@@ -145,7 +145,7 @@ module API
# builds_enabled (optional)
# wiki_enabled (optional)
# snippets_enabled (optional)
#
images
_enabled (optional)
#
container_registry
_enabled (optional)
# shared_runners_enabled (optional)
# public (optional) - if true same as setting visibility_level = 20
# visibility_level (optional)
...
...
@@ -209,7 +209,7 @@ module API
# builds_enabled (optional)
# wiki_enabled (optional)
# snippets_enabled (optional)
#
images
_enabled (optional)
#
container_registry
_enabled (optional)
# shared_runners_enabled (optional)
# public (optional) - if true same as setting visibility_level = 20
# visibility_level (optional) - visibility level of a project
...
...
@@ -226,7 +226,7 @@ module API
:builds_enabled
,
:wiki_enabled
,
:snippets_enabled
,
:
images
_enabled
,
:
container_registry
_enabled
,
:shared_runners_enabled
,
:public
,
:visibility_level
,
...
...
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