-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdateConfigLastUpdated.sh
More file actions
executable file
·35 lines (35 loc) · 1.88 KB
/
updateConfigLastUpdated.sh
File metadata and controls
executable file
·35 lines (35 loc) · 1.88 KB
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
#! /bin/bash
cp remoteconfig.template.json config.json
echo "updating last updated config params"
jq -c '.[]' modified_files.json | while read i; do
if [[ $i = \"act.json\" ]]
then
echo "updating act"
jq '.parameterGroups.lastUpdated.parameters.actResourcesLastUpdated.defaultValue.value = $timestamp' --arg timestamp $(date +%s) config.json > tmp.json && mv tmp.json config.json
elif [[ $i = \"shop.json\" ]]
then
echo "updating shop"
jq '.parameterGroups.lastUpdated.parameters.shopResourcesLastUpdated.defaultValue.value = $timestamp' --arg timestamp $(date +%s) config.json > tmp.json && mv tmp.json config.json
elif [[ $i = \"educate.json\" ]]
then
echo "updating educate"
jq '.parameterGroups.lastUpdated.parameters.educateResourcesLastUpdated.defaultValue.value = $timestamp' --arg timestamp $(date +%s) config.json > tmp.json && mv tmp.json config.json
elif [[ $i = \"learn.json\" ]]
then
echo "updating learn"
jq '.parameterGroups.lastUpdated.parameters.learnResourcesLastUpdated.defaultValue.value = $timestamp' --arg timestamp $(date +%s) config.json > tmp.json && mv tmp.json config.json
elif [[ $i = \"advocate.json\" ]]
then
echo "updating advocate"
jq '.parameterGroups.lastUpdated.parameters.advocateResourcesLastUpdated.defaultValue.value = $timestamp' --arg timestamp $(date +%s) config.json > tmp.json && mv tmp.json config.json
elif [[ $i = \"today.json\" ]]
then
echo "updating today"
jq '.parameterGroups.lastUpdated.parameters.todayResourcesLastUpdated.defaultValue.value = $timestamp' --arg timestamp $(date +%s) config.json > tmp.json && mv tmp.json config.json
elif [[ $i = \"states/*.json\" ]]
then
echo "updating local"
jq '.parameterGroups.lastUpdated.parameters.localResourcesLastUpdated.defaultValue.value = $timestamp' --arg timestamp $(date +%s) config.json > tmp.json && mv tmp.json config.json
fi
done
mv config.json remoteconfig.template.json