Create temp directory for local django portal clone/build
file: path="{{ doc_root_dir }}" state=directory owner="{{user}}" group="{{group}}"
become: yes
+- name: Create local temp directory for django portal clone and build
+ local_action:
+ module: tempfile
+ # The temp directory must be in a location that allows it to be mounted
+ # into the Docker container. On macOS the default behavior creates temp
+ # directories in /var but /var isn't available to Docker containers.
+ path: /tmp
+ state: directory
+ register: airavata_django_portal_tempdir
+ run_once: true
+
- name: git clone django repo
local_action:
module: git
repo: "{{ airavata_django_repo }}"
- # TODO: create new temp directory
- dest: "/tmp/airavata-django-portal"
+ dest: "{{ airavata_django_portal_tempdir.path }}"
# TODO: change to {{ airavata_django_git_branch }}
version: "local-builds"
update: yes
- name: build Docker image for building the JS
local_action:
module: docker_image
- # TODO: use temp directory
- path: "/tmp/airavata-django-portal/scripts/docker-build/"
+ path: "{{ airavata_django_portal_tempdir.path }}/scripts/docker-build/"
+ # TODO: rename to airavata-django-build
name: av-django-build
force: true
# source: build
image: av-django-build
cleanup: true
detach: false
- # TODO: use temp directory
volumes:
- - /tmp/airavata-django-portal:/code
+ - "{{ airavata_django_portal_tempdir.path }}:/code"
run_once: true
- name: rsync build Django code to {{ airavata_django_checkout }}
synchronize:
- src: /tmp/airavata-django-portal/
+ src: "{{ airavata_django_portal_tempdir.path }}/"
dest: "{{ airavata_django_checkout }}"
rsync_opts:
- "--exclude=node_modules"
