I am using the bash script to build the conda pakage in azure pipeline conda build . --output-folder $(Build.ArtifactStagingDirectory)
And here is the issue, Conda build uses the build number in the meta.yml file(see here).
A solution of What I could think of is, first, copy all files to Build.ArtifactStagingDirectory
and add the Azure pipeline's Build.BuildNumber
into the meta.yml and build the package to Build.ArtifactStagingDirectory
(within a sub-folder)
I am trying to avoid do it by writing shell script to manipulate the yaml file in Azure pipeline, because it might be error prone. Any one knows a better way? Would be nice to read a more elegant solution in the answers or comments.
I don't know much about Azure pipelines. But in general, if you want to control the build number without changing the contents of
meta.yaml
, you can use ajinja
template variable withinmeta.yaml
.Choose a variable name, e.g.
CUSTOM_BUILD_NUMBER
and use it inmeta.yaml
:To define that variable, you have two options:
Use an environment variable:
OR
Define the variable in
conda_build_config.yaml
(docs), as followsIf you want, you can add an
if
statement so that the recipe still works even ifCUSTOM_BUILD_NUMBER
is not defined (using a default build number instead).