Blame tests/setup_zuul_web.yml

686543e
- name: Ensure zuul-web service is down
686543e
  service:
686543e
    name: zuul-web
686543e
    state: stopped
686543e
  become: true
686543e
686543e
- name: Install httpd
686543e
  package:
686543e
    name:
686543e
      - httpd
686543e
    state: present
686543e
  become: true
686543e
686543e
- name: Ensure httpd can connect to zuul-web
686543e
  command: setsebool -P httpd_can_network_connect on
686543e
  become: true
686543e
686543e
- name: Add the reverse proxy setting in httpd
686543e
  blockinfile:
686543e
    path: /etc/httpd/conf.d/zuul.conf
686543e
    block: |
686543e
      RewriteEngine on
686543e
      RewriteRule ^/api/tenant/(.*)/console-stream ws://localhost:9000/api/tenant/$1/console-stream [P]
686543e
      RewriteRule ^/(.*)$ http://localhost:9000/$1 [P]
686543e
  become: true
686543e
686543e
- name: Reload httpd
686543e
  service:
686543e
    name: httpd
686543e
    state: reloaded
686543e
  become: true
686543e
686543e
- name: Add the yarn yum repository
686543e
  shell: "curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo"
686543e
  become: true
686543e
686543e
- name: Install yarn
686543e
  package:
686543e
    name: yarn
686543e
    state: present
686543e
  become: true
686543e
686543e
- name: Start a production build of the Zuul web UI
686543e
  shell: "{{ item }}"
686543e
  args:
686543e
    chdir: /usr/share/zuul-ui/
686543e
  environment:
686543e
    REACT_APP_ZUUL_API: 'http://domain.com'
686543e
  loop:
686543e
    - yarn install
686543e
    - yarn build
686543e
  become: true
686543e
686543e
- name: Ensure zuul-web service is up
686543e
  service:
686543e
    name: zuul-web
686543e
    state: started
686543e
  become: true
686543e
686543e
- name: Give some time to services to fully start
686543e
  pause:
686543e
    seconds: 15
686543e
686543e
- name: Check zuul web services are up
686543e
  shell: systemctl is-active {{ item }}
686543e
  loop:
686543e
    - zuul-web
686543e
    - httpd
686543e
  become: true
686543e
686543e
- name: Check we can access the Zuul API
686543e
  shell: curl http://localhost:9000/api/tenants
686543e
  register: cmd
686543e
  failed_when: not "'default' in cmd.stdout"
686543e
686543e
- name: Check we can access the Zuul API via httpd
686543e
  shell: curl http://localhost/api/tenants
686543e
  register: cmd
686543e
  failed_when: not "'default' in cmd.stdout"