2

I have a bash script , in which I written some curl commands to pick the artifact from drop folder and deploy. command is similar like below

curl -u uname:password -F file=@"_path/of/project/all-1.0.1-SNAPSHOT.zip" -F name="test-mname"    -F force=true -F install=true http://xx.xx.xxx.xx 

Here 1.0.1-SNAPSHOT.zip is dynamic and will change per every release. How can I modify the script so can avoid change in pipeline after every release.

Thanks

Vivek Dhiman
  • 1,967
  • 6
  • 46
  • 82

1 Answers1

0

We had only one artifact under drop folder, below script worked for us

drop_location="_OurProjetc_PipeLine _Alias\drop"

# Find the most recent file in the drop location
latest_file=$(ls -t "$drop_location" | grep '^test-name' | head -n1)

curl -u uname:passord -F file=@"$drop_location\\$latest_file" -F name="test-name"  -F force=true -F install=true http://xx.xx.xxx.xx 
Vivek Dhiman
  • 1,967
  • 6
  • 46
  • 82