I have a bitbucket pipeline script and a version.sh bash script that are playing nicely. The pipeline will call the version script and there are environment variables inside version.sh that are referenced correctly by bitbucket (I added the variables in settings for the repo).
However, I also have variables now in my gradle.build file, but these keep giving me errors in the pipeline when I try a gradle build.
The error I keep getting is could not get unknown property '$context_url' for root project 'my_project' of type org.gradle.api.Project.
The variables are in the artifactory/publish section:
<span>artifactory </span><span>{</span><span> <br> contextUrl </span><span>=</span><span> $context_url
publish </span><span>{</span><span> <br> repository </span><span>{</span><span> <br> repoKey </span><span>=</span> <span>'repo'</span><span> <br> username </span><span>=</span><span> $artifactory_user
password </span><span>=</span><span> $artifactory_password
</span><span>}</span><span> <br> defaults </span><span>{</span><span> <br> publications</span><span>(</span><span>'mavenJava'</span><span>)</span><span> <br> publishArtifacts </span><span>=</span> <span>true</span><span> <br> publishPom </span><span>=</span> <span>true</span>
<span>}</span>
<span>}</span>
<span>}</span> I've tried different syntax in the gradle.build file, such as:
$context_url'$context_url'"$context_url"
The variables work locally, I have the variables stored in my personal ~/gradle/gradle.properties file.
Not sure what else to try.