-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathlets.yaml
More file actions
128 lines (111 loc) · 3.08 KB
/
lets.yaml
File metadata and controls
128 lines (111 loc) · 3.08 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
shell: bash
mixins:
- build.yaml
- -lets.my.yaml
plugins:
docker-push-pull:
repo: lets-cli/lets-plugin-docker-push-pull
# TODO version is hashed for cache
version: v0.0.45
#version: latest
# TODO url is hashed for cache
url: "https://github.com/lets-cli/lets/releases/download/{{.Version}}/lets_{{.Os}}_{{.Arch}}.tar.gz"
# TODO if bin specified, url is ignored
bin: ../lets-plugin-docker-push-pull/docker-push-pull
env:
NAME: "max"
AGE: 27
CURRENT_UID:
sh: echo "`id -u`:`id -g`"
NGINX_DEV:
checksum: [go.mod, go.sum]
LINT_TAG:
checksum: [docker/lint.Dockerfile]
commands:
build-image:
plugins:
docker-push-pull:
registry_url: "https://registry.evo.dev"
build_context: "/home/max/code/lets-workspace/lets"
dockerfile: docker/lint.Dockerfile
# image: registry.evo.dev/core-team/company-stats/backend
image: lets-lint
tag: "123" # TODO has to resolve env
# tag: ${LINT_TAG} # TODO has to resolve env
target: dev
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
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