Skip to content

Commit

Permalink
#30: Removed shell script from geospaas_wind folder. It is now create…
Browse files Browse the repository at this point in the history
…d in the ansible openwind role.
  • Loading branch information
mortenwh committed Jul 5, 2019
1 parent f38fb99 commit 7d534c3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 16 deletions.
16 changes: 0 additions & 16 deletions geospaas_wind/daily_sync.sh

This file was deleted.

29 changes: 29 additions & 0 deletions provisioning/roles/openwind/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,35 @@
shell: "nohup /home/vagrant/run_jupyter.sh > /dev/null 2>&1 &"
when: jupyter_status.rc != 0

- name: openwind | Create shell script for daily data sync and wind processing
file:
path: /home/vagrant/daily_sync.sh
state: touch
mode: u=rwx,g=r,o=r

- name: openwind | Sync script heading
lineinfile:
path: /home/vagrant/daily_sync.sh
insertbefore: BOF
line: "#!/bin/bash"

- name: openwind | Sync script content
blockinfile:
path: /home/vagrant/daily_sync.sh
block: |
export PROJ_LIB={{ conda_dir }}/envs/{{ env_name }}/share/proj
source {{ conda_dir }}/bin/activate {{ env_name }}
cd {{ project_home }}/{{ project_name }}
# Sync S1A
{{ conda_dir }}/envs/{{ env_name }}/bin/python {{ project_home }}/{{ project_name }}/manage.py ingest_thredds_crawl http://nbstds.met.no/thredds/catalog/NBS/S1A/`date -d "yesterday 00:00" '+%Y/%m/%d'`/catalog.html
# Sync S1B
{{ conda_dir }}/envs/{{ env_name }}/bin/python {{ project_home }}/{{ project_name }}/manage.py ingest_thredds_crawl http://nbstds.met.no/thredds/catalog/NBS/S1B/`date -d "yesterday 00:00" '+%Y/%m/%d'`/catalog.html
# Sync Arome Arctic
{{ conda_dir }}/envs/{{ env_name }}/bin/python {{ project_home }}/{{ project_name }}/manage.py ingest_thredds_crawl https://thredds.met.no/thredds/catalog/aromearcticarchive/`date -d "yesterday 00:00" '+%Y/%m/%d'`/catalog.html --filename arome_arctic_vtk*
# Process S1 wind
{{ conda_dir }}/envs/{{ env_name }}/bin/python {{ project_home }}/{{ project_name }}/manage.py process_sentinel1_wind --date `date -d "yesterday 00:00" '+%Y-%m-%d'`
# shell: "source activate {{ env_name }}; nohup {{ conda_dir }}/envs/{{ env_name }}/bin/jupyter-notebook --ip=0.0.0.0 --no-browser --notebook-dir=/vagrant/notebooks/ --NotebookApp.token=vagrant > /dev/null 2>&1 &"

#- name: Nansat Setup Python | Check if numpy is imported
Expand Down

0 comments on commit 7d534c3

Please sign in to comment.