diff options
Diffstat (limited to 'playbooks')
-rw-r--r-- | playbooks/dashboard/multi.yaml | 21 | ||||
-rw-r--r-- | playbooks/dashboard/run.yaml | 27 |
2 files changed, 14 insertions, 34 deletions
diff --git a/playbooks/dashboard/multi.yaml b/playbooks/dashboard/multi.yaml deleted file mode 100644 index 49f8602c6..000000000 --- a/playbooks/dashboard/multi.yaml +++ /dev/null @@ -1,21 +0,0 @@ -- hosts: all - tasks: - - - name: Make tenant subdir - file: - state: directory - dest: '{{ zuul.project.src_dir }}/{{ javascript_content_dir }}/t' - - - name: Copy the html/javascript content into subdirs - shell: | - CONTENT_DIR="{{ zuul.project.src_dir }}/{{ javascript_content_dir }}" - mkdir $CONTENT_DIR/t/{{ item }} - for f in $(find $CONTENT_DIR -type f -mindepth 1 -maxdepth 1) ; do - cp $f $CONTENT_DIR/t/{{ item }} - done - with_items: - - local - - ansible - - ansible-dev - - openstack.org - - rdoproject.org diff --git a/playbooks/dashboard/run.yaml b/playbooks/dashboard/run.yaml index 9b210a17c..056739db0 100644 --- a/playbooks/dashboard/run.yaml +++ b/playbooks/dashboard/run.yaml @@ -1,18 +1,19 @@ - hosts: all + pre_tasks: + - name: Update homepage for sub directory deployment + replace: + path: '{{ zuul.project.src_dir }}/web/package.json' + regexp: '"homepage": "/"' + replace: '"homepage": "./"' + # NOTE: using "./" is not enough to support html5 links, even with + # rewrite rules for unknown files, accessing 'job/devstack' will make + # the dashboard load static files from 'job/static/...' + # This works for the preview dashboard that can only be loaded from the + # npm/html directory anyway. roles: - revoke-sudo - set-zuul-log-path-fact - # Both sets of quotes are required. - # The "" quotes are for the shell to protect the '' quotes. - # We need the '' quotes because defines here are essentially - # direct string substitutions. Therefore: - # --define "ZUUL_API_URL='https://zuul.openstack.org'" - # with the javascript code: - # return ZUUL_API_URL - # results in - # return 'https://zuul.openstack.org' - # in the compiled javascript. - role: npm - npm_command: >- - build:dist -- - --define "ZUUL_API_URL='{{ zuul_api_url }}'" + npm_command: build + environment: + REACT_APP_ZUUL_API: "{{ zuul_api_url }}/api/" |