Hello Jason Thanks for your email. If I updated variable manually the command works in agent.
I am getting the following error: which does not tell me that is related with populating the variable or not.. *[go] Job Started: 2020-08-10 19:53:21 AEST* *[go] Start to prepare xx-prj/77/6-DeploySIT1/1/deploy on test.internal [/var/lib/go-agent]* *[go] Cleaning working directory "/var/lib/go-agent/pipelines/ xx-prj" since stage is configured to clean working directory* *[go] Skipping material update since stage is configured not to fetch materials* *[go] Start to build xx-prj /77/6-DeploySIT1/1/deploy on test.internal [/var/lib/go-agent]* *[go] Task: /usr/bin/curl -L -k -v -u <username>:<password> -X GET "https://artifactory.com/service/rest/v1/search/assets/download?group=/xx-prj/master/${GO_PIPELINE_LABEL}&name=xx-prj/master/${GO_PIPELINE_LABEL}/${GO_REVISION_MYGIT}.zip" -o "${GO_REVISION_MYGIT}.zip" && unzip -o "${GO_REVISION_MYGIT}.zip" -d .'took: 0.2s* *Error happened while attempting to : /usr/bin/curl -L -k -v -u <username>:<password> -X GET "https://artifactory.com/service/rest/v1/search/assets/download?group=/xx-prj/master/${GO_PIPELINE_LABEL}&name=xx-prj/master/${GO_PIPELINE_LABEL}/${GO_REVISION_MYGIT}.zip" -o "${GO_REVISION_MYGIT}.zip" && unzip -o "${GO_REVISION_MYGIT}.zip" -d .] can be executed on this agent. * *[Debug Information] Environment variable PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin* *[go] Task status: failed, took: 0.2s* *[go] Current job status: failed* *[go] Start to create properties xx-prj/77/6-DeploySIT1/1/deploy on test.internal [/var/lib/go-agent]* *[go] Start to upload xx-prj/77/6-DeploySIT1/1/deploy on test.internal [/var/lib/go-agent]* *[go] Job completed xx-prj/77/6-DeploySIT1/1/deploy on test.internal [/var/lib/go-agent]* Regards Prakash On Tuesday, 11 August 2020 at 00:17:25 UTC+10 [email protected] wrote: > Hello Prakash, > > What do you see in the console output beyond the error message? I believe > the raw command should get printed to console which would make > troubleshooting easier. > > Here is an example from the raw output of one of our Pipelines that uses > Custom Commands: > > !!|10:43:38.980 [go] Task: cmd /c > ""C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" > "tfs\path\to\project.proj" "/t:Release\"" > > > I suspect that the issue you are having is that GoCD tries to expand the > environment variables used in your command before they have been defined > but, again, you should be able to see that from the console output. > > If the console output looks right, including all of the environment > variables, try running it from the command line on the agent to see what > the error message is there. > > Hope this helps, > Jason > > > > On Monday, 10 August 2020 09:18:09 UTC-4, Prakash Tirumalareddy wrote: >> >> Hello Helge >> >> We tried using the curl command: >> >> 6-DeploySIT1: >> fetch_materials: no >> clean_workspace: yes >> approval: manual >> environment_variables: >> app_environment: nonprod >> verify_repo: verify-repo >> jobs: >> deploy: >> tasks: >> - exec: >> command: /usr/bin/curl -L -k -v -u <username>:<password> -X >> GET " >> https://artifactory.xys.com/service/rest/v1/search/assets/download?group=/<artefact_name>/master/${GO_PIPELINE_LABEL}&name=<artefact_name>/master/${GO_PIPELINE_LABEL}/${GO_REVISION_MYGIT}.zip" >> >> -o "${GO_REVISION_MYGIT}.zip" && unzip -o "${GO_REVISION_MYGIT}.zip" -d .' >> - exec: >> arguments: >> - deploy >> command: make >> >> Error is: >> Check your command whether it can be executed on your agent. >> >> Regards >> Prakash >> >> On Saturday, 8 August 2020 at 00:06:00 UTC+10 [email protected] wrote: >> >>> Hello Prakash, >>> >>> for an example see here: >>> https://github.com/tomzo/gocd-yaml-config-plugin#example >>> >>> tasks: # ordered list of tasks to execute >>> - exec: # indicates type of task >>> command: make >>> arguments: >>> - "VERBOSE=true" >>> >>> You can specify your curl command here instead of the "make" call. The >>> curl call is specific to your artifactory and the repository type you use >>> -- so it's difficult for me to give you a neaningfull example. >>> >>> Regards, >>> Helge >>> >>> -- You received this message because you are subscribed to the Google Groups "go-cd" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/482403f0-8b8f-4b4e-aff1-e00c8ee48df4n%40googlegroups.com.
