fork download
  1.  
  2. cd $(Build.ArtifactStagingDirectory)
  3. ls -lrt
  4. temp="$(basename $(Build.ArtifactStagingDirectory)/*.zip)"
  5. echo $temp
  6.  
  7. Output -  
  8. /home/vsts/work/1/s
  9. total 4
  10. -rw-r--r-- 1 vsts docker 959 Mar 3 18:26 269.zip
  11. 269.zip
  12.  
  13.  
  14.  
  15. curl -D- -u 'userid:token'
  16. -X POST
  17. -H 'X-Atlassian-Token: nocheck'
  18. -F 'file=@"$(Build.ArtifactStagingDirectory)/$temp"' \
  19. 'confluence_url/rest/api/content/page_id/child/attachment'
  20.  
  21. Output-
  22. curl: (26) Failed to open/read local data from file/application
  23. ##[error]Bash exited with code '26'.
  24.  
Runtime error #stdin #stdout #stderr 0.02s 10924KB
stdin
Standard input is empty
stdout
total 4
-rw-rw-r-- 1 root root 509 Mar  3 18:38 prog.sh
*.zip
stderr
./prog.sh: line 2: Build.ArtifactStagingDirectory: command not found
./prog.sh: line 4: Build.ArtifactStagingDirectory: command not found
./prog.sh: line 7: Output: command not found
./prog.sh: line 8: /home/vsts/work/1/s: No such file or directory
./prog.sh: line 9: total: command not found
./prog.sh: line 10: -rw-r--r--: command not found
./prog.sh: line 11: 269.zip: command not found
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information
./prog.sh: line 16: -X: command not found
./prog.sh: line 17: -H: command not found
./prog.sh: line 18: -F: command not found
./prog.sh: line 21: Output-: command not found
./prog.sh: line 22: syntax error near unexpected token `26'
./prog.sh: line 22: `curl: (26) Failed to open/read local data from file/application'