File tree Expand file tree Collapse file tree 9 files changed +119
-2
lines changed Expand file tree Collapse file tree 9 files changed +119
-2
lines changed Original file line number Diff line number Diff line change 2
2
- hosts : runtime_host
3
3
vars_files :
4
4
- vars.yaml
5
+ - vault.yaml
5
6
tasks :
6
7
- name : Copy and unarchive the package into the indicators runtime host directory.
7
8
unarchive :
18
19
group : " {{ runtime_user }}"
19
20
state : link
20
21
22
+ - name : Check to see if we have a params file to send.
23
+ local_action : stat files/{{ indicator }}-params-prod.json
24
+ register : file
25
+
26
+ - name : Check to see if we have a params template to send.
27
+ local_action : stat templates/{{ indicator }}-params-prod.json.j2
28
+ register : template
29
+
21
30
- name : Set production params file.
22
31
copy :
23
32
src : files/{{ indicator }}-params-prod.json
24
33
dest : " {{ indicators_runtime_dir }}/{{ indicator }}/params.json"
25
34
owner : " {{ runtime_user }}"
26
35
group : " {{ runtime_user }}"
36
+ when : file.stat.exists
37
+
38
+ - name : Set production params template.
39
+ copy :
40
+ src : templates/{{ indicator }}-params-prod.json.j2
41
+ dest : " {{ indicators_runtime_dir }}/{{ indicator }}/params.json"
42
+ owner : " {{ runtime_user }}"
43
+ group : " {{ runtime_user }}"
44
+ when : template.stat.exists
Original file line number Diff line number Diff line change
1
+ {
2
+ "static_file_dir": "./static",
3
+ "export_dir": "./receiving",
4
+ "cache_dir": "./cache",
5
+ "start_date": "2020-02-01",
6
+ "end_date": "2020-05-15",
7
+ "ght_key": "{{ google_health_api_key }}"
8
+ }
Original file line number Diff line number Diff line change @@ -5,3 +5,6 @@ indicators_runtime_dir: "/home/{{ runtime_user }}/runtime"
5
5
package : " {{ indicator }}.tar.gz" # This is passed in the Ansible invocation.
6
6
python_version : " 3.8.2"
7
7
pyenv_python_path : " /home/{{ runtime_user }}/.pyenv/versions/{{ python_version }}/bin/python"
8
+
9
+ # Indicators variables.
10
+ google_health_api_key : " {{ vault_google_health_api_key }}"
Original file line number Diff line number Diff line change
1
+ $ANSIBLE_VAULT;1.1;AES256
2
+ 35386139306136373731386533393535343530623035366532343334326430313839336334646363
3
+ 6630646235616664386630623565363262643965376563660a386639663436616635323630356430
4
+ 35613139666439363161613232346463366637623238623963623364366166356131346363656432
5
+ 3831636539306230660a656430623166663262316230333137613633333337623338393837643331
6
+ 34306335636231366135383163336435613130396265333434623361376531396138353163653265
7
+ 33363963363032326164323161323036326436616333303738373866623335623664316565653461
8
+ 63646536633161623937363062663031353734303539343332633365326333353537316336383461
9
+ 64353265303234346633
Original file line number Diff line number Diff line change 2
2
"static_file_dir": "./static",
3
3
"export_dir": "./receiving",
4
4
"cache_dir": "./cache",
5
- "start_date": "2020-02-01 ",
6
- "end_date": "2020-05-15 ",
5
+ "start_date": "2020-01-05 ",
6
+ "end_date": "",
7
7
"ght_key": ""
8
8
}
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ #
3
+ # JHU: Jenkins build
4
+ #
5
+
6
+ set -exo pipefail
7
+ source ~ /.bash_profile
8
+
9
+ #
10
+ # Build
11
+ #
12
+
13
+ local_indicator=" google_health"
14
+
15
+ cd " ${WORKSPACE} /${local_indicator} " || exit
16
+
17
+ # Set up venv
18
+ python -m venv env
19
+ source env/bin/activate
20
+ pip install ../_delphi_utils_python/.
21
+ pip install .
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ #
3
+ # Jenkins deploy
4
+ #
5
+
6
+ set -exo pipefail
7
+ source ~ /.bash_profile
8
+
9
+ #
10
+ # Deploy
11
+ #
12
+
13
+ local_indicator=" google_health"
14
+
15
+ cd " ${WORKSPACE} /ansible" || exit
16
+
17
+ # Ansible!
18
+ ansible-playbook ansible-deploy.yaml --extra-vars " indicator=${local_indicator} " -i inventory
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ #
3
+ # Jenkins package
4
+ #
5
+
6
+ set -exo pipefail
7
+ source ~ /.bash_profile
8
+
9
+ #
10
+ # Package
11
+ #
12
+
13
+ local_indicator=" google_health"
14
+
15
+ cd " ${WORKSPACE} " || exit
16
+
17
+ # Create .tar.gz for deployment
18
+ tar -czvf " ${JENKINS_HOME} /artifacts/${local_indicator} .tar.gz" " ${local_indicator} "
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ #
3
+ # JHU: Jenkins test
4
+ #
5
+
6
+ set -exo pipefail
7
+ source ~ /.bash_profile
8
+
9
+ #
10
+ # Test
11
+ #
12
+
13
+ local_indicator=" google_health"
14
+
15
+ cd " ${WORKSPACE} /${local_indicator} " || exit
16
+
17
+ # Linter
18
+ env/bin/pylint delphi_" ${local_indicator} "
19
+
20
+ # Unit tests and code coverage
21
+ cd tests || exit && \
22
+ ../env/bin/pytest --cov=delphi_" ${local_indicator} " --cov-report=term-missing
You can’t perform that action at this time.
0 commit comments