• Stars
    star
    240
  • Rank 168,229 (Top 4 %)
  • Language
    JavaScript
  • Created over 8 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[Utility] Push and pull heroku environment variables to your local env

heroku-config

npm Travis David

Push and pull your Heroku configs to your local environment.

Heavily inspired by ddollar's version, but using the new Heroku cli.

⚠️ Disclaimer ⚠️

Running this code has the potential to delete your configurations if misused.

Specifically, the -o flag will overwrite values at the destination. Only use that if the source has more up to date info and you're feeling brave. Otherwise, this merges configs and is fairly safe. Just thought you should know.

Also, the -c flag will delete values that didn't exist locally when you pushed. Only use it if you know that.

Usage

You can install the package by running

% heroku plugins:install heroku-config

This package includes two commands:

  • heroku config:pull: Writes the contents of heroku config into a local file
  • heroku config:push: Writes the contents of a local file into heroku config

As of version 1.6.0, the heroku-config supports modifying pipeline config variables with the --pipelie-name and --pipeline-stage flags.

Run heroku help config:pull and heroku help config:push to see a full list of flags.

File Format

There's a lot of flexibility when it comes to how you can format your file. Key capitalization can go either way and there can be spacing around the = on one, both, or neither side. There can also be a leading export if you want to use the same file to populate your local environment. Since Heroku runs on linux, variable names must conform to those valid in unix. If you want to use unsupported characters in your var names, run commands with the -e flag. There's also support both unix and windows-style newlines (though only one type per file).

Multiline variables are fine as long as they're surrounded by "

All of the following are valid lines:

#comment
NODE_ENV= test
source =local
job = programming

DB_STRING=mongo://[email protected]:4567
export THING=3
multiline="this can have
as many lines
# comments are still ignored
as it wants"

The following are all invalid lines:

 # comment with leading space
 bad_key=nono
key with-dash=andspace
multiline='bad because
it uses
single quotes'

Development

You'll need Node version >= 6.0. If you want to match exactly, check out the heroku cli's node version here. I like nvm for managing multiple node versions.

After cloning, follow these instructions to run locally! I welcome pull requests with fixes or new features.

More Repositories

1

reddit-user-to-sqlite

Pull Reddit user data into a SQLite database
Python
215
star
2

typed-install

[Project] Easily install new packages and their types, every time.
TypeScript
99
star
3

advent-of-code

My Advent of Code solutions in Python (plus step-by-step explanations)
Python
65
star
4

epub-wordcount

[CLI] count the words in an epub file
TypeScript
26
star
5

universal-test-runner

A language-agnostic, zero-configuration test invoker
Python
24
star
6

obsidian-golinks

Turn go/links into clickable elements in Obsidian
TypeScript
11
star
7

advent-of-code-python-template

This is my tried-and-true Python helper for solving Advent of Code puzzles
Python
8
star
8

ts-playground-plugin-prettier

A simple Typescript Playground Plugin to Invoke Prettier.
JavaScript
6
star
9

lolapi

[Proof of Concept] API for LoL stats
Python
5
star
10

super_paste

An Alfred Workflow to paste links as beautifully-formatted markdown.
Python
3
star
11

airtable-grouped-chart

[Example] Display a chart based on counted value in a group
TypeScript
3
star
12

drafts

[Website] Drafts Javascript Editor
JavaScript
3
star
13

refbook

[Project] the IRDP testing site
HTML
2
star
14

zapier-splitwise

Zapier App to access the Splitwise API
JavaScript
2
star
15

stackpro

[Website] Tracking StackOverflow answering rate
TypeScript
2
star
16

monkey-ts

[Learning] An implementation of a Monkey interpreter in Typescript
TypeScript
2
star
17

tumblradv

[Out of Date] Tumblr Search for Individual User
Python
1
star
18

website

[Project] Source for my personal website
MDX
1
star
19

test-runner-demo

A toy demo repository of universal-test-runner examples
Python
1
star
20

unin

Uninstall that pesky bower_components folder
JavaScript
1
star
21

dotfiles-archive

[Util] Shell configs, OSX setup, etc.
Shell
1
star
22

yoji

A task manager with a specific set of features
TypeScript
1
star
23

will-it-play

[Project] A simple CLI tool to check if a given video file will play natively on a PS4's media player
TypeScript
1
star
24

stackoverflow-to-sqlite

Dump data from Stackoverflow into a SQLite db
Python
1
star
25

generator-xavdid

[Utility] Start Typescript projects the same way I do!
TypeScript
1
star