This repository has been archived by the owner on Mar 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
.gitlab-ci.yml
84 lines (73 loc) · 1.55 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
variables:
NOSE_REDNOSE_COLOR: force
GIT_DEPTH: 50
GIT_STRATEGY: fetch
APITESTS: "$CI_PROJECT_DIR/apitests"
VUSEVER: "$CI_PROJECT_DIR/vuserver"
VENV: "$CI_PROJECT_DIR/virtualenv"
COVERAGE: "$CI_PROJECT_DIR/bin/coverage"
ARTIFACTS: "$CI_PROJECT_DIR/artifacts"
stages:
- lint
- flake
- test
- deploy
.constants:
- &limit_resources "/usr/bin/sudo /usr/local/bin/limit-gitlab-job-resources"
before_script:
- "echo Before Script:"
django:lint:
stage: lint
# image: python/3.7.13-slim-bullseye
# image: python:3.7.13-slim-bullseye
tags:
- cherry
# only:
# - master
except:
- master
script:
- pip install pylint
- cd $CI_PROJECT_DIR
- pylint $VUSEVER
allow_failure: true
django:flake8:
stage: flake
tags:
- cherry
# only:
# - master
except:
- master
script:
# - figlet "Python FLAKE8"
- pip install flake8
- cd $CI_PROJECT_DIR
- flake8 $VUSEVER
allow_failure: true
django:test:
stage: test
only:
- master
script:
- cd $APITESTS
- chmod +x coverage.sh
- chmod +x getcoverage.sh
# - figlet "Python PYTEST"
# - *install_virtualenv
- cd $CI_PROJECT_DIR/
- ./apitests/coverage.sh
allow_failure: true
artifacts:
paths:
- $CI_PROJECT_DIR/htmlcov.tar
deploy_script:
stage: deploy
only:
- master
script:
- figlet "Deploy Script"
- cd $APITESTS
- pwd
- sshpass -p "passwd" ssh -o ConnectTimeout=10 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@host 'bash -s' < ./updateservice.sh
when: manual