-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
51 lines (48 loc) · 1.95 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
stages:
- test
- deploy
testing on python3.6:
image: python:3.6
stage: test
before_script:
- apt-get update -qq && apt-get install -y -qq sqlite3 libsqlite3-dev
- ls -l
- ls -l tests
- pip install -r requirement-devel.txt
script:
# - pytest --cov=muria tests/ # requires pytest-cov
- coverage run --source=muria,tests -m pytest tests -vv
- coverage report -m
# - pytest tests -vv
testing on python3.5:
image: python:3.5
stage: test
before_script:
- apt-get update -qq && apt-get install -y -qq sqlite3 libsqlite3-dev
- ls -l
- ls -l tests
- pip install -r requirement-devel.txt
script:
# - pytest --cov=muria tests/ # requires pytest-cov
- coverage run --source=muria,tests -m pytest tests -vv
- coverage report -m
# - pytest tests -vv/
uploading:
image: alpine:latest
stage: deploy
before_script:
- apk update && apk add openssh sshpass
- ls -l
# since the hosting server use passenger phusion server
- cp muria/wsgi.py passenger_wsgi.py
- chmod 755 */; chmod 755 */*/
- rm -fr .gitlab-ci.yml .git
- ls -l
script:
- export SSHPASS=$REMOTE_SCP_PASSWORD
- sshpass -e ssh -p 64000 -o stricthostkeychecking=no $REMOTE_SCP_USERNAME ls -l $REMOTE_SCP_TARGET_PATH
- sshpass -e ssh -p 64000 -o stricthostkeychecking=no $REMOTE_SCP_USERNAME rm -fr $REMOTE_SCP_TARGET_PATH/muria $REMOTE_SCP_TARGET_PATH/tests
- sshpass -e scp -v -o stricthostkeychecking=no -P 64000 -r ./ $REMOTE_SCP_USERNAME:$REMOTE_SCP_TARGET_PATH
- sshpass -e ssh -p 64000 -o stricthostkeychecking=no $REMOTE_SCP_USERNAME "source $REMOTE_SCP_VIRTUALENV/bin/activate; pip install -r $REMOTE_SCP_TARGET_PATH/requirement-devel.txt"
- sshpass -e ssh -p 64000 -o stricthostkeychecking=no $REMOTE_SCP_USERNAME ls -l $REMOTE_SCP_TARGET_PATH
- sshpass -e ssh -p 64000 -o stricthostkeychecking=no $REMOTE_SCP_USERNAME touch $REMOTE_SCP_TARGET_PATH/tmp/restart.txt