-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
42 lines (38 loc) · 875 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
41
42
---
image: python:3.6
variables:
DEPLOY_URL: "[email protected]:pip/me4storage/"
stages:
- build
- deploy
build_and_test:
stage: build
script:
- pip install -r requirements.txt
- python setup.py develop
- python -m pytest -v
- python setup.py sdist bdist_wheel
artifacts:
paths:
- dist
expire_in: 48 hour
tags:
- docker
deploy:
stage: deploy
before_script: &ssh_setup
- eval $(ssh-agent -s)
- echo "$DEPLOY_SSH_KEY" | base64 -d | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
script:
- echo "Copying packages to webserver ..."
- apt-get update
- apt-get install -y rsync
- rsync -rv --chmod=D2775,F664 dist/ $DEPLOY_URL
only:
- master
- tags
tags:
- docker