Merge branch 'master' into redalert
This commit is contained in:
commit
7de1dd7dc0
11 changed files with 32 additions and 50 deletions
4
Bobfile
4
Bobfile
|
@ -11,12 +11,12 @@ version = 1
|
|||
name = "quay"
|
||||
Dockerfile = "Dockerfile.web"
|
||||
project = "quay"
|
||||
tags = ["git:short", "latest"]
|
||||
tags = ["git:short"]
|
||||
|
||||
[[container]]
|
||||
name = "builder"
|
||||
Dockerfile = "Dockerfile.buildworker"
|
||||
project = "builder"
|
||||
tags = ["git:short", "latest"]
|
||||
tags = ["git:short"]
|
||||
|
||||
# vim:ft=toml
|
|
@ -2,7 +2,6 @@ FROM phusion/baseimage:0.9.11
|
|||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV HOME /root
|
||||
WORKDIR /
|
||||
|
||||
# Install the dependencies.
|
||||
RUN apt-get update # 15JUL2014
|
||||
|
|
|
@ -2,7 +2,6 @@ FROM phusion/baseimage:0.9.11
|
|||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV HOME /root
|
||||
WORKDIR /
|
||||
|
||||
# Install the dependencies.
|
||||
RUN apt-get update # 15JUL2014
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1100,6 +1100,9 @@ def _get_repository_images_base(namespace_name, repository_name, query_modifier)
|
|||
# Make sure we're always retrieving the same image object.
|
||||
image = location.storage.image
|
||||
|
||||
# Set the storage to the one we got from the location, to prevent another query
|
||||
image.storage = location.storage
|
||||
|
||||
if not image.id in images:
|
||||
images[image.id] = image
|
||||
image.storage.locations = set()
|
||||
|
|
|
@ -81,10 +81,11 @@ class BuildTrigger(RepositoryParamResource):
|
|||
'service': trigger.service.name, 'config': config_dict},
|
||||
repo=model.get_repository(namespace, repository))
|
||||
|
||||
trigger.delete_instance(recursive=True)
|
||||
|
||||
if trigger.write_token is not None:
|
||||
trigger.write_token.delete_instance()
|
||||
|
||||
trigger.delete_instance(recursive=True)
|
||||
return 'No Content', 204
|
||||
|
||||
|
||||
|
|
|
@ -69,6 +69,17 @@ def truthy_param(param):
|
|||
return param not in {False, 'false', 'False', '0', 'FALSE', '', 'null'}
|
||||
|
||||
|
||||
def param_required(param_name):
|
||||
def wrapper(wrapped):
|
||||
@wraps(wrapped)
|
||||
def decorated(*args, **kwargs):
|
||||
if param_name not in request.args:
|
||||
abort(make_response('Required param: %s' % param_name, 400))
|
||||
return wrapped(*args, **kwargs)
|
||||
return decorated
|
||||
return wrapper
|
||||
|
||||
|
||||
@login_manager.user_loader
|
||||
def load_user(username):
|
||||
logger.debug('User loader loading deferred user: %s' % username)
|
||||
|
@ -200,7 +211,7 @@ def start_build(repository, dockerfile_id, tags, build_name, subdir, manual,
|
|||
|
||||
build_request = model.create_repository_build(repository, token, job_config,
|
||||
dockerfile_id, build_name,
|
||||
trigger, pull_robot_name = pull_robot_name)
|
||||
trigger, pull_robot_name=pull_robot_name)
|
||||
|
||||
dockerfile_build_queue.put([repository.namespace, repository.name], json.dumps({
|
||||
'build_uuid': build_request.uuid,
|
||||
|
|
|
@ -14,7 +14,7 @@ from auth.permissions import AdministerOrganizationPermission
|
|||
from util.invoice import renderInvoiceToPdf
|
||||
from util.seo import render_snapshot
|
||||
from util.cache import no_cache
|
||||
from endpoints.common import common_login, render_page_template, route_show_if, route_hide_if
|
||||
from endpoints.common import common_login, render_page_template, route_show_if, param_required
|
||||
from endpoints.csrf import csrf_protect, generate_csrf_token
|
||||
from util.names import parse_repository_name
|
||||
from util.gravatar import compute_hash
|
||||
|
@ -190,9 +190,9 @@ def receipt():
|
|||
abort(401)
|
||||
return
|
||||
|
||||
id = request.args.get('id')
|
||||
if id:
|
||||
invoice = stripe.Invoice.retrieve(id)
|
||||
invoice_id = request.args.get('id')
|
||||
if invoice_id:
|
||||
invoice = stripe.Invoice.retrieve(invoice_id)
|
||||
if invoice:
|
||||
user_or_org = model.get_user_or_org_by_customer_id(invoice.customer)
|
||||
|
||||
|
@ -335,6 +335,9 @@ def deny_application():
|
|||
|
||||
@web.route('/oauth/authorize', methods=['GET'])
|
||||
@no_cache
|
||||
@param_required('client_id')
|
||||
@param_required('redirect_uri')
|
||||
@param_required('scope')
|
||||
def request_authorization_code():
|
||||
provider = FlaskAuthorizationProvider()
|
||||
response_type = request.args.get('response_type', 'code')
|
||||
|
@ -384,6 +387,12 @@ def request_authorization_code():
|
|||
|
||||
@web.route('/oauth/access_token', methods=['POST'])
|
||||
@no_cache
|
||||
@param_required('grant_type')
|
||||
@param_required('client_id')
|
||||
@param_required('client_secret')
|
||||
@param_required('redirect_uri')
|
||||
@param_required('code')
|
||||
@param_required('scope')
|
||||
def exchange_code_for_token():
|
||||
grant_type = request.form.get('grant_type', None)
|
||||
client_id = request.form.get('client_id', None)
|
||||
|
|
40
initdb.py
40
initdb.py
|
@ -349,46 +349,6 @@ def populate_database():
|
|||
(1, [(1, [], 'v5.0'), (1, [], 'v6.0')], None)],
|
||||
None))
|
||||
|
||||
"""
|
||||
__generate_repository(new_user_1, 'insane', None, False, [],
|
||||
(2, [(3, [], 'v2.0'),
|
||||
(1, [(1, [(1, [], ['latest', 'prod'])],
|
||||
'staging'),
|
||||
(1, [], None)], None),
|
||||
(20, [], 'v3.0'),
|
||||
(22, [(14, [], 'v3.11')], 'v3.1'),
|
||||
(20, [], 'v3.2'),
|
||||
(28, [], 'v3.3'),
|
||||
(16, [(14, [], 'v3.41'), (18, [], 'v3.42'), (12, [], 'v3.43')], 'v3.4'),
|
||||
(21, [(6, [], 'v3.51'), (18, [], 'v3.52')], 'v3.5'),
|
||||
(21, [(7, [], 'v3.61'), (17, [], 'v3.62')], 'v3.6'),
|
||||
(21, [(8, [], 'v3.71'), (16, [], 'v3.72')], 'v3.7'),
|
||||
(21, [(9, [], 'v3.81'), (15, [], 'v3.82')], 'v3.8'),
|
||||
(21, [(10, [], 'v3.91'), (14, [], 'v3.92'), (11, [], 'v3.92')], 'v3.9'),
|
||||
(5, [], 'v4.0'),
|
||||
(5, [], 'v4.1'),
|
||||
(5, [], 'v4.2'),
|
||||
(5, [], 'v4.3'),
|
||||
(5, [], 'v4.4'),
|
||||
(5, [], 'v4.5'),
|
||||
(5, [], 'v4.6'),
|
||||
(5, [], 'v4.7'),
|
||||
(5, [], 'v4.8'),
|
||||
(5, [], 'v4.10'),
|
||||
(5, [], 'v4.11'),
|
||||
(5, [], 'v4.12'),
|
||||
(5, [], 'v4.13'),
|
||||
(5, [], 'v4.14'),
|
||||
(5, [], 'v4.15'),
|
||||
(5, [], 'v4.16'),
|
||||
(5, [], 'v4.17'),
|
||||
(5, [], 'v4.18'),
|
||||
(5, [], 'v4.19'),
|
||||
(5, [], 'v4.20'),
|
||||
(1, [(1, [], 'v5.0'), (1, [], 'v6.0')], None)],
|
||||
None))
|
||||
"""
|
||||
|
||||
__generate_repository(new_user_2, 'publicrepo',
|
||||
'Public repository pullable by the world.', True,
|
||||
[], (10, [], 'latest'))
|
||||
|
|
Binary file not shown.
Reference in a new issue