-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #131 from phase2/develop
2.1.0
- Loading branch information
Showing
31 changed files
with
621 additions
and
337 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
dist | ||
build | ||
vendor | ||
vendor.orig | ||
.idea | ||
.outrigger.yml | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# One release file to rule them all | ||
project_name: outrigger-cli | ||
|
||
# Platforms/architectures to target | ||
builds: | ||
- binary: rig | ||
main: ./cmd/main.go | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- windows | ||
- darwin | ||
- linux | ||
goarch: | ||
- amd64 | ||
|
||
# Generating the archives | ||
archive: | ||
name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}" | ||
format: tar.gz | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
replacements: | ||
darwin: macOS | ||
|
||
# Publishing releases to GitHub | ||
release: | ||
github: | ||
owner: phase2 | ||
name: rig | ||
prerelease: true | ||
|
||
# Build linux packages | ||
fpm: | ||
vendor: Phase2 | ||
homepage: https://outrigger.sh/ | ||
maintainer: Outrigger <[email protected]> | ||
description: Containerized development environment for projects. See https://docs.outrigger.sh for documentation. | ||
license: MIT | ||
formats: | ||
- deb | ||
- rpm | ||
dependencies: | ||
- docker-ce |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
# CONTRIBUTING | ||
|
||
Thank you for considering contributing to the Outrigger CLI! | ||
|
||
## Quality Contributions | ||
|
||
* Make sure your branch will compile. | ||
* Make sure your branch passes our static analysis checks. | ||
* Make sure your branch conforms with go fmt standards. | ||
* Manually test your changes. | ||
|
||
## User Interactions | ||
|
||
One of the key goals of this project is to promote a positive developer | ||
experience. Every interaction should be thought of with the following points: | ||
|
||
* Are you providing the user with enough context about what's being asked or being done? | ||
* Does the user expect to wait? Might the user think the tool stalled? | ||
* Is there black box business happening that could be made more transparent? | ||
|
||
We have a slightly complex logging API to support addressing these concerns. | ||
(See ./util/logging.go) | ||
|
||
Here are a few conventions: | ||
|
||
* **Starting a task that could take more than 5 seconds:** | ||
* `cmd.out.Spin("Preparing the sauce")` | ||
* **Use the correct method to log operational results: (Pick one)** | ||
* `cmd.out.Info("Sauce is Ready.")` | ||
* `cmd.out.Warning("Sauce is burnt on the bottom.")` | ||
* `cmd.out.Error("Discard this sauce and try again.")` | ||
* **Going to send some contextual notes to the user**: | ||
1. `cmd.out.NoSpin()` if currently using the spinner. | ||
2. `cmd.out.Info("Sauce exists.")` | ||
4. `cmd.out.Verbose("The ingredients of the sauce include tomato, salt, black pepper, garlic...")` | ||
* **Command has executed and is successful. Please no notification:** | ||
``` | ||
cmd.out.Info("Enjoy your dinner.") | ||
return cmd.Success("") | ||
``` | ||
* **Command has executed and is successful. Get a notification too!** | ||
``` | ||
return cmd.Success("Enjoy your dinner.") | ||
``` | ||
* **Command failed:** | ||
``` | ||
message := "Cooking sauce is hard, we failed" | ||
cmd.out.Error("%s: %s", message, err.Error()) | ||
return cmd.Failure(message) | ||
``` | ||
|
||
## Development Environment Setup | ||
|
||
### Developing with Docker | ||
|
||
You can use the Docker integration within this repository to facilitate development in lieu of setting up a | ||
local golang environment. Using docker-compose, run the following commands: | ||
|
||
```bash | ||
docker-compose run --rm install | ||
docker-compose run --rm compile | ||
``` | ||
|
||
This will produce a working OSX binary at `build/darwin/rig`. | ||
|
||
If you change a dependency in `Gopkg.toml` you can update an individual package dependency with: | ||
|
||
```bash | ||
docker-compose run --rm update [package] | ||
``` | ||
|
||
If you want to update all packages use: | ||
|
||
```bash | ||
docker-compose run --rm update | ||
``` | ||
|
||
If you want to run the static analysis checks: | ||
|
||
```bash | ||
docker-compose run --rm lint | ||
``` | ||
|
||
If you want to run go fmt against the codebase: | ||
```bash | ||
docker-compose run --rm base go fmt ./... | ||
``` | ||
|
||
### Developing Locally | ||
|
||
Install go from homebrew using the flag to include common cross-compiler targets (namely Darwin, Linux, and Windows) | ||
|
||
```bash | ||
brew install go --with-cc-common | ||
brew install dep | ||
brew tap goreleaser/tap | ||
brew install goreleaser/tap/goreleaser | ||
``` | ||
|
||
Setup `$GOPATH` and `$PATH` in your favorite shell (`~/.bashrc` or `~/.zshrc`) | ||
|
||
```bash | ||
export GOPATH=$HOME/Projects | ||
export PATH=$PATH:$GOPATH/bin | ||
``` | ||
|
||
Checkout the code into your `$GOPATH` in `$GOPATH/src/github.com/phase2/rig` | ||
|
||
Get all the dependencies | ||
|
||
```bash | ||
# Install the project dependencies into $GOPATH | ||
cd $GOPATH/src/github.com/phase2/rig | ||
dep ensure | ||
``` | ||
|
||
#### Building Rig | ||
|
||
If you want to build `rig` locally for your target platform, simply run the following command: | ||
|
||
```bash | ||
GOARCH=amd64 GOOS=darwin go build -o build/darwin/rig cmd/main.go | ||
``` | ||
|
||
This command targets an OS/Architecture (Darwin/Mac and 64bit) and puts the resultant file in the `build/darwin/` | ||
with the name `rig`. Change `GOARCH` and `GOOS` if you need to target a different platform |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,107 +1,52 @@ | ||
# Rig - Outrigger CLI [![Build Status](https://travis-ci.org/phase2/rig.svg?branch=develop)](https://travis-ci.org/phase2/rig) | ||
|
||
> A CLI for managing the Outrigger container-driven development stack. | ||
> A CLI for managing the Outrigger's container-driven development stack. | ||
See the [documentation for more details](http://docs.outrigger.sh). | ||
See the [CONTRIBUTING.md](./CONTRIBUTING.md) for developer documentation. | ||
|
||
Use this readme when you want to develop the Outrigger CLI. | ||
## Built on Dependencies | ||
|
||
Setup | ||
------ | ||
|
||
Install go from homebrew using the flag to include common cross-compiler targets (namely Darwin, Linux, and Windows) | ||
|
||
```bash | ||
brew install go --with-cc-common | ||
brew install dep | ||
brew tap goreleaser/tap | ||
brew install goreleaser/tap/goreleaser | ||
``` | ||
|
||
Setup `$GOPATH` and `$PATH` in your favorite shell (`~/.bashrc` or `~/.zshrc`) | ||
|
||
```bash | ||
export GOPATH=$HOME/Projects | ||
export PATH=$PATH:$GOPATH/bin | ||
``` | ||
|
||
Checkout the code into your `$GOPATH` in `$GOPATH/src/github.com/phase2/rig` | ||
|
||
Get all the dependencies | ||
|
||
```bash | ||
# Install the project dependencies into $GOPATH | ||
cd $GOPATH/src/github.com/phase2/rig | ||
dep ensure | ||
``` | ||
|
||
Developing Locally | ||
------------------- | ||
|
||
If you want to build `rig` locally for your target platform, simply run the following command: | ||
|
||
```bash | ||
GOARCH=amd64 GOOS=darwin go build -o build/darwin/rig cmd/main.go | ||
``` | ||
|
||
This command targets an OS/Architecture (Darwin/Mac and 64bit) and puts the resultant file in the `build/darwin/` | ||
with the name `rig`. Change `GOARCH` and `GOOS` if you need to target a different platform | ||
|
||
Developing with Docker | ||
----------------------- | ||
|
||
You can use the Docker integration within this repository to facilitate development in lieu of setting up a | ||
local golang environment. Using docker-compose, run the following commands: | ||
|
||
```bash | ||
docker-compose run --rm install | ||
docker-compose run --rm compile | ||
``` | ||
|
||
This will produce a working OSX binary at `build/darwin/rig`. | ||
|
||
If you change a dependency in `Gopkg.toml` you can update an individual package dependency with: | ||
|
||
```bash | ||
docker-compose run --rm update [package] | ||
``` | ||
|
||
If you want to update all packages use: | ||
|
||
```bash | ||
docker-compose run --rm update | ||
``` | ||
We make use of a few key libraries to do all the fancy stuff that the `rig` CLI will do. | ||
|
||
* https://github.com/urfave/cli | ||
* The entire CLI framework from helps text to flags. | ||
This was an easy cli to build b/c of this library. | ||
* https://github.com/fatih/color | ||
* All the fancy terminal color output | ||
* https://github.com/bitly/go-simplejson | ||
* The JSON parse and access library used primarily with the output | ||
of `docker-machine inspect` | ||
* https://gopkg.in/yaml.v2 | ||
* The YAML library for parsing/reading YAML files | ||
* https://github.com/martinlindhe/notify | ||
* Cross-platform desktop notifications | ||
|
||
Release | ||
------- | ||
## Release Instructions | ||
|
||
We use [GoReleaser](https://goreleaser.com) to handle nearly all of our release concerns. GoReleaser will handle | ||
|
||
* Building for all target platforms | ||
* Create a GitHub release on our project page based on tag | ||
* Create archive file for each target platform and attach it to the GitHub release | ||
* Update the Homebrew formula and publish it | ||
* Create .deb and .rpm packages for linux installations | ||
* Creating a GitHub release on our project page based on tag | ||
* Creating archive files for each target platform and attach it to the GitHub release | ||
* Creating .deb and .rpm packages for linux installations and attaching those to the GitHub release | ||
* Updating the Homebrew formula and publish it | ||
|
||
### To create a new release of rig: | ||
|
||
To create a new release of rig: | ||
* Get all the code committed to `master` | ||
* Tag master with the new version number | ||
* Tag master with the new version number `git tag 2.1.0 && git push --tags` | ||
* Run `docker-compose run --rm goreleaser` | ||
* ... | ||
* Profit! | ||
|
||
### To create a new release candidate (RC) of rig: | ||
|
||
Dependencies | ||
------------- | ||
If we want to roll out an RC to GitHub for folks to test, we simply need to run with a different GoReleaser | ||
configuration that does not publish to homebrew, just to a GitHub release that is marked preproduction. | ||
|
||
We make use of a few key libraries to do all the fancy stuff that the `rig` CLI will do. | ||
|
||
* https://github.com/urfave/cli | ||
* The entire CLI framework from helps text to flags. This was an easy cli to build b/c of this library | ||
* https://github.com/fatih/color | ||
* All the fancy terminal color output | ||
* https://github.com/bitly/go-simplejson | ||
* The JSON parse and access library used primarily with the output of `docker-machine inspect` | ||
* https://gopkg.in/yaml.v2 | ||
* The YAML library for parsing/reading YAML files | ||
* Get all the code committed to `develop` | ||
* Tag develop with the new version number `git tag 2.1.0-rc1 && git push --tags` | ||
* Run `docker-compose run --rm goreleaser --config .goreleaser.rc.yml` | ||
* ... | ||
* Profit! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.