fix array

This commit is contained in:
Marco Carrozzo
2023-01-20 12:29:20 +01:00
parent e4b24c479e
commit 203f1876ab
2 changed files with 10 additions and 4 deletions
@@ -6,10 +6,12 @@ inputs:
description: 'packages to cache'
required: false
type: string
default: 'dist nxcache'
persistent-packages:
description: 'cache key'
required: false
type: string
default: 'nxcache'
cache-key-suffix:
description: 'cache key suffix'
required: false
@@ -23,7 +25,8 @@ runs:
env:
REMOTE_PATH: "adf/build-cache/${{ github.run_id }}"
run: |
for i in ( '${{ inputs.packages }}' ); do
packages=( $(echo ${{ inputs.packages }}) )
for i in "${packages[@]}"; do
echo "downloading current run cache artifacts from ${REMOTE_PATH}/$i.tar.gz"
time aws s3 cp --no-progress s3://${S3_BUILD_BUCKET_SHORT_NAME}/${REMOTE_PATH}/$i.tar.gz $i.tar.gz
du -h $i.tar.gz
@@ -37,7 +40,8 @@ runs:
if [ -n "${{ inputs.cache-key-suffix }}" ]; then
REMOTE_PATH="${REMOTE_PATH}-${{ inputs.cache-key-suffix }}"
fi
for i in ( '${{ inputs.persistent-packages }}' ); do
packages=( $(echo ${{ inputs.persistent-packages }}) )
for i in "${packages[@]}"; do
REMOTE_FILE_PATH="s3://${S3_BUILD_BUCKET_SHORT_NAME}/${REMOTE_PATH}/$i.tar.gz"
cache_exists=$(aws s3 ls $REMOTE_FILE_PATH > /dev/null)
if [ $cache_exists -eq 0 ]; then
@@ -22,7 +22,8 @@ runs:
env:
REMOTE_PATH: "adf/build-cache/${{ github.run_id }}"
run: |
for i in ( '${{ inputs.packages }}' ); do
packages=( $(echo ${{ inputs.packages }}) )
for i in "${packages[@]}"; do
echo "processing $i"
time tar czf $i.tar.gz $i
echo "package size: $(du -h $i.tar.gz)"
@@ -37,7 +38,8 @@ runs:
if [ -n "${{ inputs.cache-key-suffix }}" ]; then
REMOTE_PATH="${REMOTE_PATH}-${{ inputs.cache-key-suffix }}"
fi
for i in ( '${{ inputs.persistent-packages }}' ); do
packages=( $(echo ${{ inputs.persistent-packages }}) )
for i in "${packages[@]}"; do
time tar czf $i.tar.gz $i
du -h $i.tar.gz
echo "pushing persistent cache to $REMOTE_PATH"