Enrich Operations CLI tools with environment and package data
A simple command line tool to parse .env and package.json files into environment variables that appends commonly used operational tools arguments.
Collected variables can be substituted in package.json scripts, for example:
opsx docker build -t your/image:^PKG_VERSION^ .
Build arguments are passed from BUILD_<attr>=<value>
and PKG_<attr>
environment variables, for example:
export PKG_VERSION="1.2.3" # done automatically
export BUILD_SOMETHING="example"
opsx docker build -t your/image:tag .
> docker build -t your/image:tag --build-arg PKG_VERSION=1.2.3 --build-arg SOMETHING=example .
Backend configuration can be now set by TF_BACKEND_<attr>=<value>
environment variables, for example:
export TF_BACKEND_USERNAME="adaliszk"
opsx terraform init
> terraform init -backend-config=username=adaliszk
Hosts can be passed via the ANSIBLE_HOSTS
environment variable, for example:
export ANSIBLE_HOSTS="127.0.0.1"
opsx ansible-playbook my-automation.yml
> ansible-playbook my-automation.yml -i 127.0.0.1,