Skip to content

Commit

Permalink
docs: update info for local development (#204)
Browse files Browse the repository at this point in the history
* docs: update info for local development

* refactor: update strings to ' for consistency

* feat: add info on compose services

* chore: fix typo in compose file

* docs: fix spelling mistakes

* feat: add example secrets.env file

* chore: reference secrets.env for ui service

* refactor: update opening web ui page
  • Loading branch information
jbrockopp committed Oct 30, 2020
1 parent 4a3b034 commit b8398fe
Show file tree
Hide file tree
Showing 7 changed files with 337 additions and 149 deletions.
97 changes: 20 additions & 77 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Contributing

We'd love to accept your contributions to this project! There are just a few guidelines you need to follow.
We'd love to accept your contributions to this project!

There are just a few guidelines you need to follow.

## Bugs

Expand All @@ -21,11 +23,7 @@ We are always open to new PRs! You can follow the below guide for learning how y
### Prerequisites

* [Review the commit guide we follow](https://chris.beams.io/posts/git-commit/#seven-rules) - ensure your commits follow our standards
* [Docker](https://docs.docker.com/install/) - building block for local development
* [Docker Compose](https://docs.docker.com/compose/install/) - start up local development
* [Github OAuth Client](https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/) - building block for local Development
* [Golang](https://golang.org/dl/) - for source code and [dependency management](https://github.com/golang/go/wiki/Modules)
* _optional but recommended_ [Make](https://www.gnu.org/software/make/) - start up local development
* [Review the local development docs](../DOCS.md) - ensures you have the Vela application stack running locally

### Setup

Expand All @@ -34,118 +32,63 @@ We are always open to new PRs! You can follow the below guide for learning how y
* Clone this repository to your workstation:

```bash
# Clone the project
# clone the project
git clone git@github.com:go-vela/server.git $HOME/go-vela/server
```

* Navigate to the repository code:

```bash
# Change into the project directory
# change into the cloned project directory
cd $HOME/go-vela/server
```

* Point the original code at your fork:

```bash
# Add a remote branch pointing to your fork
# add a remote branch pointing to your fork
git remote add fork https://github.com/your_fork/server
```

* Create [OAuth App](https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/) and obtain secrets for local development:
* Homepage URL = `<url of api server>`
* Authorization callback URL = `<url of web ui>/account/authenticate`

**NOTE: This will work for GitHub or GitHub Enterprise.**

```bash
# Add Github Client ID to local secrets file for `docker-compose`
echo "VELA_SOURCE_CLIENT=<Github Client ID>" >> secrets.env

# Add Github Client Secret to local secrets file for `docker-compose`
echo "VELA_SOURCE_SECRET=<Github Client Secret>" >> secrets.env
```

### Running Locally
### Development

**Please see our [local development documentation](DOCS.md) for more information.**
**Please review the [local development documentation](../DOCS.md) for more information.**

* Navigate to the repository code:

```bash
# Change into the project directory
# change into the cloned project directory
cd $HOME/go-vela/server
```

* Build the repository code:
* Write your code and tests to implement the changes you desire.
* Please be sure to [follow our commit rules](https://chris.beams.io/posts/git-commit/#seven-rules)

```bash
# Build the code with `make`
make build

# Build the code with `go`
GOOS=linux CGO_ENABLED=0 go build -o release/vela-server github.com/go-vela/server/cmd/vela-server
```

* Run the repository code:
* Run the repository code (ensures your changes perform as you desire):

```bash
# Run the code with `make`
# execute the `up` target with `make`
make up

# Run the code with `docker-compose`
docker-compose -f docker-compose.yml up -d --build
```

* For rebuilding the repository code:

```bash
# Rebuild the code with `make`
make rebuild

# Rebuild the code with `docker-compose`
docker-compose -f docker-compose.yml build
```

* Accessing the Web UI: http://localhost:8888

### Development

**Please see our [local development documentation](DOCS.md) for more information.**

* Navigate to the repository code:
* Test the repository code (ensures your changes don't break existing functionality):

```bash
# Change into the project directory
cd $HOME/go-vela/server
# execute the `test` target with `make`
make test
```

* Write your code and [test locally](#running-locally)
- Please be sure to [follow our commit rules](https://chris.beams.io/posts/git-commit/#seven-rules)

* Write tests for your changes and ensure they pass:
* Clean the repository code (ensures your code meets the project standards):

```bash
# Test the code with `go`
go test ./...
```

* Ensure your code meets the project standards:

```bash
# Clean the code with `make`
# execute the `clean` target with `make`
make clean

# Clean the code with `go`
go mod tidy
go fmt ./...
go vet ./...
```

* Push to your fork:

```bash
# Push your code up to your fork
# push your code up to your fork
git push fork master
```

Expand Down
44 changes: 0 additions & 44 deletions .github/DOCS.md

This file was deleted.

2 changes: 1 addition & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Vela uses a syntax similar to [Docker Compose](https://docs.docker.com/compose/)

For installation and usage, please [visit our user docs](https://go-vela.github.io/docs).

For local development, please [visit our repo docs](DOCS.md).
For local development, please [visit our repo docs](../DOCS.md).

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion .github/SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Please see our [documentation](https://go-vela.github.io/docs) site for more inf

## Local Development

Please see our [local development documentation](DOCS.md) for more information.
Please see our [local development documentation](../DOCS.md) for more information.

## Questions

Expand Down
Loading

0 comments on commit b8398fe

Please sign in to comment.