How set dynamic external url environment from a job

hello

when i finish build i run another pipeline for testing and at end it build html report with url version profile, type report, testname, datetime, at end report generation, i run play job back for process deploy on the first job

how i can set a dynamic url environnement for deploying with not predefined variable, work fine in the environnement ui but i need the same way by program yml scripting

i use external url generated by testing chain
https://mygitlab.com/my-android-app/V3.1.0-STANDARD-DEV/JUNIT/20190507-163100-000/reports/junit/index.html

test_report:
variables:
URL_TEST_REPORT : $(./getReportTestOfDatetimeHtml.sh “TEST”)
stage: deploy
script:
echo $URL_TEST_REPORT
when: manual
environment:
name: $V1$CI_PROJECT_NAME/$CI_COMMIT_REF_NAME
url: $URL_REPORT_TEST

i try also
url : $(./getReportTestOfDatetimeHtml.sh “TEST”)
i got nothing in deploy environnement the url exist, i have same code for PERF testing

work fine with static value or predefined variable, but i need to set dynamically external report url like you can set into ui environnement

it doesn’t evaluate the variable URL_REPORT_TEST : $(./getReportTestOfDatetimeHtml.sh “TEST”), normaly it work fine, if i set inside job, the environment tag doesnt see variable

how you do that

thanks

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 evaluate local variable or evaluate from script url=$(./myurl.sh), and also the play job with variable array on existing pipeline like triger pipeline

kr