Commit d69e07cb6608ead2a23cfde80e475f2c2e92603b

Authored by hitier
2 parents 15bceff0 1877f051
Exists in rhitier-dev and in 1 other branch DEV

Merge branch 'AutoDeploy' into dev

DEV.md
... ... @@ -9,6 +9,9 @@
9 9  
10 10 ## Testing
11 11  
  12 + # prerequisites
  13 + pip install -r requirements-tests.txt
  14 +
12 15 # basic
13 16 PYTHONPATH=. pytest
14 17  
... ...
README.md
... ... @@ -43,7 +43,7 @@ virtualenv
43 43 ### Python venv
44 44  
45 45 ``` bash
46   -virtualenv venv
  46 +python3 -m venv venv
47 47 source venv/bin/activate
48 48 pip install matplotlib
49 49 pip install numpy==1.8.*
... ...
requirements-tests.txt
1   -selenium flask_testing
  1 +selenium
  2 +flask_testing
  3 +pytest
... ...
requirements.txt
... ... @@ -7,52 +7,13 @@
7 7  
8 8  
9 9 ## MAIN DEPENDENCIES
10   -
11   -Flask==0.12
12   -Jinja2==2.9.5
13   -Markdown==2.6.8
14   -MarkupSafe==1.0
15   -python-slugify==1.2.4
16   -requests==2.19.1
17   -
18   -# Why not pyvo ?
19   -# For obscure reasons within spacepy, only numpy 1.7 or 1.8 will work
20   -# and pyvo requires astropy, that requires a more recent numpy.
21   -#pyvo==0.9.*
22   -
23   -
24   -## FILE FORMATS
25   -
26   -# Also available : https://pypi.org/project/pupynere/
27   -
28   -PyYAML==3.12
29   -netCDF4==1.2.7
30   -h5py==2.8.0
31   -# spacepy does not like recent numpy versions (1.7 looks ok -- 1.8 works too)
32   -numpy==1.8.*
33   -# We only use pycdf from spacepy.
34   -# Ulterior versions are broken on install. (for python 2.7)
35   -spacepy==0.1.5
36   -
37   -# isoparse needs at least 2.7
38   -python-dateutil==2.7.*
39   -
40   -## SECOND LEVEL DEPS
41   -# (comment them out if you have compatibility issues)
42   -
43   -appdirs==1.4.3
44   -click==6.7
45   -dateutils==0.6.6
46   -itsdangerous==0.24
47   -mglob==0.4
48   -pyparsing==2.2.0
49   -packaging==16.8
50   -six==1.10.0
51   -Werkzeug==0.12
52   -Cython==0.27.1
53   -
54   -
55   -## WEIRD STUFF
56   -
57   -# This version number makes pip yell on the prod server (?)
58   -#pkg-resources==0.0.0
  10 +wheel
  11 +Flask==2.1.2
  12 +python-dotenv==0.20.0
  13 +requests==2.27.1
  14 +numpy==1.22.4
  15 +python-dateutil==2.8.2
  16 +Yaml8==0.1.2
  17 +netCDF4==1.5.8
  18 +unicode-slugify==0.1.5
  19 +gunicorn==20.1.0
... ...
resources-tests/amda-irap-omp-eu-ddservice-base-data-omni-hour-omni202107010-nc 0 โ†’ 100644
No preview for this file type
resources-tests/amda-irap-omp-eu-ddservice-base-data-tao-mars-dsc-sw-2022-nc 0 โ†’ 100644
No preview for this file type
res/apache.conf renamed to resources/apache.conf
res/crontab_example.txt renamed to resources/crontab_example.txt
res/distributed_readme.md renamed to resources/distributed_readme.md
res/dummy.nc renamed to resources/dummy.nc
No preview for this file type
res/dummy_jupiter_coordinates.nc renamed to resources/dummy_jupiter_coordinates.nc
No preview for this file type
res/dummy_jupiter_coordinates.txt renamed to resources/dummy_jupiter_coordinates.txt
res/heliopropa.nginx renamed to resources/heliopropa.nginx
res/heliopropa.service renamed to resources/heliopropa.service
resources/post-deploy.sh 0 โ†’ 100644
... ... @@ -0,0 +1,17 @@
  1 +#!/bin/sh
  2 +
  3 +# SCript to run after heliopropa source where updated.
  4 +#
  5 +# Should be execute within root directory of project
  6 +#
  7 +# May be run by the git post-receive hook
  8 +
  9 +
  10 +
  11 +source ./venv/bin/activate
  12 +pip install -r requirements.txt
  13 +
  14 +# may be more commands to run ...
  15 +# flask db upgrade
  16 +sudo systemctl restart heliopropa
  17 +sudo systemctl restart nginx
... ...
res/post-receive.git-hook renamed to resources/post-receive.git-hook
... ... @@ -55,7 +55,7 @@ do
55 55 git checkout ${BRANCH} # set branch if not done yet, sorry guy
56 56 git pull ${REPOSITORY} ${BRANCH} # get latest modifications, assumes remote origin previously set
57 57 exec git update-server-info
58   - ##/bin/sh scripts/post-deploy.sh
  58 + /bin/sh ./post-deploy.sh
59 59 # Alternately, it is possible to just update a git repo
60 60 echo "DONE -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+"
61 61 else
... ...