diff options
Diffstat (limited to 'lib/spack/spack/schema/gitlab_ci.py')
-rw-r--r-- | lib/spack/spack/schema/gitlab_ci.py | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/lib/spack/spack/schema/gitlab_ci.py b/lib/spack/spack/schema/gitlab_ci.py new file mode 100644 index 0000000000..97a8dcf2e6 --- /dev/null +++ b/lib/spack/spack/schema/gitlab_ci.py @@ -0,0 +1,78 @@ +# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +"""Schema for gitlab-ci.yaml configuration file. + +.. literalinclude:: ../spack/schema/gitlab_ci.py + :lines: 13- +""" + + +#: Properties for inclusion in other schemas +properties = { + 'gitlab-ci': { + 'type': 'object', + 'default': {}, + 'additionalProperties': False, + 'required': ['mappings'], + 'patternProperties': { + r'mappings': { + 'type': 'array', + 'default': {}, + 'additionalProperties': False, + 'patternProperties': { + r'[\w\d\-_\.]+': { + 'type': 'object', + 'default': {}, + 'additionalProperties': False, + 'required': ['match', 'runner-attributes'], + 'properties': { + 'match': { + 'type': 'array', + 'default': [], + 'items': { + 'type': 'string', + }, + }, + 'runner-attributes': { + 'type': 'object', + 'default': {}, + 'additionalProperties': True, + 'required': ['tags'], + 'properties': { + 'image': {'type': 'string'}, + 'tags': { + 'type': 'array', + 'default': [], + 'items': {'type': 'string'} + }, + 'variables': { + 'type': 'object', + 'default': {}, + 'patternProperties': { + r'[\w\d\-_\.]+': { + 'type': 'string', + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, +} + + +#: Full schema with metadata +schema = { + '$schema': 'http://json-schema.org/schema#', + 'title': 'Spack gitlab-ci configuration file schema', + 'type': 'object', + 'additionalProperties': False, + 'properties': properties, +} |