#!jinja2
[cylc]
    UTC mode=True
    cycle point format = %Y
    [[events]]
        abort on stalled = True
        abort on inactivity = True
        inactivity = P1M
[scheduling]
    initial cycle point = 2016
    final cycle point = 2020
    [[dependencies]]
        [[[P1Y]]]
            graph=t1[-P1Y] => t1
[runtime]
    [[t1]]
        script = """
if [[ "${CYLC_TASK_CYCLE_POINT}" == '2017' ]]; then
    cylc broadcast "${CYLC_SUITE_NAME}" -p '2017' -n 't1' --set='script=true'
    cylc hold "${CYLC_SUITE_NAME}"
    sleep 1
    (cd "${CYLC_SUITE_DEF_PATH}"; cp -p 'suite2.rc' 'suite.rc')
    cylc reload "${CYLC_SUITE_NAME}"
    while ! grep -q 'Reload completed' ${CYLC_SUITE_LOG_DIR}/log; do
        sleep 1  # make sure reload completes
    done
    cylc insert "${CYLC_SUITE_NAME}" 't2.2017'
    sleep 1
    cylc release "${CYLC_SUITE_NAME}"
fi
"""
        [[[job]]]
            execution time limit = PT15S
