ansible/playbooks/build_tasmota_v2.yml
2024-12-29 22:45:43 +01:00

54 lines
2.0 KiB
YAML
Executable File

- hosts: nas
name: Build tasmota
ignore_unreachable: false
# vars:
# DOCKER_IMAGE: docker-tasmota
# FWS: tasmota
tasks:
- name: Fetch tasmota
ansible.builtin.shell:
cmd: 'git fetch https://github.com/arendst/Tasmota.git {{ BRANCH }}'
chdir: /share/docker_data/docker-tasmota/Tasmota
- name: Checkout tasmota branch
ansible.builtin.shell:
cmd: 'git checkout --force {{ BRANCH }}'
chdir: /share/docker_data/docker-tasmota/Tasmota
- name: Pull tasmota
ansible.builtin.shell:
cmd: 'git pull'
chdir: /share/docker_data/docker-tasmota/Tasmota
- name: Copy platformio_override
ansible.builtin.shell:
cmd: 'cp platformio_override.ini Tasmota/platformio_override.ini'
chdir: /share/docker_data/docker-tasmota/
- name: Copy user_config_override
ansible.builtin.shell:
cmd: 'cp user_config_override.h Tasmota/tasmota/user_config_override.h'
chdir: /share/docker_data/docker-tasmota/
- name: Build tasmota
ansible.builtin.shell:
cmd: '/share/ZFS530_DATA/.qpkg/container-station/bin/docker run --rm -v /share/docker_data/docker-tasmota/Tasmota:/tasmota -u $UID:$GID {{ DOCKER_IMAGE }} -e {{ FWS }}'
chdir: /share/docker_data/docker-tasmota/
when: FWS != "all"
- name: Build tasmota
ansible.builtin.shell:
cmd: '/share/ZFS530_DATA/.qpkg/container-station/bin/docker run --rm -v /share/docker_data/docker-tasmota/Tasmota:/tasmota -u $UID:$GID {{ DOCKER_IMAGE }}'
chdir: /share/docker_data/docker-tasmota/
when: FWS == "all"
- name: Create a directory if it does not exist
ansible.builtin.file:
path: /share/docker_data/webhub/fw/{{ BRANCH }}
state: directory
mode: '0755'
- name: Build tasmota
ansible.builtin.shell:
cmd: 'mv /share/docker_data/docker-tasmota/Tasmota/build_output/firmware/* /share/docker_data/webhub/fw/{{ BRANCH }}'