airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [airavata] 02/07: Create temp directory for local django portal clone/build
Date Wed, 16 Oct 2019 19:44:41 GMT
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch staging
in repository https://gitbox.apache.org/repos/asf/airavata.git

commit 502acac7dd0ddeb2a7e1e47840d25271322b66b0
Author: Marcus Christie <machristie@apache.org>
AuthorDate: Wed Aug 7 09:27:14 2019 -0400

    Create temp directory for local django portal clone/build
---
 dev-tools/ansible/roles/django/tasks/main.yml | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/dev-tools/ansible/roles/django/tasks/main.yml b/dev-tools/ansible/roles/django/tasks/main.yml
index 2be4aa0..11e1f5d 100644
--- a/dev-tools/ansible/roles/django/tasks/main.yml
+++ b/dev-tools/ansible/roles/django/tasks/main.yml
@@ -31,12 +31,22 @@
   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
@@ -47,8 +57,8 @@
 - 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
@@ -61,14 +71,13 @@
     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"


Mime
View raw message