From 2bb476206b62ea0cdcfddc2180e3dd912486f8d8 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Tue, 23 Jan 2024 14:05:31 -0800 Subject: [PATCH] Re-add website publication I deleted this, thinking it was vestigal. It's not. This is where it actually lives. netlfy isn't doing things because of how they do DNS for root domains. Whoops. Change-Id: Iad5d2212b6c2bfb3b1f375de2cc88609e91405ba --- .zuul.yaml | 10 ++++++++++ playbooks/publish.yaml | 29 +++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 playbooks/publish.yaml diff --git a/.zuul.yaml b/.zuul.yaml index 3657051..b2d9c45 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -77,6 +77,15 @@ js_build_command: build javascript_content_dir: out +- job: + name: inaugust-publish-website + parent: build-javascript-deployment + vars: + node_version: 18 + js_build_command: build + javascript_content_dir: out + post-run: playbooks/publish.yaml + - job: name: inaugust-publish-netlify parent: inaugust-publish-javascript-to-netlify @@ -96,4 +105,5 @@ - inaugust-build-website post: jobs: + - inaugust-publish-website - inaugust-publish-netlify diff --git a/playbooks/publish.yaml b/playbooks/publish.yaml new file mode 100644 index 0000000..4a2505a --- /dev/null +++ b/playbooks/publish.yaml @@ -0,0 +1,29 @@ +- hosts: all + tasks: + + - name: Pull contents back + synchronize: + mode: pull + src: "/home/zuul/src/opendev.org/inaugust/inaugust.com/dist/" + dest: "{{ zuul.executor.work_root }}/dist/" + +- hosts: localhost + tasks: + - name: Add ns1.inaugust.com to inventory + add_host: + name: ns1.inaugust.com + ansible_python_interpreter: python3 + ansible_user: mordred + + - name: Add ns1 hostkey to known hosts + known_hosts: + name: ns1.inaugust.com + key: "ns1.inaugust.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDvCg98cFYN7zqdF7742dlnme9lp7QGCemMlF68NLVpuDt7FxqH7blel2ju3upnz1LZHPU9nPuI/+ByYQ+7/1ezGS+N5CQIfWkvhFnBRlwNqIEP/Lfyw3LhFm72QRwDuKxkV5kKzZHXhNlg0I2PgLwDliijSX/0WW9Vgkb2zv/tLXbEM6LBSCXwAPjlfc6LVwmkY3vSxulU6kyL7Izyi83lD533g7jKP8KkOjuFEled8biKV2sP1hIc0tWWlL47G0jRdyB6LVmxOlb0arULfhqEWdW7qldIj2bPmUd2cAG522OoPYZQdDgGYPQlyS0ZJgWvjYoatUAyq8B7ELeJwqN62rcwn8yX3o+bykDX50HCKlrfHHsisST+YcOTtDG8X4H5UlGtMUygmpFEJjUOOoHD6dwmT1R92V5a3Sov1W2Fc7TcfmFoXo1G3N0/wsruVfmzJ7Q/WNtBf4p+c9DXTfJcNKfOIs6o/7ZrzexctEZQRFa7cxBEv2n+fVDN3DcQ12k=" + +- hosts: ns1.inaugust.com + tasks: + + - name: Publish the contents + synchronize: + src: "{{ zuul.executor.work_root }}/dist/" + dest: "/var/www/inaugust.com/"