Skip to main content

Hydrator

Hydrate your development environment from a YAML configuration file.

Synopsis

Usage: hydrator [OPTIONS] COMMAND [ARGS]...

  Hydrate your development environment.

  Without arguments, all hydrators will be run.

Options:
  -c, --config path  The config file to load. Defaults to "hydrator.yml"
  -v, --verbose
  --dry              Do not commit changes to disk.
  --select TEXT      Select a subset of hydrators to run (comma separated).
  --help             Show this message and exit.

Commands:
  auth-status  Check the filesystem authentication status.
  login        Authenticate for a filesystem.
  logout       Revoke existing credentials for a filesystem.

Features

  • YAML-configuration for Bash profile and Git config.
  • Do not repeat yourself: Layer multiple YAML configurations for multiple environments.
  • Execute shell commands with access to external file systems (e.g. Nextcloud).

Roadmap

  • Application directory finders (e.g. to discover VScode application directory)

Example

In a Git repository, create a file called hydrator.yml. In that file you can configure files that will be produced from the YAML configuration or from external sources. External sources are "file systems" that can be configured in the same file.

filesystems:
  nextcloud: {type: nextcloud, server-url: https://my-cloud.example.org}

hydrators:
  gpg:
    type: commands
    commands:
    - gpg --import [[nextcloud://dotfiles/gpgp/master.key]]

  ssh:
    type: commands
    commands:
    - cp nextcloud://dotfiles/ssh/ida_rsa{,.pub} ~./ssh
    - chmod 600 ~/.ssh/id_rsa{,.pub}

  bash_profile:
    type: bash_profile
    aliases:
      ll: ls -l
    path:
    - ~/.local/bin

In order to access files your Nextcloud, Hydrator first needs to authenticate.

$ hydrator login nextcloud

Then you simply run Hydrator to execute all steps. You can select a subset of hydrators using the --select h1,h2,... option. Add --dry to not commit changes to disk, and -v,--verbose or more logs.

$ hydrator

Layering

You can have multiple YAML configuration files, where one extends the other by adding or overwriting keys. This is useful to customize a basic configuration for another environment.

extends: ./base.yml
hydrators:
  gpg: '{{exclude}}'
  gitconfig:
    Personal.user: '{{user}}'
    user:
      email: work@email.com
      signingkey: DEADBEEF

Copyright 2020 © Niklas Rosenstein

Metadata

Release files for hydrator 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hydrator 0.2.0
File Size Uploaded
hydrator-0.2.0.tar.gz 14.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hydrator 0.2.0
File Interpreter ABI Platform
hydrator-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 38.6 kB

Release files / hydrator-0.2.0.tar.gz

Download URL hydrator-0.2.0.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f35e7e771a4853519d6e7d599f5e9e8a3d57a43472e466aaa08fee2cd04899b1
BLAKE2b-256 checksum
How to use checksums
8378dd062931419dc4e957e3dba081032ac1aacdd2a5bd5a5f6922ac1c37ac06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.3

Release files / hydrator-0.2.0-py3-none-any.whl

Download URL hydrator-0.2.0-py3-none-any.whl
Size 24.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c07948298dabba50da445e4e9fa97b906368e2924f132dfce6e679eec14dd71
BLAKE2b-256 checksum
How to use checksums
dc9ac5f46ff9d763d1e50de5aeb24ff2e3d5dd30b72e187e5668d6e9b40d2d77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page