forked from matthieudelaro/nut
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nut.yml
71 lines (70 loc) · 2.12 KB
/
nut.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
syntax_version: "7"
project_name: nut
docker_image: matthieudelaro/golang:1.6-cross
work_in_project_folder_as: /go/src/github.com/matthieudelaro/nut
macros:
setup:
usage: call after pulling the project, to install dependencies
actions:
- govendor fetch +missing
build:
usage: build the project
actions:
- go build -o `pwd | xargs basename`
build-all:
usage: build the project for linux, OSX, and for Windows
actions:
- export dirName=`pwd | xargs basename`
- echo Building for linux...
- env GOOS=linux GOARCH=amd64 go build -o `echo $dirName`Linux
- echo Building for OSX...
- env GOOS=darwin GOARCH=amd64 go build -o `echo $dirName`OSX
- echo Building for Windows...
- env GOOS=windows GOARCH=amd64 go build -o `echo $dirName`Windows.exe
aliases:
- ba
build-linux:
usage: build the project for Linux
actions:
- env GOOS=linux GOARCH=amd64 go build -o `pwd | xargs basename`Linux
aliases:
- bl
build-osx:
usage: build the project for OSX
actions:
- env GOOS=darwin GOARCH=amd64 go build -o `pwd | xargs basename`OSX
aliases:
- bo
description: cross-compile the project to run on OSX, with architecture amd64.
build-windows:
usage: build the project for Windows
actions:
- env GOOS=windows GOARCH=amd64 go build -o `pwd | xargs basename`Windows.exe
aliases:
- bw
run:
usage: run the project in the container
volumes:
dockersock: # mount docker socket run nut in a container
host_path: /var/run/docker.sock
container_path: /var/run/docker.sock
actions:
- ./`pwd | xargs basename`
test:
usage: test the project
actions:
- go test
- cd config
- go test
code:
usage: open this project in vscode
docker_image: ctaggart/golang-vscode
enable_gui: true
volumes:
dockersock: # mount docker socket run nut in a container
host_path: /var/run/docker.sock
container_path: /var/run/docker.sock
security_opts:
- seccomp=unconfined
actions:
- su - vscode -c "export GOPATH=/go; code -w /go/src/github.com/matthieudelaro/nut"