Skip to content

Commit

Permalink
Add go tooling instructions to CONTRIBUTING
Browse files Browse the repository at this point in the history
Make README setup instructions independent of go tools,
also updated binary name to match with beta.
  • Loading branch information
Zachary Scott committed Jun 22, 2018
1 parent 8493988 commit 8d42f72
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 27 deletions.
33 changes: 32 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,37 @@ Second, it's written in Go. If you are new to Go, we recommend the following res
* [A Tour of Go](https://tour.golang.org/welcome/1)
* [The Go documentation](https://golang.org/doc/)

## Requirements

* Go 1.10+
* Make
* ...

## Getting setup

You should already have [installed Go](https://golang.org/doc/install) and setup your [workspace](https://golang.org/doc/code.html#Workspaces).

This includes setting a valid `$GOPATH`.

### 1. Get the repo

```
$ go get -u github.com/CircleCI-Public/circleci-cli
$ cd $GOPATH/src/github.com/CircleCI-Public/circleci-cli
```

### 2. Build the binary

```
$ make
```

### 3. Run tests

```
$ make test
```

## Managing Dependencies

We use `dep` for vendoring our depencencies:
Expand Down Expand Up @@ -80,4 +111,4 @@ You can view the documentation for this project in your browser using `godoc`.
After installing it via `make dev`.

1. Run `make doc`.
2. Access http://localhost:6060/pkg/github.com/circleci/circleci-cli/
2. Access http://localhost:6060/pkg/github.com/CircleCI-Public/circleci-cli/
34 changes: 8 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,24 @@

This project is the seed for CircleCI's new command-line application.

## Requirements

* Go 1.10+
* Make
* ...

## Getting Started

You should already have [installed Go](https://golang.org/doc/install) and setup your [workspace](https://golang.org/doc/code.html#Workspaces).

This includes setting a valid `$GOPATH`.

### 1. Get the repo

TODO: make this easier once repo is public
### 1. Get the latest binary

```
# Setup circleci source in your $GOPATH
$ mkdir -p $GOPATH/src/github.com/circleci
$ cd $GOPATH/src/github.com/circleci
# Clone the repo
$ git clone [email protected]/circleci/circleci-cli
$ cd circleci-cli
```
Download the [latest release](https://github.com/CircleCI-Public/circleci-cli/releases/latest) from GitHub for your operating system. If you're on a Mac, this would be `circleci-cli_0.1.X_darwin_amd64.tar.gz`.

### 2. Build the binary
### 2. Put the binary in your $PATH

```
$ make
$ tar -xvzf circleci-cli_0.1.X_darwin_amd64.tar.gz
$ mv circleci-beta /usr/local/bin
```

### 3. Run Diagnostic check
### 3. Run a Diagnostic check

```
$ ./build/target/darwin/amd64/circleci-cli diagnostic
$ circleci-beta diagnostic
Please enter your CircleCI API token:
OK.
Expand Down Expand Up @@ -88,7 +70,7 @@ fragment FullType on __Type {
You can now pipe that file to the `query` command to send it.

```
$ cat query.gql | ./build/target/darwin/amd64/circleci-cli query
$ cat query.gql | circleci-beta query
```

This should pretty-print back a JSON response from the server:
Expand Down

0 comments on commit 8d42f72

Please sign in to comment.