-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
42 lines (39 loc) · 971 Bytes
/
.gitlab-ci.yml
File metadata and controls
42 lines (39 loc) · 971 Bytes
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
stages:
- test
- release
gotest:
stage: test
image: golang:1.14
before_script:
- curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.19.1
script:
- go test ./...
- golangci-lint run
npmtest:
stage: test
image: node:current
before_script:
- cd ui/static
- npm install
script:
- npm test
- npx eslint .
build:
stage: release
image: docker:stable
variables:
BUILD_IMAGE_NAME: "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA"
LATEST_REF_IMAGE: $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest
services:
- docker:stable-dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
script:
- >-
docker build
--tag "$LATEST_REF_IMAGE"
--tag "$BUILD_IMAGE_NAME" .
- docker push "$BUILD_IMAGE_NAME"
- docker push "$LATEST_REF_IMAGE"
only:
- master