0
votes

I have a repo on my DevOps Azure website by the name of "my_platform_services". This repo isn't a Java Maven or Gradle project or anything like that; it's mostly bash scripts.

I basically wanted to consume/use this repo into my Release pipeline, where I want to add a one Stage and a few tasks to run one of the bash scripts inside my_platform_services repo in the ovf/build directory!

I know I can add the Command line task in the Stage and put the code to run my script, which is:

./deploy.sh -i name -v 1.0.0

But I keep getting a No such file or directory error enter image description here

I don't know how to access the working directory of that artifact/repo so I can run my script on that agent. I'm confused by my companies naming of the variables. Some of the build pipelines have variables like $BUILD_ARTIFACTSTAGINGDIRECTORY, some of the scripts in the Release pipelines, which I was trying to emulated have $(System.DefaultWorkingDirectory), some are $(Build.ArtifactStagingDirectory).

I don't get why some are the same but capitalized or why some have parenthesis, and I tried looking at the Azure/Microsoft documentation but all the "pre-defined" pipeline variables they list aren't the same. I even looked at the respective pipelines (both release & build) variables to see if I would find any there, but there were just variables like constants and such for passwords or other variables (None that looked like this).

If I set a repo as an artifact for the Release pipeline, does it automatically get consumed, or do I still need to add a Task in the Stage (in the release pipeline) for "Download the Artifacts" from that specific repo?

So can anyone explain to me where these variables are defined and what the heck their paths are? I built some rudimentary build pipelines that were very simple and a release pipeline that consumed the build pipeline and deployed to Azure, but it used they "default" deploy to azure stage, so I didn't have to manually configure any directories or files. I'll take any help!!

1

1 Answers

0
votes

If you already added your repository as an artifact in Release pipeline. I mean you did this:

enter image description here

enter image description here

You should easily find a this step in your job:

enter image description here

So you don't have to add any download step. They are there. You can also find in docs that:

System.DefaultWorkingDirectory

The directory to which artifacts are downloaded during deployment of a release. The directory is cleared before every deployment if it requires artifacts to be downloaded to the agent. Same as Agent.ReleaseDirectory and System.ArtifactsDirectory.

But they are not directly in this folder. Defining artifact you added them an alias. And they are under this folder. I have two artifacts and for ls $(System.DefaultWorkingDirectory) I got:

2020-05-05T05:34:40.8873412Z     Directory: D:\a\r1\a
2020-05-05T05:34:40.8873732Z 
2020-05-05T05:34:40.8873966Z 
2020-05-05T05:34:40.8876175Z Mode                LastWriteTime         Length Name                                                                  
2020-05-05T05:34:40.8877413Z ----                -------------         ------ ----                                                                  
2020-05-05T05:34:40.8879803Z d-----         5/5/2020   5:34 AM                repos                                                                 
2020-05-05T05:34:40.8891912Z d-----         5/5/2020   5:34 AM                _DevOps Manual-CI                                                     
2020-05-05T05:34:40.8955258Z 

Please check what is your alias for your artifact and try command:

./yourAlias/deploy.sh -i name -v 1.0.0

If deploy.sh is in the main root of the repo.