-
Notifications
You must be signed in to change notification settings - Fork 67
/
nightly_catalog_rebuild.xml
131 lines (115 loc) · 5.1 KB
/
nightly_catalog_rebuild.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<joblist>
<job>
<context>
<options preserveOrder='true'>
<option enforcedvalues='true' name='catalog' required='true' value='partner' values='inventory,partner,shipping-rates'>
<description>catalog name</description>
</option>
</options>
</context>
<description><![CDATA[rebuild the catalog data -- shows a fancy runbook, and file processing
---
Your job description can be your Job's runbook.
Any text after the `---` on the thirdline is formated using [markdeep](https://casual-effects.com/markdeep).
Write a Runbook for your job to explain important things to your users.
Your Runbook can state the business purpose for your job,
who its stakeholders are, and what to do when things go wrong.
Sometimes it is good to illustrate the Job's process flow.
*************************************************************************************************
* . *
* .---------. / \ *
* | START | / \ .-+-------+-. ___________ *
* '----+----' .-------. A / \ B | |COMPLEX| | / \ .-. *
* | | END |<-----+CHOICE +----->| | | +--->+ PREPARATION +--->| X | *
* v '-------' \ / | |PROCESS| | \___________/ '-' *
* .---------. \ / '-+---+---+-' *
* / INPUT / \ / *
* '-----+---' ' *
* | ^ *
* v | *
* .-----------. .-----+-----. .-. *
* | PROCESS +---------------->| PROCESS |<------+ X | *
* '-----------' '-----------' '-' *
*************************************************************************************************
Buidling on markdown syntax, [use markdeep for more advanced formatting features](https://casual-effects.com/markdeep/features.md.html).
For instance, I like how markdeep lets you create a table:
Maine | Iowa | Colorado
-------|------|----------
1 | 4 | 10
ME | IA | CO
Blue | Red | Brown
[Escalation chart]
Use your imagination. Keep your users informed!
Your documentation will shine my friend!
]]></description>
<dispatch>
<excludePrecedence>true</excludePrecedence>
<keepgoing>true</keepgoing>
<rankOrder>ascending</rankOrder>
<threadcount>1</threadcount>
</dispatch>
<executionEnabled>true</executionEnabled>
<group>catalog</group>
<loglevel>INFO</loglevel>
<name>Nightly-Rebuild</name>
<nodeFilterEditable>true</nodeFilterEditable>
<nodefilters>
<filter>tags: db</filter>
</nodefilters>
<nodesSelectedByDefault>true</nodesSelectedByDefault>
<notification>
<onfailure>
<email recipients='bizops@anvils.com' />
</onfailure>
<onsuccess>
<email recipients='bizops@anvils.com' />
</onsuccess>
</notification>
<schedule>
<month month='*' />
<time hour='00' minute='00' seconds='0' />
<weekday day='*' />
<year year='*' />
</schedule>
<scheduleEnabled>true</scheduleEnabled>
<sequence keepgoing='false' strategy='node-first'>
<command>
<description>initialize-data</description>
<node-step-plugin type='copyfile'>
<configuration>
<entry key='destinationPath' value='${node.anvils:catalog.categories.files}/${option.catalog}.data' />
<entry key='echo' value='true' />
<entry key='sourcePath' value='${globals.catalog.categories.files}/${option.catalog}.data' />
</configuration>
</node-step-plugin>
</command>
<command>
<description>generate-data</description>
<script><![CDATA[#!/bin/bash
set -eu
CATALOG=$1
DATAFILE=$2
echo "Rebuilding catalog: $CATALOG ..."
cat >${DATAFILE} <<EOF
- catalog: $CATALOG
- customer: ${RD_NODE_ANVILS_CUSTOMER}"
- location: ${RD_NODE_ANVILS_LOCATION}"
- database: ${RD_NODE_NAME:-}"
EOF
cat $DATAFILE
exit $?]]></script>
<scriptargs>${option.catalog} ${node.anvils:catalog.categories.files}/${option.catalog}.data</scriptargs>
</command>
<command>
<description>data-exists?</description>
<node-step-plugin type='nixy-waitfor-file-exists'>
<configuration>
<entry key='file' value='${node.anvils:catalog.categories.files}/${option.catalog}.data' />
<entry key='interval' value='5' />
<entry key='maxtry' value='3' />
</configuration>
</node-step-plugin>
</command>
</sequence>
</job>
</joblist>