Skip to content

Commit b4cfa14

Browse files
authored
OSS must have task list (#9)
Signed-off-by: Valentin Pichard <[email protected]>
1 parent 21ade3e commit b4cfa14

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+676
-6388
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
vault.json
1919
/utask
2020
vaultfile.json
21+
.DS_Store
2122

2223
# Related to UI
2324
ui/dashboard/dist

.travis.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
os:
2+
- linux
3+
4+
language: go
5+
go:
6+
- 1.12
7+
- 1.13
8+
go_import_path: github.com/ovh/utask
9+
10+
cache:
11+
directories:
12+
- $GOPATH/src/github.com/ovh/utask/vendor
13+
14+
addons:
15+
postgresql: "9.5"
16+
17+
env:
18+
global:
19+
- GO111MODULE=on
20+
- DEV=true
21+
- PG_USER=travis
22+
- PG_PASSWORD=travispwd
23+
- PG_HOST=localhost
24+
- PG_PORT=5432
25+
- PG_DATABASENAME=travisdb
26+
- PSQL_BIN="psql travisdb"
27+
28+
before_script:
29+
- psql -c 'create database travisdb;' -U postgres
30+
31+
script:
32+
- make test-travis
33+
34+
after_success:
35+
- $GOPATH/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ FROM golang:1.12.7
1616
COPY . /go/src/github.com/ovh/utask
1717
WORKDIR /go/src/github.com/ovh/utask
1818
RUN make re
19-
RUN mv Makefile-child Makefile
19+
RUN mv hack/Makefile-child Makefile
2020

2121
RUN mkdir -p /app/plugins /app/templates /app/config /app/init /app/static/dashboard /app/static/editor
2222
WORKDIR /app

Makefile

+16-13
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
BINARY = utask
22

33
MAIN_LOCATION = ./cmd
4-
TEST_LOCATION = ./...
54

6-
TEST_CMD = go test -v -cover ${TEST_LOCATION}
5+
TEST_LOCATION = ./...
6+
TEST_CMD = go test -v -mod=vendor -cover ${TEST_LOCATION}
7+
TEST_CMD_COV = ${TEST_CMD} -covermode=count -coverprofile=coverage.out
78

89
VERSION = 1.0.0
910
LAST_COMMIT = `git rev-parse HEAD`
@@ -13,8 +14,7 @@ DOCKER = 0
1314
DOCKER_OPT =
1415

1516
define build_binary
16-
GO111MODULE=on go get -d -v ./...
17-
GO111MODULE=on go build -ldflags "-X ${VERSION_PKG}.Commit=${LAST_COMMIT} -X ${VERSION_PKG}.Version=${VERSION}" \
17+
GO111MODULE=on go build -mod=vendor -ldflags "-X ${VERSION_PKG}.Commit=${LAST_COMMIT} -X ${VERSION_PKG}.Version=${VERSION}" \
1818
-o $(1) ${MAIN_LOCATION}/$(1)
1919
@[ ${DOCKER} -eq 0 ] || $(call docker_build,$(1))
2020
endef
@@ -28,10 +28,8 @@ all: ${BINARY}
2828
${BINARY}:
2929
$(call build_binary,${BINARY})
3030

31-
generate:
32-
go get github.com/ybriffa/jsonenums
33-
go get golang.org/x/tools/cmd/stringer
34-
go generate ./...
31+
generate-install-script:
32+
bash hack/generate-install-script.sh
3533

3634
docker:
3735
@echo docker build enabled!
@@ -45,15 +43,20 @@ re: clean all
4543
test:
4644
go get github.com/jstemmer/go-junit-report
4745
go get github.com/stretchr/testify/assert
48-
GO111MODULE=on DEV=true bash test.sh ${TEST_CMD} 2>&1 | go-junit-report > report.xml
46+
GO111MODULE=on DEV=true bash hack/test.sh ${TEST_CMD} 2>&1 | go-junit-report > report.xml
47+
48+
test-travis:
49+
go get golang.org/x/tools/cmd/cover
50+
go get github.com/mattn/goveralls
51+
hack/test.sh ${TEST_CMD_COV}
4952

5053
test-docker:
51-
DEV=true bash test-docker.sh ${TEST_CMD}
54+
DEV=true bash hack/test-docker.sh ${TEST_CMD}
5255

5356
run-test-stack:
54-
bash test.sh bash interactive.sh
57+
bash hack/test.sh bash hack/interactive.sh
5558

5659
run-test-stack-docker:
57-
bash test-docker.sh bash interactive.sh
60+
bash hack/test-docker.sh bash hack/interactive.sh
5861

59-
package:
62+
package:

0 commit comments

Comments
 (0)