-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
175 additions
and
40 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Lines starting with '#' are comments. | ||
# Each line is a file pattern followed by one or more owners. | ||
|
||
# These owners will be the default owners for everything in the repo. | ||
* @revett |
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,29 +1,37 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
|
||
name: Bug Report | ||
about: Highlight a problem with the project | ||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
## Summary | ||
|
||
A clear and concise description of what the bug is... | ||
|
||
## To Reproduce | ||
|
||
Describle how to reproduce the behavior of the bug: | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
1. Click on '...' | ||
1. Scroll down to '...' | ||
1. See error | ||
|
||
## Expected Behaviour | ||
|
||
A clear and concise description of what you expected to happen... | ||
|
||
## Docker | ||
|
||
Which version... | ||
|
||
## Docker Compose | ||
|
||
Which version... | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
## Operating System | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
Are you running Mac, Windows or Linux... | ||
|
||
**Desktop (please complete the following information):** | ||
- OS: [e.g. iOS] | ||
- Browser [e.g. chrome, safari] | ||
- Version [e.g. 22] | ||
## Screenshots | ||
|
||
**Additional context** | ||
Add any other context about the problem here. | ||
If applicable, add screenshots to help explain your problem. |
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,17 +1,17 @@ | ||
--- | ||
name: Feature request | ||
name: Feature Request | ||
about: Suggest an idea for this project | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
## Describe the Solution | ||
|
||
A clear and concise description of what you want to happen... | ||
|
||
## Why? | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
Make the contributors of this project understand why this is an important | ||
feature for them to implement... | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
## Additional Context | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. | ||
Add any other context or screenshots about the feature request here... |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<h1 align="center"> | ||
Contributing to neo-local | ||
</h1> | ||
|
||
<p align="center"> | ||
First off, thanks for taking the time to contribute! 🎉👍 | ||
</p> | ||
|
||
<p align="center"> | ||
The following is a set of guidelines for contributing to <b>neo-local</b>. Please use | ||
your best judgement when following them, and feel free to propose changes to this | ||
document in a pull request. | ||
</p> | ||
|
||
## Git Flow | ||
|
||
This project follows the [Git Flow](https://jeffkreeftmeijer.com/git-flow/) | ||
branching workflow for managing features, hotfixes and releases. | ||
|
||
Please have a read first of Jeff Kreeftmeijer | ||
[blog post](https://jeffkreeftmeijer.com/git-flow/) which does a great job of | ||
describing it. | ||
|
||
After cloning the repo locally, create a new feature branch: | ||
|
||
``` | ||
git checkout -b feat/my-awesome-feature develop | ||
``` | ||
|
||
When ready push your changes from this branch to remove (Github) and create a | ||
new pull request against the **develop** branch. |
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 +1 @@ | ||
0.10.0 | ||
0.11.0 |
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 |
---|---|---|
@@ -0,0 +1,89 @@ | ||
package commands | ||
|
||
import ( | ||
"errors" | ||
"fmt" | ||
"log" | ||
"strings" | ||
|
||
"github.com/CityOfZion/neo-local/cli/services" | ||
"github.com/CityOfZion/neo-local/cli/stack" | ||
"github.com/urfave/cli" | ||
|
||
"github.com/docker/docker/api/types" | ||
"github.com/docker/docker/client" | ||
"golang.org/x/net/context" | ||
) | ||
|
||
type ( | ||
// Status is the CLI command for checking the status of containers in the | ||
// development environment. | ||
Status struct{} | ||
) | ||
|
||
// NewStatus creates a new Status. | ||
func NewStatus() Status { | ||
return Status{} | ||
} | ||
|
||
// ToCommand generates the CLI command struct. | ||
func (s Status) ToCommand() cli.Command { | ||
return cli.Command{ | ||
Action: s.action(), | ||
Aliases: []string{"ps"}, | ||
Flags: s.flags(), | ||
Name: "status", | ||
Usage: "Output overall health of network", | ||
} | ||
} | ||
|
||
func (s Status) action() func(c *cli.Context) error { | ||
return func(c *cli.Context) error { | ||
ctx := context.Background() | ||
cli, err := client.NewEnvClient() | ||
if err != nil { | ||
return errors.New("Unable to create Docker client") | ||
} | ||
|
||
ok := services.CheckDockerRunning(ctx, cli) | ||
if !ok { | ||
return errors.New("Docker is not running") | ||
} | ||
|
||
services := stack.Services() | ||
runningContainers, err := cli.ContainerList(ctx, types.ContainerListOptions{}) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
for _, container := range runningContainers { | ||
containerName := "" | ||
for _, name := range container.Names { | ||
if strings.Contains(name, "coz_neo-local_") { // TODO: this string should be a const. | ||
fmt.Println(name) | ||
containerName = name | ||
break | ||
} | ||
} | ||
|
||
if containerName == "" { | ||
continue | ||
} | ||
|
||
for _, service := range services { | ||
if strings.Contains(containerName, service.ContainerName()) { | ||
log.Printf( | ||
"%s in '%s' state", service.Image, container.State, | ||
) | ||
break | ||
} | ||
} | ||
} | ||
|
||
return nil | ||
} | ||
} | ||
|
||
func (s Status) flags() []cli.Flag { | ||
return []cli.Flag{} | ||
} |
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
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