2021-06-16 08:49:25 +00:00
|
|
|
---
|
|
|
|
- name: Schedule and start node builds
|
|
|
|
win_scheduled_task:
|
|
|
|
description: 'Daily rebuild of Nimbus beacon node binaries'
|
|
|
|
name: '{{ beacon_node_service_name }}-build'
|
2021-06-16 13:30:04 +00:00
|
|
|
username: SYSTEM
|
2021-06-16 08:49:25 +00:00
|
|
|
actions:
|
|
|
|
- path: 'C:/ProgramData/scoop/apps/git/current/bin/bash.exe'
|
2021-06-16 13:30:04 +00:00
|
|
|
arguments: '-c "{{ beacon_node_build_script }} > ./build.log 2>&1'
|
|
|
|
working_directory: '{{ beacon_node_service_path }}'
|
2021-06-16 08:49:25 +00:00
|
|
|
triggers:
|
|
|
|
- type: 'daily'
|
|
|
|
start_boundary: '2021-01-01T01:00:00'
|
|
|
|
state: 'present'
|
|
|
|
enabled: true
|
|
|
|
multiple_instances: 2 # Wait for running task
|
2021-06-17 11:20:52 +00:00
|
|
|
start_when_available: true
|
2021-06-16 08:49:25 +00:00
|
|
|
disallow_start_if_on_batteries: false
|
|
|
|
stop_if_going_on_batteries: false
|
|
|
|
|
2021-06-17 11:20:52 +00:00
|
|
|
- name: Check if binary exists
|
|
|
|
win_stat:
|
|
|
|
path: '{{ beacon_node_service_exe }}'
|
|
|
|
register: beacon_node_exe
|
|
|
|
|
|
|
|
# Start it right away so we have the binary to run.
|
|
|
|
- name: Start the new scheduled task
|
|
|
|
win_shell: 'Start-ScheduledTask -TaskName {{ beacon_node_service_name }}-build'
|
|
|
|
when: not beacon_node_exe.stat.exists
|
|
|
|
|
2021-06-16 13:39:24 +00:00
|
|
|
- name: Wait for the node build to finish (SLOW)
|
2021-06-16 08:49:25 +00:00
|
|
|
win_scheduled_task_stat:
|
|
|
|
name: '{{ beacon_node_service_name }}-build'
|
2021-06-17 11:20:52 +00:00
|
|
|
when: not beacon_node_exe.stat.exists
|
2021-06-16 13:39:24 +00:00
|
|
|
register: task_stat
|
|
|
|
until: |
|
2021-06-17 11:20:52 +00:00
|
|
|
task_stat.state is defined and
|
|
|
|
task_stat.state.status != "TASK_STATE_RUNNING"
|
|
|
|
retries: 50
|
2021-06-16 13:39:24 +00:00
|
|
|
delay: 30
|