Skip to content

Commit

Permalink
[WFX-455] Update AUS logic, so latest version receives no update and …
Browse files Browse the repository at this point in the history
…previous versions receive latest update.
  • Loading branch information
MrAlex94 committed Sep 16, 2022
1 parent 864a210 commit 9f6fa53
Showing 1 changed file with 54 additions and 18 deletions.
72 changes: 54 additions & 18 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,34 @@ jobs:
fi
- name: "\U0001F9EA Dry run AUS"
run: |
os=(WINNT_x86_64 Linux_x86_64 Darwin_x86_64-aarch64)
for j in ${os[@]}
OSA=(WINNT_x86_64 Linux_x86_64 Darwin_x86_64-aarch64)
for OS in "${OSA[@]}"
do
update_loc=":s3:aus/update/staging/${{ env.CHANNEL }}/${{ inputs.DISPLAY_VERSION }}/"$j"/update.xml"
mkdir -p aus_tmp/$j/
rclone copyto :s3:aus/update/staging/${{ env.CHANNEL }}/${{ inputs.DISPLAY_VERSION }}/"$j"/update.xml ./aus_tmp/$j/update.xml
sed -i 's/staging/releases/g' ./aus_tmp/$j/update.xml
sed -i 's/staging/releases/g' ./aus_tmp/$j/update.xml
sed -i 's/staging/releases/g' ./aus_tmp/$j/update.xml
rclone moveto ./aus_tmp/$j/update.xml :s3:aus/update/production/${{ env.CHANNEL }}/${{ inputs.DISPLAY_VERSION }}/"$j"/update.xml --dry-run
mkdir -p aus_tmp/"$OS"/
rclone copyto :s3:aus/update/staging/${{ env.CHANNEL }}/${{ inputs.DISPLAY_VERSION }}/"$OS"/update.xml ./aus_tmp/"$OS"/update.xml
sed -i 's/staging/releases/g' ./aus_tmp/"$OS"/update.xml
done
for VER in $(rclone lsf --dirs-only :s3:aus/update/production/${{ env.CHANNEL }} | awk -v RS= '{$1=$1}1' | sed 's|/||g')
do
if [[ $VER != '/' ]]
then
if [[ $VER == "G5"* ]]
then
for OS in "${OSA[@]}"
do
rclone moveto ./aus_tmp/"$OS"/update.xml :s3:aus/update/production/${{ env.CHANNEL }}/"$VER"/"$OS"/update.xml --log-level DEBUG --dry-run
done
fi
fi
done
for OS in "${OSA[@]}"
do
cat <<END >update.xml
<?xml version="1.0"?>
<updates>
</updates>
END
rclone moveto ./update.xml :s3:aus/update/production/${{ env.CHANNEL }}/${{ inputs.DISPLAY_VERSION }}/"$OS"/update.xml --log-level DEBUG --dry-run
done
- name: "\U0001F9EA Move installers from staging to production"
run: >
Expand Down Expand Up @@ -138,16 +156,34 @@ jobs:
fi
- name: "\U0001F69A Move update XMLs from staging"
run: |
os=(WINNT_x86_64 Linux_x86_64 Darwin_x86_64-aarch64)
for j in ${os[@]}
OSA=(WINNT_x86_64 Linux_x86_64 Darwin_x86_64-aarch64)
for OS in "${OSA[@]}"
do
mkdir -p aus_tmp/"$OS"/
rclone copyto :s3:aus/update/staging/${{ env.CHANNEL }}/${{ inputs.DISPLAY_VERSION }}/"$OS"/update.xml ./aus_tmp/"$OS"/update.xml
sed -i 's/staging/releases/g' ./aus_tmp/"$OS"/update.xml
done
for VER in $(rclone lsf --dirs-only :s3:aus/update/production/${{ env.CHANNEL }} | awk -v RS= '{$1=$1}1' | sed 's|/||g')
do
if [[ $VER != '/' ]]
then
if [[ $VER == "G5"* ]]
then
for OS in "${OSA[@]}"
do
rclone moveto ./aus_tmp/"$OS"/update.xml :s3:aus/update/production/${{ env.CHANNEL }}/"$VER"/"$OS"/update.xml
done
fi
fi
done
for OS in "${OSA[@]}"
do
update_loc=":s3:aus/update/staging/${{ env.CHANNEL }}/${{ inputs.DISPLAY_VERSION }}/"$j"/update.xml"
mkdir -p aus_tmp/$j/
rclone moveto :s3:aus/update/staging/${{ env.CHANNEL }}/${{ inputs.DISPLAY_VERSION }}/"$j"/update.xml ./aus_tmp/$j/update.xml
sed -i 's/staging/releases/g' ./aus_tmp/$j/update.xml
sed -i 's/staging/releases/g' ./aus_tmp/$j/update.xml
sed -i 's/staging/releases/g' ./aus_tmp/$j/update.xml
rclone moveto ./aus_tmp/$j/update.xml :s3:aus/update/production/${{ env.CHANNEL }}/${{ inputs.DISPLAY_VERSION }}/"$j"/update.xml
cat <<END >update.xml
<?xml version="1.0"?>
<updates>
</updates>
END
rclone moveto ./update.xml :s3:aus/update/production/${{ env.CHANNEL }}/${{ inputs.DISPLAY_VERSION }}/"$OS"/update.xml
done
- name: "\U0001F69A Move MARs from staging"
run: >
Expand Down

0 comments on commit 9f6fa53

Please sign in to comment.