Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
pycklets / resources / frecklet / python-virtualenv-execute-shell.frecklet
Size: Mime:
doc:
  short_help: Executes a command inside a virtualenv.
  help: |
    Execute a command inside a virtualenv, the 'command' needs to be available in the virtualenv (<venv>/bin/<command>).

    You can easily use the 'execute-shell' frecklet instead of this, because for now with this you need to know the path to the virtualenv. If you used the 'python-virtualenv' frecklet and the 'python_type' 'pyenv',
    your virtualenv will be located under <user_home>/.pyenv/versions/<venv_name>.
    In the future this will take the same vars that the 'python-virtualenv' frecklet takes, and auto-calculate the
    path to the virtualenv.

    For now, only absolute virtualenv paths are supported, '~' won't work.

    Also, this frecklet does not support commands that require user input. For this, you'd have to create a frecklet
    similar to this, which uses 'expect'. Not hard, just not available yet.
  examples:
  - title: Execute 'cookiecutter' from within a virtualenv.
    desc: |
      This assumes you installed [cookiecutter](https://cookiecutter.readthedocs.io/en/latest/) in an virtualenv before (for example using the 'python_virtualenv' frecklet), using 'pyenv'.

      The result will be a project folder at '/tmp/python_boilerplate'. Obviously, this is not that useful becaues of the '--no-input' option we used (this frecklet really only works with 'batch-able' commands).
    vars:
      command: cookiecutter gh:audreyr/cookiecutter-pypackage --no-input
      chdir: /tmp
      virtualenv_path: /home/freckles/.pyenv/versions/cookiecutter


args:
  virtualenv_path:
    doc:
      short_help: The (absolute) virtualenv (base) path.
    type: string
    required: true
  command:
    doc:
      short_help: The command to execute.
      help: |
        This needs to be an executable that is located in the ``virtualenv_path``/bin/ folder.
  user:
    doc:
      short_help: The user to execute this command as.
    type: string
    empty: false
    required: false
  ignore_error:
    doc:
      short_help: Whether to ignore any potential errors.
    type: boolean
    required: false
    default: false
  no_log:
    doc:
      short_help: Whether to hide the log of this command (because for example the command contains sensitive information).
    type: boolean
    default: false
    required: false
    cli:
      param_decls:
      - --no-log
  environment:
    doc:
      short_help: A dictionary of environment variables to add/set.
    type: dict
    required: false
    keyschema:
      type: string

frecklets:
- execute-shell:
    frecklet::desc:
      short: 'execute command in venv: {{:: command ::}}'
    command: '{{:: virtualenv_path ::}}/bin/{{:: command ::}}'
    chdir: '{{:: chdir ::}}'
    become_user: '{{:: user ::}}'
    ignore_error: '{{:: ignore_error ::}}'
    no_log: '{{:: no_log ::}}'
    environment: '{{:: environment ::}}'

meta: {}