-
Notifications
You must be signed in to change notification settings - Fork 45
/
.gitlab-ci.yml
54 lines (47 loc) · 1.35 KB
/
.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
47
48
49
50
51
52
53
54
workflow:
name: 'CPF: $CPF'
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
DOCKER_TLS_CERTDIR: "/certs"
services:
- docker:dind
stages:
- build
- coverage_report
- relatorio
before_script:
- echo $CI_PIPELINE_SOURCE
- echo $CPF
# Stage to build the Docker image and push it to the registry
build:
stage: build
image: docker:stable
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker build -t registry.gitlab.com/guilhermecgs/ir:latest .
- docker push registry.gitlab.com/guilhermecgs/ir:latest
rules:
- if: '$CI_PIPELINE_SOURCE == "push"'
when: always
coverage_html:
stage: coverage_report
image: registry.gitlab.com/guilhermecgs/ir:latest
script:
- python3 coverage_test.py
- mkdir -p public/coverage_report
- mv coverage_report public/coverage_report
artifacts:
paths:
- public
expire_in: 15 days
rules:
- if: '$CI_PIPELINE_SOURCE == "push"'
when: always
relatorio:
stage: relatorio
image: registry.gitlab.com/guilhermecgs/ir:latest
script:
- python3 ./ir.py --do check_environment_variables
# - python3 ./ir.py --do busca_trades_e_faz_merge_operacoes
- python3 ./ir.py --do calculo_ir --numero_de_meses 999
retry: 2