-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathlets.yaml
More file actions
108 lines (92 loc) · 2.33 KB
/
lets.yaml
File metadata and controls
108 lines (92 loc) · 2.33 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
shell: bash
mixins:
- build.yaml
- -lets.my.yaml
env:
NAME: "max"
AGE: 27
CURRENT_UID:
sh: echo "`id -u`:`id -g`"
NGINX_DEV:
checksum: [go.mod, go.sum]
eval_env:
CURRENT_UID: echo "`id -u`:`id -g`"
commands:
release:
description: Create tag and push
options: |
Usage: lets release <version> --message=<message>
Options:
<version> Set version
--message=<message>, -m Release message
cmd: |
git tag -a v${LETSOPT_VERSION} -m "${LETSOPT_MESSAGE}"
git push --tags
test-unit:
description: |
Run unit tests
(-run TestCase to run one test)
depends: [build-lets-image]
cmd:
- docker-compose
- run
- --rm
- test
test-bats:
description: Run bats tests
depends: [build-lets-image]
options: |
Usage: lets test-bats [<test>]
cmd: |
docker-compose run --rm test-bats
test:
description: Run unit and bats tests
depends:
- test-unit
- test-bats
coverage:
description: Run tests for lets
options: |
Usage: lets coverage [--html]
Options: --html
cmd: |
if [[ -n ${LETSOPT_HTML} ]]; then
go tool cover -html=coverage.out
else
go tool cover -func=coverage.out
fi
staticcheck:
description: Run staticcheck for lets. Staticcheck is go vet on steroids
depends: [build-lets-image]
cmd:
docker-compose run --rm staticheck
lint:
description: Run golint-ci
depends: [build-lint-image]
cmd:
- docker-compose run --rm lint
fmt:
description: Run sfmt
cmd:
go fmt ./...
build-and-install:
description: Build and install lets-dev version from source code
options: |
Usage: lets build-and-install [--path=<path>]
Options:
--path=<path>, -p Custom executable path
cmd: |
VERSION=$(git describe)
PATH2LETSDEV="/usr/local/bin"
if [[ -n ${LETSOPT_PATH} ]]; then
PATH2LETSDEV=$LETSOPT_PATH
fi
go build -ldflags="-X main.version=${VERSION:1}-dev" -o lets-dev *.go && \
sudo mv ./lets-dev $PATH2LETSDEV/lets-dev && \
echo " - build 'lets-dev' successfully installed in ${PATH2LETSDEV}"
publish-docs:
work_dir: docs
cmd: npm run doc:deploy
run-docs:
work_dir: docs
cmd: npm start