forked from AliceO2Group/ControlWorkflows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
emc-qcmn-epn.sh
executable file
·28 lines (19 loc) · 1.02 KB
/
emc-qcmn-epn.sh
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
#!/usr/bin/env bash
# set -x;
set -e;
set -u;
source helpers.sh
QC_GEN_CONFIG_PATH='json://'`pwd`'/etc/emc-qcmn-epn.json'
QC_FINAL_CONFIG_PATH='consul-json://{{ consul_endpoint }}/o2/components/qc/ANY/any/emc-qcmn-epn'
QC_CONFIG_PARAM='qc_config_uri'
cd ..
WF_NAME=emc-qcmn-epn-remote
o2-qc --config $QC_GEN_CONFIG_PATH --remote -b --o2-control $WF_NAME
# add the templated QC config file path
ESCAPED_QC_FINAL_CONFIG_PATH=$(printf '%s\n' "$QC_FINAL_CONFIG_PATH" | sed -e 's/[\/&]/\\&/g')
sed -i /defaults:/\ a\\\ \\\ "${QC_CONFIG_PARAM}":\ \""${ESCAPED_QC_FINAL_CONFIG_PATH}"\" workflows/${WF_NAME}.yaml
# find and replace all usages of the QC config path which was used to generate the workflow
ESCAPED_QC_GEN_CONFIG_PATH=$(printf '%s\n' "$QC_GEN_CONFIG_PATH" | sed -e 's/[]\/$*.^[]/\\&/g');
sed -i "s/""${ESCAPED_QC_GEN_CONFIG_PATH}""/{{ ""${QC_CONFIG_PARAM}"" }}/g" workflows/${WF_NAME}.yaml tasks/${WF_NAME}-*
add_fmq_shmmonitor_role workflows/${WF_NAME}.yaml
add_qc_remote_machine_attribute workflows/${WF_NAME}.yaml alio2-cr1-qc02