Stim is available in Docker. To use, simply run
docker run premiereglobal/stim <stim-command>
Stim natively supports configuration via environment variables. So, for example, to log into Vault and map the token to your home directory, run
docker run \
-it \
-e VAULT_ADDR=https://my-vault-domain:8200 \
-v $HOME/.vault-token:/root/vault-token \
premiereglobal/stim vault login
stim vault login
logs into Vault, prompting for required credentials
stim deploy
makes it easier to deploy with a simple config file. See docs/DEPLOY.md for more details.
See the examples directory for examples of certain subcommands.
In addition to accepting config via CLI options and environment variables, Stim reads configuration from a file (${HOME}/.stim/config.yaml
by default). You can pass alternate config file paths at runtime via the --config
CLI option, for example:
stim vault login --config ~/.stim/alt-config-file.yaml
Configuration files are YAML-formatted and allow you to configure settings for AWS, Vault, logging, etc. For a full list of configuration options and related info, see the Config documentation. A sample configuration file for a Vault instance in which you use Github as an auth backend might look like:
auth:
# the name of a pre-configured Vault auth method
method: github
aws:
default-profile: true
ttl: 10h
use-profiles: true
web-ttl: 10h
# the URL of your Vault instance
vault-address: https://vault.example.com
vault-initial-token-duration: 10h
vault-username: github-login
vault-username-skip-prompt: true
The project is broken down into 4 major componenets: api
, command
, packages
, and stimpacks
. More explaination below.
├── pkg/
│ ├── pagerduty/
│ ├── utils/
│ ├── vault/
│ ├── ...
├── stim/
├── stimpacks/
│ ├── deploy/
│ ├── vault/
│ ├── ...
├── scripts/
├── vendor/
pkg/
The components in this directory should be developed as stand-alone packages that can be consumed not only by Stim but also externally. They are generally wrappers around existing APIs (for example Vault) that simplify basic functionality.stim/
This component is the core of the Stim application. It is what everystimpack
interfaces with to talk with the core Stim application. Stim initializes components as-needed by the stimpacks. For instance, if a stimpack needs access to Pagerduy, Stim will call Vault, get the API key for Pagerduty and instantiate a new instance of Pagerduty for the stimpack to use. Stim also allows stimpacks to attach cli commands and add configuration parameters.stimpacks/
Stimpacks are pluggable extensions of the main Stim application. They interface directly with the Stim api and can add commands and configuration to the cli. They generally contain opionated functions for configuring developer workstations, building applications, testing, and deployments.
See comments in stimpacks/vault
for details
TODO: More docs here
Guidelines:
- Don't log, just return errors and let the consumer deal with it