forked from kkamkou/gitmostwanted.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wercker.yml
44 lines (43 loc) · 1.85 KB
/
wercker.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
box: wercker/python
build:
steps:
- virtualenv:
name: virtual environment
python_location: /usr/bin/python3.4
- script:
name: artifacts
code: |-
rsync -az "$WERCKER_SOURCE_DIR/gitmostwanted" "$WERCKER_OUTPUT_DIR"
rsync -az "$WERCKER_SOURCE_DIR/migration" "$WERCKER_OUTPUT_DIR"
rsync -az "$WERCKER_SOURCE_DIR/alembic.ini" "$WERCKER_OUTPUT_DIR"
- pip-install:
packages_list: pytest-pep8 pytest-cov==1.8.1 responses coveralls
- script:
name: py.test
code: py.test --pep8 --cov . --cov-report annotate gitmostwanted tests/unit
- script:
name: transfer code coverage
code: coveralls
deploy:
steps:
- add-to-known_hosts:
local: true
hostname: gitmostwanted.com
fingerprint: 97:f6:e7:04:ad:fd:23:b9:70:af:cd:7e:c4:47:6a:8c
- add-ssh-key:
keyname: SSH_KEY
host: gitmostwanted.com
- script:
name: source-code upload
code: |-
rsync -az --delete-after ./gitmostwanted gitmostwanted@gitmostwanted.com:"$PROJECT_SOURCE_DIR"
rsync -az --delete-after ./migration gitmostwanted@gitmostwanted.com:"$PROJECT_SOURCE_DIR"
rsync -az ./alembic.ini gitmostwanted@gitmostwanted.com:"$PROJECT_SOURCE_DIR"
- script:
name: migrations
code: ssh gitmostwanted@gitmostwanted.com "source ~/.venv.sh; cd $PROJECT_SOURCE_DIR; alembic upgrade head"
- script:
name: reload services
code: |
ssh gitmostwanted@gitmostwanted.com "touch $PROJECT_SOURCE_DIR/gitmostwanted.com.wsgi"
ssh gitmostwanted@gitmostwanted.com "(cat $PROJECT_SOURCE_DIR/celery.pid | xargs kill -15) &>/dev/null || true"