Support multiple repo for document source
- A single primary repo must be specified which holds the site_definition.yaml file. - Zero or more auxiliary repos can be specified which have additional documents used in the site definition. - Collected documents are written to a file named after their source repo. Collection must always be given a output directory rather than a single file now. Change-Id: Iceda4da18c4df45d917d88a49144e39e3f1743ed
This commit is contained in:
parent
f042fc6a7b
commit
8224e6fc21
|
@ -0,0 +1,7 @@
|
||||||
|
__pycache__
|
||||||
|
.tox
|
||||||
|
.eggs
|
||||||
|
pegleg.egg-info
|
||||||
|
/ChangeLog
|
||||||
|
/AUTHORS
|
||||||
|
*.swp
|
|
@ -1,6 +0,0 @@
|
||||||
__pycache__
|
|
||||||
/.tox
|
|
||||||
/.eggs
|
|
||||||
/pegleg.egg-info
|
|
||||||
/ChangeLog
|
|
||||||
/AUTHORS
|
|
|
@ -1,4 +1,6 @@
|
||||||
from . import engine
|
from . import engine
|
||||||
|
from pegleg import config
|
||||||
|
|
||||||
import click
|
import click
|
||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
|
@ -13,14 +15,13 @@ CONTEXT_SETTINGS = {
|
||||||
|
|
||||||
|
|
||||||
@click.group(context_settings=CONTEXT_SETTINGS)
|
@click.group(context_settings=CONTEXT_SETTINGS)
|
||||||
@click.pass_context
|
|
||||||
@click.option(
|
@click.option(
|
||||||
'-v',
|
'-v',
|
||||||
'--verbose',
|
'--verbose',
|
||||||
is_flag=bool,
|
is_flag=bool,
|
||||||
default=False,
|
default=False,
|
||||||
help='Enable debug logging')
|
help='Enable debug logging')
|
||||||
def main(ctx, *, verbose):
|
def main(*, verbose):
|
||||||
if verbose:
|
if verbose:
|
||||||
log_level = logging.DEBUG
|
log_level = logging.DEBUG
|
||||||
else:
|
else:
|
||||||
|
@ -29,21 +30,36 @@ def main(ctx, *, verbose):
|
||||||
|
|
||||||
|
|
||||||
@main.group(help='Commands related to sites')
|
@main.group(help='Commands related to sites')
|
||||||
def site():
|
@click.option(
|
||||||
pass
|
'-p',
|
||||||
|
'--primary',
|
||||||
|
'primary_repo',
|
||||||
|
required=True,
|
||||||
|
help=
|
||||||
|
'Path to the root of the primary (containing site_definition.yaml) repo.')
|
||||||
|
@click.option(
|
||||||
|
'-a',
|
||||||
|
'--auxiliary',
|
||||||
|
'aux_repo',
|
||||||
|
multiple=True,
|
||||||
|
help='Path to the root of an auxiliary repo.')
|
||||||
|
def site(primary_repo, aux_repo):
|
||||||
|
config.set_primary_repo(primary_repo)
|
||||||
|
config.set_auxiliary_repo_list(aux_repo or [])
|
||||||
|
|
||||||
|
|
||||||
@site.command(help='Output complete config for one site')
|
@site.command(help='Output complete config for one site')
|
||||||
@click.option(
|
@click.option(
|
||||||
'-o',
|
'-s',
|
||||||
'--output',
|
'--save-location',
|
||||||
'output_stream',
|
'save_location',
|
||||||
type=click.File(mode='w'),
|
type=click.Path(
|
||||||
|
file_okay=False, dir_okay=True, writable=True, resolve_path=True),
|
||||||
default=sys.stdout,
|
default=sys.stdout,
|
||||||
help='Where to output')
|
help='Where to output')
|
||||||
@click.argument('site_name')
|
@click.argument('site_name')
|
||||||
def collect(*, output_stream, site_name):
|
def collect(*, save_location, site_name):
|
||||||
engine.site.collect(site_name, output_stream)
|
engine.site.collect(site_name, save_location)
|
||||||
|
|
||||||
|
|
||||||
@site.command(help='Find sites impacted by changed files')
|
@site.command(help='Find sites impacted by changed files')
|
||||||
|
@ -161,5 +177,24 @@ def site_type(*, revision, site_type):
|
||||||
|
|
||||||
@LINT_OPTION
|
@LINT_OPTION
|
||||||
@main.command(help='Sanity checks for repository content')
|
@main.command(help='Sanity checks for repository content')
|
||||||
def lint(*, fail_on_missing_sub_src):
|
@click.option(
|
||||||
engine.lint.full(fail_on_missing_sub_src)
|
'-p',
|
||||||
|
'--primary',
|
||||||
|
'primary_repo',
|
||||||
|
required=True,
|
||||||
|
help=
|
||||||
|
'Path to the root of the primary (containing site_definition.yaml) repo.')
|
||||||
|
@click.option(
|
||||||
|
'-a',
|
||||||
|
'--auxiliary',
|
||||||
|
'aux_repo',
|
||||||
|
multiple=True,
|
||||||
|
help='Path to the root of a auxiliary repo.')
|
||||||
|
def lint(*, fail_on_missing_sub_src, primary_repo, aux_repo):
|
||||||
|
config.set_primary_repo(primary_repo)
|
||||||
|
config.set_auxiliary_repo_list(aux_repo or [])
|
||||||
|
warns = engine.lint.full(fail_on_missing_sub_src)
|
||||||
|
if warns:
|
||||||
|
click.echo("Linting passed, but produced some warnings.")
|
||||||
|
for w in warns:
|
||||||
|
click.echo(w)
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
from copy import copy
|
||||||
|
|
||||||
|
try:
|
||||||
|
if GLOBAL_CONTEXT:
|
||||||
|
pass
|
||||||
|
except NameError:
|
||||||
|
GLOBAL_CONTEXT = {
|
||||||
|
'primary_repo': './',
|
||||||
|
'aux_repos': [],
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def get_primary_repo():
|
||||||
|
return GLOBAL_CONTEXT['primary_repo']
|
||||||
|
|
||||||
|
|
||||||
|
def set_primary_repo(r):
|
||||||
|
GLOBAL_CONTEXT['primary_repo'] = r
|
||||||
|
|
||||||
|
|
||||||
|
def set_auxiliary_repo_list(a):
|
||||||
|
GLOBAL_CONTEXT['aux_repos'] = copy(a)
|
||||||
|
|
||||||
|
|
||||||
|
def add_auxiliary_repo(a):
|
||||||
|
GLOBAL_CONTEXT['aux_repos'].append(a)
|
||||||
|
|
||||||
|
|
||||||
|
def get_auxiliary_repo_list():
|
||||||
|
return GLOBAL_CONTEXT['aux_repos']
|
||||||
|
|
||||||
|
|
||||||
|
def each_auxiliary_repo():
|
||||||
|
for a in GLOBAL_CONTEXT['aux_repos']:
|
||||||
|
yield a
|
||||||
|
|
||||||
|
|
||||||
|
def all_repos():
|
||||||
|
repos = [get_primary_repo()]
|
||||||
|
repos.extend(get_auxiliary_repo_list())
|
||||||
|
return repos
|
|
@ -1,11 +1,12 @@
|
||||||
from pegleg.engine import util
|
|
||||||
import click
|
import click
|
||||||
import jsonschema
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
from pegleg.engine import util
|
||||||
|
from pegleg import config
|
||||||
|
|
||||||
__all__ = ['full']
|
__all__ = ['full']
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
@ -19,11 +20,14 @@ DECKHAND_SCHEMAS = {
|
||||||
|
|
||||||
def full(fail_on_missing_sub_src=False):
|
def full(fail_on_missing_sub_src=False):
|
||||||
errors = []
|
errors = []
|
||||||
errors.extend(_verify_no_unexpected_files())
|
warns = []
|
||||||
|
warns.extend(_verify_no_unexpected_files())
|
||||||
errors.extend(_verify_file_contents())
|
errors.extend(_verify_file_contents())
|
||||||
errors.extend(_verify_deckhand_render(fail_on_missing_sub_src))
|
errors.extend(_verify_deckhand_render(fail_on_missing_sub_src))
|
||||||
if errors:
|
if errors:
|
||||||
raise click.ClickException('\n'.join(['Linting failed:'] + errors))
|
raise click.ClickException('\n'.join(
|
||||||
|
['Linting failed:'] + errors + ['Linting warnings:'] + warns))
|
||||||
|
return warns
|
||||||
|
|
||||||
|
|
||||||
def _verify_no_unexpected_files():
|
def _verify_no_unexpected_files():
|
||||||
|
@ -36,16 +40,16 @@ def _verify_no_unexpected_files():
|
||||||
found_directories = util.files.existing_directories()
|
found_directories = util.files.existing_directories()
|
||||||
LOG.debug('found_directories: %s', found_directories)
|
LOG.debug('found_directories: %s', found_directories)
|
||||||
|
|
||||||
errors = []
|
msgs = []
|
||||||
for unused_dir in sorted(found_directories - expected_directories):
|
for unused_dir in sorted(found_directories - expected_directories):
|
||||||
errors.append('%s exists, but is unused' % unused_dir)
|
msgs.append('%s exists, but is unused' % unused_dir)
|
||||||
|
|
||||||
for missing_dir in sorted(expected_directories - found_directories):
|
for missing_dir in sorted(expected_directories - found_directories):
|
||||||
if not missing_dir.endswith('common'):
|
if not missing_dir.endswith('common'):
|
||||||
errors.append(
|
msgs.append(
|
||||||
'%s was not found, but expected by manifest' % missing_dir)
|
'%s was not found, but expected by manifest' % missing_dir)
|
||||||
|
|
||||||
return errors
|
return msgs
|
||||||
|
|
||||||
|
|
||||||
def _verify_file_contents():
|
def _verify_file_contents():
|
||||||
|
@ -89,18 +93,6 @@ def _verify_document(document, schemas, filename):
|
||||||
document.get('metadata', {}).get('name', '')
|
document.get('metadata', {}).get('name', '')
|
||||||
])
|
])
|
||||||
errors = []
|
errors = []
|
||||||
try:
|
|
||||||
jsonschema.validate(document, schemas['root'])
|
|
||||||
try:
|
|
||||||
jsonschema.validate(document['metadata'],
|
|
||||||
schemas[document['metadata']['schema']])
|
|
||||||
except Exception as e:
|
|
||||||
errors.append('%s (document %s) failed Deckhand metadata schema '
|
|
||||||
'validation: %s' % (filename, name, e))
|
|
||||||
except Exception as e:
|
|
||||||
errors.append(
|
|
||||||
'%s (document %s) failed Deckhand root schema validation: %s' %
|
|
||||||
(filename, name, e))
|
|
||||||
|
|
||||||
layer = _layer(document)
|
layer = _layer(document)
|
||||||
if layer is not None and layer != _expected_layer(filename):
|
if layer is not None and layer != _expected_layer(filename):
|
||||||
|
@ -147,8 +139,11 @@ def _layer(data):
|
||||||
|
|
||||||
|
|
||||||
def _expected_layer(filename):
|
def _expected_layer(filename):
|
||||||
parts = os.path.normpath(filename).split(os.sep)
|
for r in config.all_repos():
|
||||||
return parts[0]
|
if filename.startswith(r + "/"):
|
||||||
|
partial_name = filename[len(r) + 1:]
|
||||||
|
parts = os.path.normpath(partial_name).split(os.sep)
|
||||||
|
return parts[0]
|
||||||
|
|
||||||
|
|
||||||
def _load_schemas():
|
def _load_schemas():
|
||||||
|
|
|
@ -1,16 +1,36 @@
|
||||||
from pegleg.engine import util
|
import os
|
||||||
|
import click
|
||||||
import collections
|
import collections
|
||||||
import csv
|
import csv
|
||||||
import json
|
import json
|
||||||
import yaml
|
import yaml
|
||||||
|
import logging
|
||||||
|
|
||||||
|
from pegleg.engine import util
|
||||||
__all__ = ['collect', 'impacted', 'list_', 'show', 'render']
|
__all__ = ['collect', 'impacted', 'list_', 'show', 'render']
|
||||||
|
|
||||||
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
def collect(site_name, output_stream):
|
|
||||||
for filename in util.definition.site_files(site_name):
|
def collect(site_name, save_location):
|
||||||
with open(filename) as f:
|
try:
|
||||||
output_stream.writelines(f.readlines())
|
save_files = dict()
|
||||||
|
for (repo_base,
|
||||||
|
filename) in util.definition.site_files_by_repo(site_name):
|
||||||
|
repo_name = os.path.normpath(repo_base).split(os.sep)[-1]
|
||||||
|
if repo_name not in save_files:
|
||||||
|
save_files[repo_name] = open(
|
||||||
|
os.path.join(save_location, repo_name + ".yaml"), "w")
|
||||||
|
LOG.debug("Collecting file %s to file %s" %
|
||||||
|
(filename,
|
||||||
|
os.path.join(save_location, repo_name + '.yaml')))
|
||||||
|
with open(filename) as f:
|
||||||
|
save_files[repo_name].writelines(f.readlines())
|
||||||
|
except Exception as ex:
|
||||||
|
raise click.ClickException("Error saving output: %s" % str(ex))
|
||||||
|
finally:
|
||||||
|
for f in save_files.values():
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
|
||||||
def impacted(input_stream, output_stream):
|
def impacted(input_stream, output_stream):
|
||||||
|
@ -35,8 +55,7 @@ def render(site_name, output_stream):
|
||||||
|
|
||||||
rendered_documents, errors = util.deckhand.deckhand_render(
|
rendered_documents, errors = util.deckhand.deckhand_render(
|
||||||
documents=documents)
|
documents=documents)
|
||||||
for d in documents:
|
yaml.dump_all(rendered_documents, output_stream, default_flow_style=False)
|
||||||
output_stream.writelines(yaml.dump(d))
|
|
||||||
|
|
||||||
|
|
||||||
def list_(output_stream):
|
def list_(output_stream):
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
from . import files
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
|
from pegleg import config
|
||||||
|
from . import files
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
'create',
|
'create',
|
||||||
'load',
|
'load',
|
||||||
|
@ -31,19 +33,21 @@ def create(*, site_name, site_type, revision):
|
||||||
files.dump(path(site_name), definition)
|
files.dump(path(site_name), definition)
|
||||||
|
|
||||||
|
|
||||||
def load(site):
|
def load(site, primary_repo_base=None):
|
||||||
return files.slurp(path(site))
|
return files.slurp(path(site, primary_repo_base))
|
||||||
|
|
||||||
|
|
||||||
def load_as_params(site_name):
|
def load_as_params(site_name, primary_repo_base=None):
|
||||||
definition = load(site_name)
|
definition = load(site_name, primary_repo_base)
|
||||||
params = definition.get('data', {})
|
params = definition.get('data', {})
|
||||||
params['site_name'] = site_name
|
params['site_name'] = site_name
|
||||||
return params
|
return params
|
||||||
|
|
||||||
|
|
||||||
def path(site_name):
|
def path(site_name, primary_repo_base=None):
|
||||||
return 'site/%s/site-definition.yaml' % site_name
|
if not primary_repo_base:
|
||||||
|
primary_repo_base = config.get_primary_repo()
|
||||||
|
return '%s/site/%s/site-definition.yaml' % (primary_repo_base, site_name)
|
||||||
|
|
||||||
|
|
||||||
def pluck(site_definition, key):
|
def pluck(site_definition, key):
|
||||||
|
@ -61,3 +65,14 @@ def site_files(site_name):
|
||||||
for filename in files.search(files.directories_for(**params)):
|
for filename in files.search(files.directories_for(**params)):
|
||||||
yield filename
|
yield filename
|
||||||
yield path(site_name)
|
yield path(site_name)
|
||||||
|
|
||||||
|
|
||||||
|
def site_files_by_repo(site_name):
|
||||||
|
"""Yield tuples of repo_base, file_name."""
|
||||||
|
params = load_as_params(site_name)
|
||||||
|
dir_map = files.directories_for_each_repo(**params)
|
||||||
|
for repo, dl in dir_map.items():
|
||||||
|
for filename in files.search(dl):
|
||||||
|
yield (repo, filename)
|
||||||
|
if repo == config.get_primary_repo():
|
||||||
|
yield (repo, path(site_name))
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
import click
|
import click
|
||||||
import os
|
import os
|
||||||
import yaml
|
import yaml
|
||||||
|
import logging
|
||||||
|
|
||||||
|
from pegleg import config
|
||||||
|
|
||||||
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
'all',
|
'all',
|
||||||
|
@ -23,7 +28,10 @@ DIR_DEPTHS = {
|
||||||
|
|
||||||
|
|
||||||
def all():
|
def all():
|
||||||
return search(DIR_DEPTHS.keys())
|
return search([
|
||||||
|
os.path.join(r, k) for r in config.all_repos()
|
||||||
|
for k in DIR_DEPTHS.keys()
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
def create_global_directories(revision):
|
def create_global_directories(revision):
|
||||||
|
@ -83,7 +91,7 @@ def _create_tree(root_path, *, tree=FULL_STRUCTURE):
|
||||||
|
|
||||||
|
|
||||||
def directories_for(*, site_name, revision, site_type):
|
def directories_for(*, site_name, revision, site_type):
|
||||||
return [
|
library_list = [
|
||||||
_global_common_path(),
|
_global_common_path(),
|
||||||
_global_revision_path(revision),
|
_global_revision_path(revision),
|
||||||
_site_type_common_path(site_type),
|
_site_type_common_path(site_type),
|
||||||
|
@ -91,6 +99,32 @@ def directories_for(*, site_name, revision, site_type):
|
||||||
_site_path(site_name),
|
_site_path(site_name),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
return [
|
||||||
|
os.path.join(b, l) for b in config.all_repos() for l in library_list
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def directories_for_each_repo(*, site_name, revision, site_type):
|
||||||
|
"""Provide directories for each repo.
|
||||||
|
|
||||||
|
When producing bucketized output files, the documents collected
|
||||||
|
must be collated by repo. Provide the list of source directories
|
||||||
|
by repo.
|
||||||
|
"""
|
||||||
|
library_list = [
|
||||||
|
_global_common_path(),
|
||||||
|
_global_revision_path(revision),
|
||||||
|
_site_type_common_path(site_type),
|
||||||
|
_site_type_revision_path(site_type, revision),
|
||||||
|
_site_path(site_name),
|
||||||
|
]
|
||||||
|
|
||||||
|
dir_map = dict()
|
||||||
|
for r in config.all_repos():
|
||||||
|
dir_map[r] = [os.path.join(r, l) for l in library_list]
|
||||||
|
|
||||||
|
return dir_map
|
||||||
|
|
||||||
|
|
||||||
def _global_common_path():
|
def _global_common_path():
|
||||||
return 'global/common'
|
return 'global/common'
|
||||||
|
@ -112,24 +146,32 @@ def _site_path(site_name):
|
||||||
return 'site/%s' % site_name
|
return 'site/%s' % site_name
|
||||||
|
|
||||||
|
|
||||||
def list_sites():
|
def list_sites(primary_repo_base=None):
|
||||||
for path in os.listdir('site'):
|
"""Get a list of site defintion directories in the primary repo."""
|
||||||
joined_path = os.path.join('site', path)
|
if not primary_repo_base:
|
||||||
|
primary_repo_base = config.get_primary_repo()
|
||||||
|
for path in os.listdir(os.path.join(primary_repo_base, 'site')):
|
||||||
|
joined_path = os.path.join(primary_repo_base, 'site', path)
|
||||||
if os.path.isdir(joined_path):
|
if os.path.isdir(joined_path):
|
||||||
yield path
|
yield path
|
||||||
|
|
||||||
|
|
||||||
def directory_for(*, path):
|
def directory_for(*, path):
|
||||||
parts = os.path.normpath(path).split(os.sep)
|
for r in config.all_repos():
|
||||||
depth = DIR_DEPTHS.get(parts[0])
|
if path.startswith(r + "/"):
|
||||||
if depth is not None:
|
partial_path = path[len(r) + 1:]
|
||||||
return os.path.join(*parts[:depth + 1])
|
parts = os.path.normpath(partial_path).split(os.sep)
|
||||||
|
depth = DIR_DEPTHS.get(parts[0])
|
||||||
|
if depth is not None:
|
||||||
|
return os.path.join(r, *parts[:depth + 1])
|
||||||
|
|
||||||
|
|
||||||
def existing_directories():
|
def existing_directories():
|
||||||
directories = set()
|
directories = set()
|
||||||
for search_path, depth in DIR_DEPTHS.items():
|
for r in config.all_repos():
|
||||||
directories.update(_recurse_subdirs(search_path, depth))
|
for search_path, depth in DIR_DEPTHS.items():
|
||||||
|
directories.update(
|
||||||
|
_recurse_subdirs(os.path.join(r, search_path), depth))
|
||||||
return directories
|
return directories
|
||||||
|
|
||||||
|
|
||||||
|
@ -141,7 +183,7 @@ def slurp(path):
|
||||||
|
|
||||||
with open(path) as f:
|
with open(path) as f:
|
||||||
try:
|
try:
|
||||||
return yaml.load(f)
|
return yaml.safe_load(f)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise click.ClickException('Failed to parse %s:\n%s' % (path, e))
|
raise click.ClickException('Failed to parse %s:\n%s' % (path, e))
|
||||||
|
|
||||||
|
@ -158,18 +200,24 @@ def dump(path, data):
|
||||||
|
|
||||||
def _recurse_subdirs(search_path, depth):
|
def _recurse_subdirs(search_path, depth):
|
||||||
directories = set()
|
directories = set()
|
||||||
for path in os.listdir(search_path):
|
try:
|
||||||
joined_path = os.path.join(search_path, path)
|
for path in os.listdir(search_path):
|
||||||
if os.path.isdir(joined_path):
|
joined_path = os.path.join(search_path, path)
|
||||||
if depth == 1:
|
if os.path.isdir(joined_path):
|
||||||
directories.add(joined_path)
|
if depth == 1:
|
||||||
else:
|
directories.add(joined_path)
|
||||||
directories.update(_recurse_subdirs(joined_path, depth - 1))
|
else:
|
||||||
|
directories.update(
|
||||||
|
_recurse_subdirs(joined_path, depth - 1))
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
return directories
|
return directories
|
||||||
|
|
||||||
|
|
||||||
def search(search_paths):
|
def search(search_paths):
|
||||||
for search_path in search_paths:
|
for search_path in search_paths:
|
||||||
|
LOG.debug("Recursively collecting YAMLs from %s" % search_path)
|
||||||
for root, _dirs, filenames in os.walk(search_path):
|
for root, _dirs, filenames in os.walk(search_path):
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
yield os.path.join(root, filename)
|
if filename.endswith(".yaml"):
|
||||||
|
yield os.path.join(root, filename)
|
||||||
|
|
|
@ -8,14 +8,16 @@ realpath() {
|
||||||
|
|
||||||
SCRIPT_DIR=$(realpath "$(dirname "${0}")")
|
SCRIPT_DIR=$(realpath "$(dirname "${0}")")
|
||||||
SOURCE_DIR=${SCRIPT_DIR}/pegleg
|
SOURCE_DIR=${SCRIPT_DIR}/pegleg
|
||||||
if [ -d "$PWD/global" ]; then
|
if [ -z "${WORKSPACE}" ]; then
|
||||||
WORKSPACE="$PWD"
|
WORKSPACE="/"
|
||||||
else
|
|
||||||
WORKSPACE=$(realpath "${SCRIPT_DIR}/..")
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
IMAGE=${IMAGE:-quay.io/attcomdev/pegleg:latest}
|
IMAGE=${IMAGE:-quay.io/attcomdev/pegleg:latest}
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "== NOTE: Workspace $WORKSPACE is available as /workspace in container context =="
|
||||||
|
echo
|
||||||
|
|
||||||
docker run --rm -t \
|
docker run --rm -t \
|
||||||
--net=none \
|
--net=none \
|
||||||
-v "${WORKSPACE}:/workspace" \
|
-v "${WORKSPACE}:/workspace" \
|
||||||
|
|
Loading…
Reference in New Issue