I have created a small script to trigger a pipeline using the test API
I am trying to run this script with the ref_name and pattern as arguments to the script
#test.sh master deploy
#vi test.sh
curl -X POST -is -u $BB_USER:$BB_PASS \
-H 'Content-Type: application/json' \
https://api.bitbucket.org/2.0/repositories/transportfornsw/tfnsw-corp-tests/pipelines/ \
-d '
{
"target": {
"type": "pipeline_ref_target",
"ref_type": "branch",
"ref_name": "$1",
"selector": {
"type": "custom",
"pattern": "$2"
}
}
}'
Tried few ways to take the arguments into the script but I get an error as below
{"error": {"message": "Not found", "detail": "Could not find last reference for branch $1", "data": {"key": "result-service.pipeline.reference-not-found", "arguments": {"uuid": "$1"}}}}
I want to add this as a part of pipeline
thanks a lot for your help in advance