-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
46 lines (40 loc) · 913 Bytes
/
.gitlab-ci.yml
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
stages:
- build
- test
- deploy
variables:
DOCKER_TLS_CERTDIR: ""
DOCKER_REGISTRY: localhost:5000
CI_REGISTRY_IMAGE: $DOCKER_REGISTRY/skills/developer-skills-rating-client
default:
image: docker:23.0.3
cache:
key: "$CI_COMMIT_REF_NAME"
paths:
- cache/
build_job:
stage: build
only:
- main
script:
- echo "Running build"
- docker build -t $CI_REGISTRY_IMAGE .
- docker push $CI_REGISTRY_IMAGE
# disabled
.test_job:
stage: test
only:
- main
script:
- echo "Running tests"
- docker run --name frontend-container -d frontend-image
- docker exec frontend-container npm test --passWithNoTests
- docker stop frontend-container
- docker rm frontend-container
deploy_job:
stage: deploy
only:
- main
script:
- echo "Deploying to Docker Swarm"
- docker stack deploy --compose-file docker-compose-dev.yml frontend-skills-stack