meltano-project-standalone

Description

Install a Meltano project from git.

Variables

Name Type Default Description

repo

string --

The git repo url of the project. Required

group

string meltano

The group to install meltano for.

path

string /var/lib/meltano

The path to install the Meltano project into.

project_name

string meltano

The name of the project.

user

string meltano

The user to install meltano for.

version

string master

The git repo version/branch.

Code

doc:
  short_help: Install a Meltano project from git.

args:
  project_name:
    doc:
      short_help: The name of the project.
    type: string
    required: true
    default: meltano
  user:
    doc:
      short_help: The user to install meltano for.
    type: string
    required: true
    default: meltano
  group:
    doc:
      short_help: The group to install meltano for.
    type: string
    required: true
    default: meltano
  path:
    doc:
      short_help: The path to install the Meltano project into.
    type: string
    required: true
    default: /var/lib/meltano
  repo:
    doc:
      short_help: The git repo url of the project.
    type: string
    required: true
  version:
    doc:
      short_help: The git repo version/branch.
    type: string
    required: false
    default: master
frecklets:
- git-repo-synced:
    dest: '{{:: path ::}}'
    repo: '{{:: repo ::}}'
    version: '{{:: version ::}}'
    owner: '{{:: user ::}}'
    group: '{{:: group ::}}'
- python-virtualenv:
    venv_name: '{{:: project_name ::}}'
    user: '{{:: user ::}}'
    python_type: pyenv
    python_version: 3.7.3
    python_packages:
    - meltano
    - jupyter
    - numpy
    - pandas
    - psycopg2
    - sqlalchemy
    - matplotlib
    - gunicorn
    - gevent
#  - python-virtualenv-execute-shell:
#      virtualenv_path: "/home/{{:: user ::}}/.pyenv/versions/{{:: project_name ::}}"
#      user: "{{:: user ::}}"
#      command: "meltano add loader target-postgres"
#      chdir: "{{:: path ::}}"
#  - python-virtualenv-execute-shell:
#      virtualenv_path: "/home/{{:: user ::}}/.pyenv/versions/{{:: project_name ::}}"
#      user: "{{:: user ::}}"
#      command: "meltano add orchestrator airflow"
#      chdir: "{{:: path ::}}"
- pyenv-gunicorn-systemd-service-unit-file:
    app_module: meltano.api.wsgi:app
    venv_name: '{{:: project_name ::}}'
    user: '{{:: user ::}}'
    working_directory: '{{:: path ::}}'
    gunicorn_config: python:meltano.api.wsgi.config
    port: 5000
    started: true
    enabled: true
frecklecute --community meltano-project-standalone --help

Usage: frecklecute meltano-project-standalone [OPTIONS]

  Install a Meltano project from git.

Options:
  --repo REPO                  The git repo url of the project.  [required]
  --group GROUP                The group to install meltano for.
  --path PATH                  The path to install the Meltano project into.
  --project-name PROJECT_NAME  The name of the project.
  --user USER                  The user to install meltano for.
  --version VERSION            The git repo version/branch.
  --help                       Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.meltano_project_standalone.MeltanoProjectStandalone
#


from dataclasses import dataclass
from pyckles import AutoPycklet
from typing import *    # noqa

@dataclass
class MeltanoProjectStandalone(AutoPycklet):
    """Install a Meltano project from git.

       Args:
         group: The group to install meltano for.
         path: The path to install the Meltano project into.
         project_name: The name of the project.
         repo: The git repo url of the project.
         user: The user to install meltano for.
         version: The git repo version/branch.

    """

    FRECKLET_ID = "meltano-project-standalone"

    group: str = None
    path: str = None
    project_name: str = None
    repo: str = None
    user: str = None
    version: str = None


    def __post_init__(self):
        super(MeltanoProjectStandalone, self).__init__(var_names=["group", "path", "project_name", "repo", "user", "version"])


frecklet_class = MeltanoProjectStandalone
# -*- coding: utf-8 -*-


#
# module path: pycklets.meltano_project_standalone.MeltanoProjectStandalone
#


from pyckles import AutoPycklet

class MeltanoProjectStandalone(AutoPycklet):
    """Install a Meltano project from git.

       Args:
         group: The group to install meltano for.
         path: The path to install the Meltano project into.
         project_name: The name of the project.
         repo: The git repo url of the project.
         user: The user to install meltano for.
         version: The git repo version/branch.

    """

    FRECKLET_ID = "meltano-project-standalone"

    def __init__(self, group="meltano", path="/var/lib/meltano", project_name="meltano", repo=None, user="meltano", version="master"):

        super(MeltanoProjectStandalone, self).__init__(var_names=["group", "path", "project_name", "repo", "user", "version"])
        self._group = group
        self._path = path
        self._project_name = project_name
        self._repo = repo
        self._user = user
        self._version = version

    @property
    def group(self):
        return self._group

    @group.setter
    def group(self, group):
        self._group = group

    @property
    def path(self):
        return self._path

    @path.setter
    def path(self, path):
        self._path = path

    @property
    def project_name(self):
        return self._project_name

    @project_name.setter
    def project_name(self, project_name):
        self._project_name = project_name

    @property
    def repo(self):
        return self._repo

    @repo.setter
    def repo(self, repo):
        self._repo = repo

    @property
    def user(self):
        return self._user

    @user.setter
    def user(self, user):
        self._user = user

    @property
    def version(self):
        return self._version

    @version.setter
    def version(self, version):
        self._version = version



frecklet_class = MeltanoProjectStandalone