-
Notifications
You must be signed in to change notification settings - Fork 5
/
config_v2.jps
30 lines (26 loc) · 1.03 KB
/
config_v2.jps
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
type: update
name: Configs applying
globals:
TARGET_GROUP: ${settings.targetGroup}
TARGET_NODES: ${settings.targetNodes}
OPTIMIZATION: ${settings.optimization}
CONFIGS_PATH: https://github.com/jelastic/templates
onInstall:
- script: |
var targetGroup = '${globals.TARGET_GROUP}';
return {
result: 0,
nodeType: '${nodes.' + targetGroup + '.nodeType}',
tag: '${nodes.' + targetGroup + '.version}'
};
- set:
nodeType: ${response.nodeType}
tag: ${response.tag}
- cmd[${globals.TARGET_NODES}]: |-
rm -rf /tmp/templates;
wget '${globals.CONFIGS_PATH}/archive/master.zip' -O /tmp/master.zip;
unzip /tmp/master.zip templates-master/${this.nodeType}/default/${globals.OPTIMIZATION}/* -d /tmp/templates >> /var/log/run.log;
chown -R 700:700 /tmp/templates >> /var/log/run.log;
rsync -azP /tmp/templates/templates-master/${this.nodeType}/default/${globals.OPTIMIZATION}/* / >> /var/log/run.log 2>&1;
jem service restart;
user: root