Azure DevOps Pipines - Git Respository local directory location - azure

I have created a Pipeline in Azure DevOps and have associated a git repository.
It is cloned to my agent, but I can't get control over in which local directory the repository is cloned to. I am working with self hosted Agent.
The next task need to use a specific file in the repository to complete the task.
The last things tha should happen in the pipline, is push back changes made in the respository.

I think what you want is WorkingDirectory, the local path on the agent where your source code files are downloaded. For example: c:\agent_work\1\s

Related

how to use existing github yml files for Azure devops pipelines

I want to create Azure DevOps pipelines, but instead of writing new yaml files, use prepared ones that are in a github repository.
I have connected GitHub to my Azure DevOps account, but I Can't see an option to use yaml files in that repository.
I only have an option to create a new pipeline yaml, and then set it in the repo folder structure.
If I try and set it on the location of the yaml file I want to use, which is already in the repo, I get - of course, an error stating there's a file there.
My work around is to set a new yaml file with a different name, copy the content from the existing file and then delete that one and rename the new file to the name of the file I copied from.
Surely there must be a better, easier, more logical and short way.
I would appreciate any help.
Under project settings you should link your Github account.
Then you can go and create a new pipeline and select the Github location
after this step, your available github repositories will appear and you can select your existing .YML file.
Existing pipeline:

Force init in Gitea when repo is created

When you create a repo in Gitea from the website you can mark "Initialize Repository (Adds .gitignore, License and README)", and when you create a repo in Gitea from the API you can set auto_init to true.
Is there any way to configure Gitea to force Initialize Repository for all repos no matter if they are created from the website or API and no matter what the user chose for this option?
In other words, I need to configure my Gitea to always initialize every repo that is created.

How can I prevent PRs from changing my CI configuration?

We have an open source project in GitHub. And we use Azure DevOps pipelines for our CI.
We publish our artefacts to S3 and Maven after successful tests, so all the credentials are stored as secret variables.
It's nice that export and echo $top_secret are conveniently obfuscated with ***, but unfortunately literally any user on GitHub can create a pull request against our repo, and as part of the changes, they can edit our azure-pipelines.yml and call a curl (or similar) to read the credentials from environmental variables and send them to their own server.
In other CI providers (Travis CI) secret variables are not accessible from PR branches.
How can I prevent PRs from touching my CI configuration file and do anything with it?
How can I prevent PRs from touching my CI configuration file and do anything with it?
You CI configuration file is save in the GitHub open source and you want to restrict users from changing this file, right? Since we cannot set file permission in the GitHub. we cannot prevent PRs from touching your CI configuration file.
As a workaround, we could create classic editor pipeline in the Azure DevOps and set the CI Trigger, such as below. If users do not have permission to change the build definition, they cannot change your CI build definition.
Update1

Problem deploying a Bitbucket repo to Azure Storage

I've been trying to deploy my web app on Bitbucket to Azure Storage using Bitbucket Pipelines. I'm having issues with the SOURCE option. I need to copy the entire source code in the current repository, but SOURCE option seems to require a directory name.
My pipeline script is something like this:
- pipe: microsoft/azure-storage-deploy:2.0.0
variables:
SOURCE: './*'
DESTINATION: 'https://mystorageaccount.blob.core.windows.net/mycontainer'
How can I deploy everything in current repository?
The problem is fixed now.
There is a constant $BITBUCKET_CLONE_DIR which holds current repository.
You can find more pre-defined constants here: https://confluence.atlassian.com/bitbucket/variables-in-pipelines-794502608.html

App Service Editor in Azure

The App Service Editor (Preview) in Azure
When I 'Initialize Git Repository', where is my git repository created? Is there a repository URL that I can use?
And if later, after finish changing my code, I want to export repository (e.g., get a copy to my local machine), how can I do that?
You can access the git repository through command line or via the URL given in your instance dashboard in properties
there should be a Git URL field there.

Resources