Merge master into bitbucket
This commit is contained in:
commit
b96e35b28c
44 changed files with 695 additions and 110 deletions
|
@ -0,0 +1,25 @@
|
|||
"""add custom-git trigger type to database
|
||||
|
||||
Revision ID: 37c47a7af956
|
||||
Revises: 3fee6f979c2a
|
||||
Create Date: 2015-04-24 14:50:26.275516
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '37c47a7af956'
|
||||
down_revision = '3fee6f979c2a'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade(tables):
|
||||
op.bulk_insert(tables.buildtriggerservice, [{'id': 2, 'name': 'custom-git'}])
|
||||
|
||||
|
||||
def downgrade(tables):
|
||||
op.execute(
|
||||
tables.buildtriggerservice.delete()
|
||||
.where(tables.buildtriggerservice.c.name == op.inline_literal('custom-git'))
|
||||
)
|
|
@ -1751,6 +1751,21 @@ def get_matching_repository_images(namespace_name, repository_name, docker_image
|
|||
|
||||
return _get_repository_images_base(namespace_name, repository_name, modify_query)
|
||||
|
||||
|
||||
def get_repository_images_without_placements(repository, with_ancestor=None):
|
||||
query = (Image
|
||||
.select(Image, ImageStorage)
|
||||
.join(ImageStorage)
|
||||
.where(Image.repository == repository))
|
||||
|
||||
if with_ancestor:
|
||||
ancestors_string = '%s%s/' % (with_ancestor.ancestors, with_ancestor.id)
|
||||
query = query.where((Image.ancestors ** (ancestors_string + '%')) |
|
||||
(Image.id == with_ancestor.id))
|
||||
|
||||
return query
|
||||
|
||||
|
||||
def get_repository_images(namespace_name, repository_name):
|
||||
return _get_repository_images_base(namespace_name, repository_name, lambda q: q)
|
||||
|
||||
|
|
Reference in a new issue