how set variables[MYKEY]=MYVALUE with api play job
curl --request POST --form “variables[REPORTURL]=http://myreport.com” --header “PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK” “https://gitlab.example.com/api/v4/projects/1/jobs/1/play”
it execute the job but i get nothing in play jobs, variables array is empty,i need good sample, i read documentaiton gitlab it seem possible
thanks for help
kr
ok, i solve that by curl shell script with the api environnment by search/create/update environment
the get environnment doesnt work with api v4, i cant found existing env id, seem bug, i must seach on all environment list
if the env id is existing or not
i use create or update for the external url
gitlab yml is to limited and that was not intelligent, not cool
EXTERNAL_URL=http://www.google.fr
NAME=“myreport-url”
curl --data “name=$NAME&external_url=$EXTERNAL_URL” --header “PRIVATE-TOKEN: $TOKEN” “$PATH/$PROJECT_ID/environments”
ENVIRONMENT_ID=1234
curl --request PUT --data “name=$NAME&external_url=$EXTERNAL_URL” --header “PRIVATE-TOKEN: $TOKEN” “PATH/$PROJECT_ID/environments/$ENVIRONMENT_ID”
environments:
name : myreport-url
i hope they can improve scope environment with local variable or evaluate from script url=$(./myurl.sh)
kr