PremiereGlobal / stim

Speeding up development with glue that brings tools together
MIT License
15 stars 7 forks source link
aws cicd deploy devtools kubernetes pagerduty slack vault

Stim

Build ReportCard GoDoc License

Running in Docker

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

Common Subcommands

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.

Examples

See the examples directory for examples of certain subcommands.

Configuration

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

Developing with Stim

Project Structure

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/

Developing Stimpacks

See comments in stimpacks/vault for details TODO: More docs here

Developing Re-usable Packages

Guidelines: