2018-12-15 13:49:22 -08:00
|
|
|
|
|
|
|
[ejson](https://github.com/Shopify/ejson) and
|
|
|
|
[ejson2env](https://github.com/Shopify/ejson2env) are used to manage access
|
|
|
|
tokens and other secrets required for CI.
|
|
|
|
|
|
|
|
#### Setup
|
|
|
|
```bash
|
|
|
|
$ sudo gem install ejson ejson2env
|
|
|
|
```
|
|
|
|
|
|
|
|
then obtain the necessary keypair and place it in `/opt/ejson/keys/`.
|
|
|
|
|
|
|
|
#### Usage
|
|
|
|
Run the following command to decrypt the secrets into the environment:
|
|
|
|
```bash
|
|
|
|
eval $(ejson2env secrets.ejson)
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Managing secrets.ejson
|
|
|
|
To decrypt `secrets.ejson` for modification, run:
|
|
|
|
```bash
|
2018-12-15 15:27:42 -08:00
|
|
|
$ ejson decrypt secrets.ejson -o secrets_unencrypted.ejson
|
2018-12-15 13:49:22 -08:00
|
|
|
```
|
|
|
|
|
|
|
|
Edit, then run the following to re-encrypt the file **BEFORE COMMITING YOUR
|
|
|
|
CHANGES**:
|
|
|
|
```bash
|
2018-12-15 15:27:42 -08:00
|
|
|
$ ejson encrypt secrets_unencrypted.ejson
|
|
|
|
$ mv secrets_unencrypted.ejson secrets.ejson
|
2018-12-15 13:49:22 -08:00
|
|
|
```
|
|
|
|
|