Exemplo n.º 1
0
def create_plugin_config(root_dir, project_name, content):
    dkit_home = datakit_home(root_dir)
    plugin_dir = os.path.join(dkit_home, 'plugins', project_name)
    mkdir_p(plugin_dir)
    config_file = os.path.join(plugin_dir, 'config.json')
    write_json(config_file, content)
    return content
Exemplo n.º 2
0
def create_plugin_config(root_dir, content={}):
    dkit_home = datakit_home(root_dir)
    plugin_dir = os.path.join(dkit_home, 'plugins/datakit-project')
    mkdir_p(plugin_dir)
    config_file = os.path.join(plugin_dir, 'config.json')
    config = {'default_template': ''}
    config.update(content)
    write_json(config_file, config)
    return config
Exemplo n.º 3
0
def bootstrap_temp_env(dkit_home, fake_project, monkeypatch, tmpdir):
    mkdir_p(dkit_home)
    mkdir_p(fake_project)
    monkeypatch.setenv('DATAKIT_HOME', dkit_home)
    monkeypatch.chdir(fake_project)
    create_readme(fake_project)
    create_plugin_config(
        dkit_home, 'datakit-gitlab', {
            "gitlab_url": 'https://gitlab.inside.ap.org',
            "api_key": "afdafsa",
            "default_namespace": "data"
        })
Exemplo n.º 4
0
def create_project_config(project_root, contents={}):
    config_dir = os.path.join(project_root, 'config')
    mkdir_p(config_dir)
    project_config = os.path.join(config_dir, 'datakit-data.json')
    write_json(project_config, contents)
Exemplo n.º 5
0
def create_cookiecutter_home(tmpdir):
    pth = cookiecutter_home(tmpdir)
    mkdir_p(pth)
    return pth
Exemplo n.º 6
0
 def take_action(self, parsed_args):
     self.log.info("Initializing project for S3 data integration...")
     dirs_to_create = ['data', 'config']
     [mkdir_p(directory) for directory in dirs_to_create]
     open('data/.gitkeep', 'w').close()
     self.create_project_config()
Exemplo n.º 7
0
def bootstrap_temp_env(dkit_home, fake_project, monkeypatch, tmpdir):
    mkdir_p(dkit_home)
    mkdir_p(fake_project)
    monkeypatch.setenv('DATAKIT_HOME', dkit_home)
    monkeypatch.chdir(fake_project)
Exemplo n.º 8
0
def create_plugin_config(plugin_dir, content):
    mkdir_p(plugin_dir)
    config_file = os.path.join(plugin_dir, 'config.json')
    write_json(config_file, content)
    return content
Exemplo n.º 9
0
def setup(datakit_home, plugin_dir, fake_project, monkeypatch, tmpdir):
    mkdir_p(datakit_home)
    mkdir_p(plugin_dir)
    mkdir_p(fake_project)
    monkeypatch.setenv('DATAKIT_HOME', datakit_home)
    monkeypatch.chdir(fake_project)