-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
executable file
·82 lines (67 loc) · 2.2 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
image: python:3.6
variables:
# Change pip's cache directory to be inside the project directory since we can only cache local items.
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
# URL for doc upload
DOC_UPLOAD: "http://something.com"
# Pip's cache doesn't store the python packages https://pip.pypa.io/en/stable/reference/pip_install/#caching
# If you want to also cache the installed packages, you have to install them in a virtualenv and cache it as well.
cache:
paths:
- .cache/
- venv/
before_script:
# Verbosity:
- env |grep CI_
- pwd
## SSH handle
#- mkdir -p ~/.ssh
#- echo "$SSH_CONFIG" >> ~/.ssh/config # quote need so that pass variable with newlines
## auto confirm RSA key fingerprint:
#- echo "StrictHostKeyChecking no" | cat - ~/.ssh/config > temp && mv temp ~/.ssh/config
#- echo "$SSH_PRIVATE_KEY" > ~/.ssh/gitlabgem
#- cat ~/.ssh/config
#- tail ~/.ssh/gitlabgem
#- chmod 600 ~/.ssh/gitlabgem
#- eval $(ssh-agent -s) && ssh-add ~/.ssh/gitlabgem
# Uncomment this if you want to try the SSH config:
#- ssh -T git@git.gem.myengie.com
## Package config file:
#- echo "$CFG_FILE" > cfg.yaml
## Pip config:
#- mkdir -p ~/.pip
#- echo "$PIP_CONF" > ~/.pip/pip.conf
# Install your project
- pip install -U setuptools pbr virtualenv
- virtualenv venv
- source venv/bin/activate
- pip install -r requirements-dev.txt
- pip install --process-dependency-links --editable .
stages:
- test
- build-doc
- deploy-doc
pytest:
stage: test
tags: # will search for a gitlab-runner with at least those tags
- docker # ask for docker hub availability
script:
- py.test tests
build_doc:
stage: build-doc
tags: # will search for a gitlab-runner with at least those tags
- docker # ask for docker hub availability
script:
- python setup.py build_sphinx
artifacts:
paths:
- docs/build
deploy_doc:
stage: deploy-doc
before_script:
- pwd && ls
script:
- cd docs/build/html && zip -r doc.zip *
- curl --fail --form docfile=@doc.zip $DOC_UPLOAD/$CI_PROJECT_NAME/master
only:
- master