Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add Golang recipe #5

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

*.tar.gz
3 changes: 2 additions & 1 deletion cookbook.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
recipes:
- go-github-release
- go-github-release
- golang
2 changes: 1 addition & 1 deletion recipes/go-github-release/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: go-github-release
description: "Dunner recipe for GitHub release of Go Projects"
version: "0.1.0"

preInstallCmd: "curl -O https://raw.githubusercontent.com/leopardlabs/dunner-cookbook/master/recipes/go-github-release/.goreleaser.yml"
preInstallCmd: "curl -O https://raw.githubusercontent.com/leopardslab/dunner-cookbook/master/recipes/go-github-release/.goreleaser.yml"

postInstallMessage: |
This recipe creates a dunner task file `.dunner.yaml` and also `.goreleaser.yml` which contains Github Release information. Edit it accordingly.
Expand Down
34 changes: 34 additions & 0 deletions recipes/golang/.dunner.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
build:
- image: golang
commands:
- ["go", "build", "-o", "<project_name>"]
envs:
- XDG_CACHE_HOME=/tmp/.cache

lint:
- image: golangci/golangci-lint
commands:
- ["golangci-lint", "run"]
envs:
- XDG_CACHE_HOME=/tmp/.cache

vet:
- image: golang
commands:
- ["go", "vet", "./..."]
envs:
- XDG_CACHE_HOME=/tmp/.cache

fmt:
- image: golang
commands:
- ["go", "fmt", "./..."]
envs:
- XDG_CACHE_HOME=/tmp/.cache

test:
- image: golang
commands:
- ["go", "test", "./..."]
envs:
- XDG_CACHE_HOME=/tmp/.cache
11 changes: 11 additions & 0 deletions recipes/golang/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# golang recipe

This recipe creates a dunner task file `.dunner.yaml` which has dunner tasks for lint, build, test for Go projects.
Edit it accordingly and set required environment variables.

To set the version of your project add git tag and push it to master branch remote.

```
$ git tag -a <version> -m "Release version <version>"
$ git push origin <version>
```
11 changes: 11 additions & 0 deletions recipes/golang/metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: golang
description: "Dunner recipe for Golang projects"
version: "0.0.1"

preInstallCmd: ""

postInstallMessage: |
This recipe creates a dunner task file `.dunner.yaml` which has dunner tasks for lint, build, test for Go projects.
Edit it accordingly and set required environment variables.

Run `dunner do <task_name>` to run the task.