-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
59 lines (52 loc) · 1.99 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
# Version 3.7 is necessary for `numpy` to build correctly
image: python:3.7
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
HERMES_ROOT: /var/www/dynaikon/dynaikon.com/dynaikontrap-docs
RELEASE_ROOT: /var/www/dynaikon/dynaikon.com/releases
cache:
paths:
- .cache/pip
- venv/
before_script:
# https://docs.gitlab.com/ee/ci/caching/#cache-python-dependencies
- python -V
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
- pip install --upgrade pip
# To allow building on non-RPi architecture
- export READTHEDOCS=True
- cd docs
- pip install -r requirements.txt && pip install -r ../requirements.txt
run:
only:
- master
script:
# Currently in `docs` directory (from `before_script` above)
- make clean && make html
# Delete current documentation
# -f flag removes error status for non existing files
- rm -rfv "$HERMES_ROOT"/*
# Copy new documentation
- cp -rv build/html/* "$HERMES_ROOT"
- date +"Version $(cat ../DynAIkonTrap/VERSION) built at %F-%H%M%S %Z from commit $CI_COMMIT_SHORT_SHA" > "$HERMES_ROOT/buildinfo"
# Create tarball at webroot
- tar -czvf "$HERMES_ROOT/DynAikonTrap-Docs.tar.gz" -C build/html .
# Create Downloadable Artifact
- tar -czvf "$CI_PROJECT_DIR/DynAikonTrap-Docs.tar.gz" -C build/html .
# Update the release tarball
# move to root directory; out of docs/
- cd ..
# build the tarball using python sdist
- python3 setup.py sdist
# copy contents of ./dist to dynaikon.com/releases
- cp -rv dist/* "$RELEASE_ROOT"
- cp -rv dist/* "$RELEASE_ROOT/DynAIkonTrap.tar.gz"
- date +"Version $(cat DynAIkonTrap/VERSION) built at %F-%H%M%S %Z from commit $CI_COMMIT_SHORT_SHA" > "$RELEASE_ROOT/buildinfo"
# create a downloadable release artifact
- cp -rv dist/* "$CI_PROJECT_DIR/DynAIkonTrap.tar.gz"
artifacts:
paths:
- "$CI_PROJECT_DIR/DynAikonTrap-Docs.tar.gz"
- "$CI_PROJECT_DIR/DynAikonTrap.tar.gz"