SOFA/.github/buildactionScripts.sh

20 lines
702 B
Bash
Raw Normal View History

2020-12-08 11:24:54 -06:00
#!/bin/bash
SCAN_SOFA_HD_KEY="FPGA1212_SOFA_HD_PNR"
SCAN_QLSOFA_HD_KEY="FPGA1212_QLSOFA_HD_PNR"
2020-12-08 11:24:54 -06:00
SCAN_SOFA_CHD_KEY="FPGA1212_SOFA_CHD_PNR"
SCAN_QLAP3_KEY="FPGA1212_QLAP3_PNR"
# TODO: Strip comments while reading using yq
2020-12-08 12:31:04 -06:00
# TODO: Add SOFA_CHD and QLAP3 for later
for repo in SOFA_HD ; do
2020-12-08 11:24:54 -06:00
ScanDir=$(eval "echo \$SCAN_${repo}_KEY")
action_filename=$(echo "$repo" | awk '{print tolower($0)}')
2020-12-08 12:31:04 -06:00
repo_name=$(echo "$repo" | sed "s/_/-/")
echo $ScanDir $action_filename $repo_name
2020-12-08 11:24:54 -06:00
cat deploy_sofa.yaml | \
sed -e "s/SOFA_HD/${repo}/" \
2020-12-08 12:31:04 -06:00
-e "s/SOFA-HD/${repo_name}/" \
2020-12-08 11:24:54 -06:00
-e "s/FPGA1212_FLAT_HD_SKY_PNR/${ScanDir}/" | \
yq r - -X > ./workflows/deploy_${action_filename}.yaml
done