Skip to content

Commit

Permalink
Merge pull request #36 from Clivern/feature/parallel-config
Browse files Browse the repository at this point in the history
add parallel config
  • Loading branch information
Clivern authored Jun 9, 2019
2 parents 9a8ae5c + 2bee08a commit 23dd929
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<p align="center">
<a href="https://godoc.org/github.com/clivern/rabbit"><img src="https://godoc.org/github.com/clivern/rabbit?status.svg"></a>
<a href="https://travis-ci.org/Clivern/Rabbit"><img src="https://travis-ci.org/Clivern/Rabbit.svg?branch=master"></a>
<a href="https://github.com/Clivern/Rabbit/releases"><img src="https://img.shields.io/badge/Version-0.0.1-red.svg"></a>
<a href="https://github.com/Clivern/Rabbit/releases"><img src="https://img.shields.io/badge/Version-0.0.2-red.svg"></a>
<a href="https://goreportcard.com/report/github.com/Clivern/Rabbit"><img src="https://goreportcard.com/badge/github.com/Clivern/Rabbit"></a>
<a href="https://github.com/Clivern/Rabbit/blob/master/LICENSE"><img src="https://img.shields.io/badge/LICENSE-MIT-orange.svg"></a>
</p>
Expand All @@ -14,12 +14,12 @@
Rabbit is a lightweight service that will build and store your go projects binaries. Once a VCS system (github or bitbucket) notifies rabbit of a new release, it clones the project, builds different binaries and publish them.

<p align="center">
<img src="https://raw.githubusercontent.com/Clivern/Rabbit/master/assets/img/diagram.png?v=0.0.1" />
<img src="https://raw.githubusercontent.com/Clivern/Rabbit/master/assets/img/diagram.png?v=0.0.2" />
</p>
<br/>
<p align="center">
<h3 align="center">Screenshot</h3>
<img src="https://raw.githubusercontent.com/Clivern/Rabbit/master/assets/img/screenshot.png?v=0.0.1" />
<img src="https://raw.githubusercontent.com/Clivern/Rabbit/master/assets/img/screenshot.png?v=0.0.2" />
</p>
<br/>

Expand Down Expand Up @@ -90,6 +90,7 @@ releases:
build:
# Build absolute path
path: /app/var/build
parallelism: 1

# Application Database
database:
Expand Down Expand Up @@ -126,7 +127,7 @@ $ go run rabbit.go -config=/custom/path/config.prod.yml

## Deployment

Rabbit needs a decent resources to be able to work properly. Because the build process itself done by goreleaser and it consumes a lot. So better to keep `parallelism` equal `1` and increase if you have more resources and would like to speed the build process.
Rabbit needs a decent resources to be able to work properly. Because the build process itself done by goreleaser and it consumes a lot. So better to keep `build.parallelism` equal `1` and increase if you have more resources and would like to speed the build process.

### On a Linux Server

Expand Down
1 change: 1 addition & 0 deletions config.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ releases:
build:
# Build absolute path
path: /app/var/build
parallelism: 1

# Application Database
database:
Expand Down
1 change: 1 addition & 0 deletions deployments/docker-compose/configs/config.docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ releases:
build:
# Build absolute path
path: /app/var/build
parallelism: 1

# Application Database
database:
Expand Down
11 changes: 10 additions & 1 deletion internal/app/module/releaser.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/spf13/viper"
"os"
"path/filepath"
"strconv"
"strings"
)

Expand Down Expand Up @@ -87,7 +88,15 @@ func (r *Releaser) Release() (bool, error) {
func (r *Releaser) Build() (bool, error) {
cmd := pkg.NewShellCommand()

_, err := cmd.Exec(r.BuildPath, "goreleaser", "--snapshot", "--skip-publish", "--rm-dist")
_, err := cmd.Exec(
r.BuildPath,
"goreleaser",
"--snapshot",
"--skip-publish",
"--rm-dist",
"--parallelism",
strconv.Itoa(viper.GetInt("build.parallelism")),
)

if err != nil {
return false, err
Expand Down

0 comments on commit 23dd929

Please sign in to comment.