Using the output of tj-actions / changed-files in a loop for containers #1149
-
I noticed a few issues that were opened using the output of ${{ steps.changed-files-specific.outputs.all_changed_files }} in a loop. Would it be possible to use the results in a remote shell script for docker compose? cd /home/docker docker compose -f ${{ steps.changed-files-specific.outputs.all_changed_files }} up -d |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Was thinking something like this might work, but would like to have a loop to run through the loop of changed YAML files. `
` |
Beta Was this translation helpful? Give feedback.
-
@ServerGeek82 The output of It can be passed to docker-compose with multiple -f options. e.g Example: - name: Get docker-compose options
run: |
ALL_CHANGED_FILES=(${{ steps.changed-files-specific.outputs.all_changed_files }})
ARGS=""
for file in "${ALL_CHANGED_FILES[@]}"; do
ARGS+="-f $file"
done
# Pass the args to docker-compose
|
Beta Was this translation helpful? Give feedback.
@ServerGeek82 The output of
all_changed_files
likely includes multiple files separated by spaces.It can be passed to docker-compose with multiple -f options. e.g
-f [FILE1] -f [FILE2]
Example: