ci: format all YAML with `yq`
`yq` is the YAML query tool, used for manipulating YAML files. This
change uses the following command to read in and to pretty-print every
YAML file in this repository:
for x in $(find . -name '*.yaml'); do
yq -i -P -oy $x
done
This makes it a bit easier to automate synchronisation between staging
and upstream, as yq always pretty-prints the entire document when
manipulating files.
Signed-off-by: Chris Kay <chris.kay@arm.com>
Change-Id: If973766fa26500d5320612422d1b4999b23439d3
diff --git a/tf-a-cleanup-tfa-next.yaml b/tf-a-cleanup-tfa-next.yaml
index a840af4..f0db5ce 100644
--- a/tf-a-cleanup-tfa-next.yaml
+++ b/tf-a-cleanup-tfa-next.yaml
@@ -7,39 +7,39 @@
project-type: freestyle
sandbox: true
properties:
- - build-discarder:
- days-to-keep: 90
- num-to-keep: 15
+ - build-discarder:
+ days-to-keep: 90
+ num-to-keep: 15
triggers:
- - timed: "0 11 * * 5" # Triggered every Friday at 11 am (GMT)
+ - timed: 0 11 * * 5 # Triggered every Friday at 11 am (GMT)
builders:
- - shell: |
- #!/bin/bash
- set -ex
- if ! type aws
- then
- sudo apt-get -y -qq update
- sudo apt-get -y -qq install --no-install-recommends unzip
- curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
- unzip -q awscliv2.zip
- sudo ./aws/install
- fi
+ - shell: |
+ #!/bin/bash
+ set -ex
+ if ! type aws
+ then
+ sudo apt-get -y -qq update
+ sudo apt-get -y -qq install --no-install-recommends unzip
+ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
+ unzip -q awscliv2.zip
+ sudo ./aws/install
+ fi
- # All tfa-next related files should be under "artifacts" on the S3 bucket.
- ROOT=s3://${TUXPUB_S3_BUCKET}/
- for OBJECT in $(aws s3 ls $ROOT --recursive | grep artifacts | awk '{print $4}');
- do
- echo "Current object: ${ROOT}${OBJECT}"
- # Expected URL format: tf-a/next/artifacts/YYYY-MM-DD-HHMMSS/<bin_mode>/<file_name>
- # Take the YYYY-MM-DD information from the URL for each object
- dir_date=$(echo $OBJECT | sed 's+tf-a/next/artifacts/++' | sed 's+/.*++' | grep -E "(([0-9]+-){3,}[0-9]+)" | sed -E 's/-[0-9]+$//')
- if [ $dir_date ]; then
- # Calculate how old the file is (in days)
- diff_in_days=$(( ( $(date +%s) - $(date -d "$dir_date" +%s) ) / $((60*60*24)) ))
- # Remove the file if it's older than 3 days.
- if (( diff_in_days > 3 )); then
- echo "Removing object: ${ROOT}${OBJECT}"
- aws s3 rm ${ROOT}${OBJECT}
- fi
- fi
- done
+ # All tfa-next related files should be under "artifacts" on the S3 bucket.
+ ROOT=s3://${TUXPUB_S3_BUCKET}/
+ for OBJECT in $(aws s3 ls $ROOT --recursive | grep artifacts | awk '{print $4}');
+ do
+ echo "Current object: ${ROOT}${OBJECT}"
+ # Expected URL format: tf-a/next/artifacts/YYYY-MM-DD-HHMMSS/<bin_mode>/<file_name>
+ # Take the YYYY-MM-DD information from the URL for each object
+ dir_date=$(echo $OBJECT | sed 's+tf-a/next/artifacts/++' | sed 's+/.*++' | grep -E "(([0-9]+-){3,}[0-9]+)" | sed -E 's/-[0-9]+$//')
+ if [ $dir_date ]; then
+ # Calculate how old the file is (in days)
+ diff_in_days=$(( ( $(date +%s) - $(date -d "$dir_date" +%s) ) / $((60*60*24)) ))
+ # Remove the file if it's older than 3 days.
+ if (( diff_in_days > 3 )); then
+ echo "Removing object: ${ROOT}${OBJECT}"
+ aws s3 rm ${ROOT}${OBJECT}
+ fi
+ fi
+ done