83 lines
2.3 KiB
YAML
Executable File
83 lines
2.3 KiB
YAML
Executable File
---
|
|
- name: Require explicit backup acknowledgement before building a Discourse image
|
|
ansible.builtin.assert:
|
|
that:
|
|
- discourse_backup_confirmed | bool
|
|
fail_msg: >-
|
|
Verify the database and uploads backup before building or updating the
|
|
official image. Set discourse_backup_confirmed=true to proceed.
|
|
|
|
- name: Check local Docker Engine is available for official launcher builds
|
|
ansible.builtin.command:
|
|
argv:
|
|
- docker
|
|
- info
|
|
delegate_to: localhost
|
|
become: false
|
|
changed_when: false
|
|
|
|
- name: Check out official Discourse Docker build repository
|
|
ansible.builtin.git:
|
|
repo: "{{ discourse_build_repository }}"
|
|
dest: "{{ discourse_build_root }}"
|
|
version: "{{ discourse_build_version }}"
|
|
update: "{{ discourse_build_update_repository | bool }}"
|
|
force: false
|
|
delegate_to: localhost
|
|
become: false
|
|
|
|
- name: Ensure upstream launcher config directory exists
|
|
ansible.builtin.file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
mode: "0700"
|
|
loop:
|
|
- "{{ discourse_build_root }}/containers"
|
|
- "{{ discourse_build_root }}/shared/web-only"
|
|
- "{{ discourse_build_root }}/shared/web-only/log/var-log"
|
|
delegate_to: localhost
|
|
become: false
|
|
|
|
- name: Render official web-only launcher configuration
|
|
ansible.builtin.template:
|
|
src: app.yml.j2
|
|
dest: "{{ discourse_build_root }}/containers/app.yml"
|
|
mode: "0600"
|
|
delegate_to: localhost
|
|
become: false
|
|
no_log: true
|
|
|
|
- name: Build Discourse application image using the official launcher
|
|
ansible.builtin.command:
|
|
argv:
|
|
- "{{ discourse_build_root }}/launcher"
|
|
- bootstrap
|
|
- app
|
|
args:
|
|
chdir: "{{ discourse_build_root }}"
|
|
delegate_to: localhost
|
|
become: false
|
|
register: discourse_image_build
|
|
changed_when: true
|
|
|
|
- name: Tag official launcher-built image for the configured registry
|
|
ansible.builtin.command:
|
|
argv:
|
|
- docker
|
|
- tag
|
|
- local_discourse/app
|
|
- "{{ discourse_image }}"
|
|
delegate_to: localhost
|
|
become: false
|
|
changed_when: true
|
|
|
|
- name: Push the official launcher-built image
|
|
ansible.builtin.command:
|
|
argv:
|
|
- docker
|
|
- push
|
|
- "{{ discourse_image }}"
|
|
delegate_to: localhost
|
|
become: false
|
|
changed_when: true
|