From 3dba813c643ec8f4b3323c2a09c6aecf8ad4d338 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Sat, 29 Sep 2018 11:50:22 -0700 Subject: Revert "web: rewrite interface in react" Revert "Fix publish-openstack-javascript-content" This reverts commit ca199eb9dbb64e25490ee5803e4f18c91f34681d. This reverts commit 1082faae958bffa719ab333c3f5ae9776a8b26d7. This appears to remove the tarball publishing system that we rely on. Change-Id: Id746fb826dfc01b157c5b772adc1d2991ddcd93a --- playbooks/dashboard/multi.yaml | 21 +++++++++++++++++++++ playbooks/dashboard/run.yaml | 27 +++++++++++++-------------- 2 files changed, 34 insertions(+), 14 deletions(-) create mode 100644 playbooks/dashboard/multi.yaml (limited to 'playbooks') diff --git a/playbooks/dashboard/multi.yaml b/playbooks/dashboard/multi.yaml new file mode 100644 index 000000000..49f8602c6 --- /dev/null +++ b/playbooks/dashboard/multi.yaml @@ -0,0 +1,21 @@ +- 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 056739db0..9b210a17c 100644 --- a/playbooks/dashboard/run.yaml +++ b/playbooks/dashboard/run.yaml @@ -1,19 +1,18 @@ - 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 - environment: - REACT_APP_ZUUL_API: "{{ zuul_api_url }}/api/" + npm_command: >- + build:dist -- + --define "ZUUL_API_URL='{{ zuul_api_url }}'" -- cgit v1.2.1