I'm trying to inject an environment variable at build step Invoke Maven
whose value was set at pre-build step through Execute Shell
#!/bin/bash
ipAddressHub=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' selenium-hub)
echo $ipAddressHub
echo 'ipAddress=$ipAddressHub' > ipAddress.properties
Now I want to fetch the value of ipAddress
stored in ipAddress.properties
. I'm using Inject environment variables
after Execute Shell
and provide ipAddress.properties
in Properties File Path
field (not sure if that's the right way) and then i use build step Invoke Maven Artifactory
and provide the command below.
clean install -DipAddress=${ipAddressHub} -Denv=${env} -Durl=${appURL} -DserverIP=${ipAddress}
But i don't get the value in serverIP, instead i get ${ipAddressHub}
in console. I know i'm making some mistake, can anybody point out what's the correct way?