File tree Expand file tree Collapse file tree 5 files changed +46
-1
lines changed Expand file tree Collapse file tree 5 files changed +46
-1
lines changed Original file line number Diff line number Diff line change
1
+ Create ` workflow/share/cycle/<cycle> ` and make it available to jobs as ` $CYLC_TASK_SHARE_CYCLE_DIR ` .
Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ cylc__job__main() {
95
95
CYLC_TASK_WORK_DIR_BASE=" ${CYLC_TASK_CYCLE_POINT} /${CYLC_TASK_NAME} "
96
96
fi
97
97
export CYLC_TASK_WORK_DIR=" ${CYLC_WORKFLOW_WORK_DIR} /${CYLC_TASK_WORK_DIR_BASE} "
98
+ export CYLC_TASK_SHARE_CYCLE_DIR=" ${CYLC_WORKFLOW_SHARE_DIR} /cycle/${CYLC_TASK_CYCLE_POINT} "
98
99
typeset contact=" ${CYLC_WORKFLOW_RUN_DIR} /.service/contact"
99
100
if [[ -f " ${contact} " ]]; then
100
101
# (contact file not present for polled platforms)
@@ -134,7 +135,7 @@ cylc__job__main() {
134
135
export PATH=" ${CYLC_WORKFLOW_RUN_DIR} /share/bin:${CYLC_WORKFLOW_RUN_DIR} /bin:${PATH} "
135
136
export PYTHONPATH=" ${CYLC_WORKFLOW_RUN_DIR} /share/lib/python:${CYLC_WORKFLOW_RUN_DIR} /lib/python:${PYTHONPATH:- } "
136
137
# Create share and work directories
137
- mkdir -p " ${CYLC_WORKFLOW_SHARE_DIR } " || true
138
+ mkdir -p " ${CYLC_TASK_SHARE_CYCLE_DIR } " || true
138
139
mkdir -p " $( dirname " ${CYLC_TASK_WORK_DIR} " ) " || true
139
140
mkdir -p " ${CYLC_TASK_WORK_DIR} "
140
141
cd " ${CYLC_TASK_WORK_DIR} "
Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ ${TEST_DIR}/${SYM_NAME}/cycle/cylc-run/${CYLC_TEST_REG_BASE}
81
81
| \` -- ${TEST_NAME_BASE}
82
82
| \` -- share
83
83
| \` -- cycle
84
+ | \` -- 1
84
85
\` -- leave-me-alone
85
86
${TEST_DIR} /${SYM_NAME} /job/cylc-run/${CYLC_TEST_REG_BASE}
86
87
\` -- ${FUNCTIONAL_DIR}
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ # THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
3
+ # Copyright (C) NIWA & British Crown (Met Office) & Contributors.
4
+ #
5
+ # This program is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # This program is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+
18
+ # Assert that workflow/share/cycle/<cycle> is created and exported.
19
+
20
+ . " $( dirname " $0 " ) /test_header"
21
+ set_test_number 4
22
+
23
+ # Setup:
24
+ install_workflow " ${TEST_NAME_BASE} " " ${TEST_NAME_BASE} "
25
+ run_ok " ${TEST_NAME_BASE} .validate" cylc validate " ${WORKFLOW_NAME} "
26
+ workflow_run_ok " ${TEST_NAME_BASE} .play" cylc play --no-detach " ${WORKFLOW_NAME} "
27
+
28
+ grep_ok " Hello World" " ${WORKFLOW_RUN_DIR} /share/cycle/19900211T0000Z/stuff"
29
+ grep_ok " Hello World" " ${WORKFLOW_RUN_DIR} /share/cycle/19900212T0000Z/stuff"
30
+
31
+ purge
Original file line number Diff line number Diff line change
1
+ [scheduling ]
2
+ initial cycle point = 19900211
3
+ final cycle point = 19900212
4
+ [[graph ]]
5
+ P1D = task
6
+
7
+ [runtime ]
8
+ [[task ]]
9
+ script = """
10
+ echo "Hello World" > "${CYLC_TASK_SHARE_CYCLE_DIR}/stuff"
11
+ """
You can’t perform that action at this time.
0 commit comments