-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathlets.yaml
133 lines (112 loc) · 3.38 KB
/
lets.yaml
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
shell: bash
mixins:
- lets.build.yaml
- -lets.my.yaml
env:
CURRENT_UID:
sh: echo "`id -u`:`id -g`"
commands:
release:
description: |
Create tag and push
If -rcN (e.g 1.0.0-rc1) sufix used in version, it will be considered as a prerelease
options: |
Usage: lets release <version> --message=<message>
Options:
<version> Set version (e.g. 1.0.0)
--message=<message>, -m Release message
Example:
lets release 1.0.0 -m "Release 1.0.0"
lets release 1.0.0-rc1 -m "Prerelease 1.0.0-rc1"
cmd: |
if [[ "${LETSOPT_VERSION}" != *-rc* ]] && [[ -z "$(grep "\[${LETSOPT_VERSION}\]" docs/docs/changelog.md)" ]]; then
echo "Version ${LETSOPT_VERSION} not found in changelog. Update docs/docs/changelog.md and try again."
exit 1
fi
git tag -a v${LETSOPT_VERSION} -m "${LETSOPT_MESSAGE}"
git push --tags
test-unit:
description: Run unit tests
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>] [--opts=<opts>]
Example:
lets test-bats config_version.bats
lets test-bats config_version.bats --opts="-f <regexp>"
cmd: docker compose run --rm test-bats
test-completions:
ref: test-bats
args: zsh_completion.bats_
description: |
Run completions tests
This tests are separate because it hangs on Github Actions
test:
description: Run unit and bats tests
depends:
- test-unit
- test-bats
- test-completions
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
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>] [--bin=<bin>]
Options:
--path=<path>, -p Custom executable path
--bin=<bin> Binary name (default: lets-dev)
Example:
lets build-and-install
lets build-and-install -p ~/bin
lets build-and-install -p ~/bin --bin=my-lets
cmd: |
VERSION=$(git describe)
PATH2LETSDEV="/usr/local/bin"
BIN="${LETSOPT_BIN:-lets-dev}"
if [[ -n ${LETSOPT_PATH} ]]; then
PATH2LETSDEV=$LETSOPT_PATH
fi
go build -ldflags="-X main.version=${VERSION:1}-dev" -o "${BIN}" *.go && \
sudo mv ./${BIN} $PATH2LETSDEV/${BIN} && \
echo " - binary ${BIN} version ${VERSION} successfully installed in ${PATH2LETSDEV}"
build:
description: Build lets from source code
options: |
Usage: lets build [<bin>]
cmd: |
VERSION=$(git describe)
BIN=${LETSOPT_BIN:-lets}
go build -ldflags="-X main.version=${VERSION:1}-dev" -o ${BIN} *.go && \
echo " - binary './${BIN}' (version ${VERSION}) successfully build"
publish-docs:
work_dir: docs
cmd: npm run doc:deploy
run-docs:
work_dir: docs
cmd: npm start