File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -300,16 +300,16 @@ jobs:
300
300
ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} -i ${{ steps.ssh.outputs.private-key-path }} /bin/bash <<'EOT'
301
301
now=$(date +%Y_%m_%d_%H_%M)
302
302
303
- mdss -P ${{ vars.PROJECT_CODE }} mkdir -p ${{ vars.TAPE_ROOT_DIR }}/$now
304
-
305
303
for file in ${{ needs.copy-to-remote.outputs.files }} ${{ needs.copy-to-remote.outputs.manifests }}; do
306
- file_relative_to_target=${file#${{ inputs.target }}/}
307
- echo "Moving '$file' to '${{ vars.TAPE_ROOT_DIR }}/$now/$file_relative_to_target'"
308
- dirs_after_target=$(dirname $file_relative_to_target)
309
- if [[ "$dirs_after_target" != "." ]]; then
310
- mdss -P ${{ vars.PROJECT_CODE }} mkdir -p ${{ vars.TAPE_ROOT_DIR }}/$now/$(dirname $file_relative_to_target)
311
- fi
312
- mdss -P ${{ vars.PROJECT_CODE }} put -r $file ${{ vars.TAPE_ROOT_DIR }}/$now/$file_relative_to_target
304
+ file_relative_to_config_dir=${file#${{ vars.CONFIGS_INPUT_DIR }}/}
305
+ echo "Moving '$file' to '${{ vars.TAPE_ROOT_DIR }}/$now/$file_relative_to_config_dir'"
306
+
307
+ # Create all intermediate directories before putting the file
308
+ intermediate_dirs=$(dirname $file_relative_to_config_dir)
309
+ mdss -P ${{ vars.PROJECT_CODE }} mkdir -p ${{ vars.TAPE_ROOT_DIR }}/$now/$intermediate_dirs
310
+
311
+ # Copy the file itself to tape
312
+ mdss -P ${{ vars.PROJECT_CODE }} put $file ${{ vars.TAPE_ROOT_DIR }}/$now/$file_relative_to_config_dir
313
313
done
314
314
315
315
echo "Output:"
You can’t perform that action at this time.
0 commit comments