Run unit tests
[ric-plt/appmgr.git] / Dockerfile
index 027e372..ef526e8 100755 (executable)
@@ -52,13 +52,18 @@ RUN GO111MODULE=on go mod download
 # build and test
 COPY . /go/src/ws
 
+# Generate Swagger code
 RUN /go/bin/swagger generate server -f api/appmgr_rest_api.yaml --name AppManager -t pkg/ --exclude-main
 
 COPY . /go/src/ws
 
-RUN make -C /go/src/ws go-build
+# Build the code
+RUN GO111MODULE=on GO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /go/src/ws/cache/go/cmd/appmgr cmd/appmgr.go
 
-RUN make -C /go/src/ws go-test-fmt
+# Run unit tests
+RUN GO111MODULE=on GO_ENABLED=0 GOOS=linux go test -p 1 -cover ./pkg/cm/ ./pkg/helm/ ./pkg/resthooks/
+
+RUN gofmt -l $(find cmd/ pkg/  -name '*.go' -not -name '*_test.go')
 
 CMD ["/bin/bash"]