Skip to content

Commit

Permalink
Merge pull request #7 from DopplerHQ/tom_readme
Browse files Browse the repository at this point in the history
Add install instructions to README
  • Loading branch information
Piccirello authored Nov 13, 2019
2 parents ef7ab51 + 7a7dcc7 commit e1fccd8
Showing 1 changed file with 110 additions and 20 deletions.
130 changes: 110 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,147 @@

## Warning: This tool is current pre-release. For the current stable version, please use the [node-cli](https://github.com/DopplerHQ/node-cli).

The Doppler CLI is the official tool for interacting with your Doppler secrets and configuration.

**You can:**

- Manage your secrets, projects, and environments
- View activity and audit logs
- Execute applications with your secrets injected into the environment

## Install

TODO: this section
The Doppler CLI is available in several popular package managers. It's also available as a standalone binary on the [Releases](https://github.com/DopplerHQ/cli/releases/latest) page.

## Development
### macOS

Build the app:
```sh
$ brew install dopplerhq/cli/doppler
$ doppler --version
```

`go build`
### Windows

To specify the version at build time:
```sh
$ scoop bucket add doppler https://github.com/DopplerHQ/scoop-doppler.git
$ scoop install doppler
$ doppler --version
```

`go build -ldflags '-X github.com/DopplerHQ/cli/version.ProgramVersion=YOUR_VERSION'`
### Linux

Or even at run time:
#### Debian/Ubuntu (apt)

`go run -ldflags '-X github.com/DopplerHQ/cli/version.ProgramVersion=YOUR_VERSION'` main.go YOUR_ARGS
```sh
# add Bintray's GPG key
$ sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-keys 379CE192D401AB61

### Generate a GPG key
# add Doppler's apt repo
$ sudo echo "deb https://dl.bintray.com/dopplerhq/doppler-deb stable main" > /etc/apt/sources.list.d/dopplerhq-doppler-deb.list

Store the keys and passphrase in your doppler config
# fetch latest packages
$ sudo apt-get update

# install doppler cli
$ sudo apt-get install doppler

# execute the cli
$ doppler --version
```

#### RedHat/CentOS (yum)

```sh
# add Doppler's yum repo
$ sudo wget https://bintray.com/dopplerhq/doppler-rpm/rpm -O /etc/yum.repos.d/bintray-dopplerhq-doppler-rpm.repo

# fetch latest packages
$ sudo yum update

# install doppler cli
$ sudo yum install doppler

# execute the cli
$ doppler --version
```
gpg --full-generate-key
gpg --list-secret-keys # copy the key's 40-character ID
gpg --output secret.key --armor --export-secret-key KEY_ID
gpg --output public.key --armor --export KEY_ID
gpg --keyserver pgp.mit.edu --send-key LAST_8_DIGITS_OF_KEY_ID

### Other

You can download binaries and other release artifact from the [Releases](https://github.com/DopplerHQ/cli/releases/latest) page. Binaries are generated for macOS, Linux, Windows, FreeBSD, OpenBSD, and NetBSD, and for 32-bit, 64-bit, armv6/armv7, and armv6/armv7 64-bit architectures. You can also directly download the generated `.deb` and `.rpm` packages. If a binary doesn't exist for the OS/architecture you use, please open a GitHub Issue.

### Docker

Docker containers are currently built using two base images: `alpine` and `node:lts-alpine`.

Example:

```sh
$ docker run --rm -it dopplerhq/cli --version
v1.0.0
```

### Test
Here's an example Dockerfile that shows how you can build on top of one of Doppler's base images:

```dockerfile
FROM dopplerhq/cli:node

Test building for all targets:
COPY . .

`goreleaser release --snapshot --skip-publish --rm-dist`
ENV DOPPLER_API_KEY ""
ENV DOPPLER_PROJECT ""
ENV DOPPLER_CONFIG ""

ENTRYPOINT doppler run --key="$DOPPLER_API_KEY" --project="$DOPPLER_PROJECT" --config="$DOPPLER_CONFIG" -- node index.js
```

## Development

### Build

```sh
$ make build
$ ./doppler --version
```

### Test

Build for all release targets:

```
$ make test-release
```

### Release

To release a new version, run:

```
make release VERSION=vX.Y.Z
$ make release V=vX.Y.Z
```

This command will push local changes to Origin, create a new tag, and push the tag to Origin. It will then build and release the doppler binaries.

Note: The release will automatically fail if the tag and HEAD have diverged
Note: The release will automatically fail if the tag and HEAD have diverged:

` ⨯ release failed after 0.13s error=git tag v0.0.2 was not made against commit c9c6950d18790c17db11fedae331a226f8f12c6b`

### Help

#### Issues

Issue: `gpg: signing failed: Inappropriate ioctl for device`

Fix: `export GPG_TTY=$(tty)`


#### Generate a GPG key

Store the keys and passphrase in your doppler config

```
$ gpg --full-generate-key
$ gpg --list-secret-keys # copy the key's 40-character ID
$ gpg --output secret.key --armor --export-secret-key KEY_ID
$ gpg --output public.key --armor --export KEY_ID
$ gpg --keyserver pgp.mit.edu --send-key LAST_8_DIGITS_OF_KEY_ID
```

0 comments on commit e1fccd8

Please sign in to comment.