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
284dc328
Commit
284dc328
authored
May 14, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix abilities
parent
ee725db8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
8 deletions
+7
-8
app/models/ability.rb
app/models/ability.rb
+1
-1
app/models/project.rb
app/models/project.rb
+5
-5
app/views/projects/container_registry/index.html.haml
app/views/projects/container_registry/index.html.haml
+1
-1
spec/requests/ci/api/runners_spec.rb
spec/requests/ci/api/runners_spec.rb
+0
-1
No files found.
app/models/ability.rb
View file @
284dc328
...
@@ -292,7 +292,7 @@ class Ability
...
@@ -292,7 +292,7 @@ class Ability
rules
+=
named_abilities
(
'build'
)
rules
+=
named_abilities
(
'build'
)
end
end
unless
project
.
container_registry_enabled
&&
Gitlab
.
config
.
registry
.
enabled
unless
project
.
container_registry_enabled
rules
+=
named_abilities
(
'container_registry'
)
rules
+=
named_abilities
(
'container_registry'
)
end
end
...
...
app/models/project.rb
View file @
284dc328
...
@@ -332,20 +332,20 @@ class Project < ActiveRecord::Base
...
@@ -332,20 +332,20 @@ class Project < ActiveRecord::Base
@container_registry_repository
||=
begin
@container_registry_repository
||=
begin
token
=
Auth
::
ContainerRegistryAuthenticationService
.
full_access_token
(
path_with_namespace
)
token
=
Auth
::
ContainerRegistryAuthenticationService
.
full_access_token
(
path_with_namespace
)
url
=
Gitlab
.
config
.
registry
.
api_url
url
=
Gitlab
.
config
.
registry
.
api_url
host
_port
=
Gitlab
.
config
.
registry
.
host_por
t
host
=
Gitlab
.
config
.
registry
.
hos
t
registry
=
ContainerRegistry
::
Registry
.
new
(
url
,
token:
token
,
path:
host
_port
)
registry
=
ContainerRegistry
::
Registry
.
new
(
url
,
token:
token
,
path:
host
)
registry
[
path_with_namespace
]
registry
[
path_with_namespace
]
end
end
end
end
def
container_registry_repository_url
def
container_registry_repository_url
if
container_registry_enabled?
&&
Gitlab
.
config
.
registry
.
enabled
if
Gitlab
.
config
.
registry
.
enabled
"
#{
Gitlab
.
config
.
registry
.
host
_port
}
/
#{
path_with_namespace
}
"
"
#{
Gitlab
.
config
.
registry
.
host
}
/
#{
path_with_namespace
}
"
end
end
end
end
def
has_container_registry_tags?
def
has_container_registry_tags?
if
container_registry_enabled?
&&
Gitlab
.
config
.
registry
.
enabled
if
Gitlab
.
config
.
registry
.
enabled
container_registry_repository
.
tags
.
any?
container_registry_repository
.
tags
.
any?
end
end
end
end
...
...
app/views/projects/container_registry/index.html.haml
View file @
284dc328
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
To start using container images hosted on GitLab you first need to login:
To start using container images hosted on GitLab you first need to login:
%pre
%pre
%code
%code
docker login
#{
Gitlab
.
config
.
registry
.
host
_port
}
docker login
#{
Gitlab
.
config
.
registry
.
host
}
%br
%br
Then you are free to create and upload a container image with build and push commands:
Then you are free to create and upload a container image with build and push commands:
%pre
%pre
...
...
spec/requests/ci/api/runners_spec.rb
View file @
284dc328
...
@@ -7,7 +7,6 @@ describe Ci::API::API do
...
@@ -7,7 +7,6 @@ describe Ci::API::API do
let
(
:registration_token
)
{
'abcdefg123456'
}
let
(
:registration_token
)
{
'abcdefg123456'
}
before
do
before
do
stub_gitlab_calls
stub_application_setting
(
runners_registration_token:
registration_token
)
stub_application_setting
(
runners_registration_token:
registration_token
)
end
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