-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
40 lines (37 loc) · 995 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
image: vevende/ci:latest
stages:
- build
- tests
- deploy
build:
stage: build
services:
- docker:dind
script:
- docker-compose run --rm frontend npm run build
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
- docker build -t registry.gitlab.com/limbert/inventory-dev:latest .
- docker push registry.gitlab.com/limbert/inventory-dev:latest
cache:
paths:
- src/frontend/node_modules
- src/frontend/.cache
tests:
stage: tests
services:
- docker:dind
script:
- docker-compose run --rm backend python src/manage.py test src/gaspar/
production:
stage: deploy
variables:
DEPLOY_URL: tudominio
environment:
name: production
url: tudominio
only:
- master
script:
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- ansible-playbook -vvv -i provision/inventory.ini provision/deploy.yml