This is what I want to do, as soon as someone in your org create a repository in Azure DevOps (or GitHub), a defined project scaffold/structure is build for them. For example, a fresh repo (my_proj) is created, then DevOps/GitHub creates such a folder structure for you (you defined it somewhere):
───my_proj
│ ReadMe.md
│
├───docs
├───res
│ ├───file
│ └───img
├───scr
└───tests
I know you can do these things after you clone the repo using some codes/libraries, but is there a way to do it automatically?
As mentioned in "Create template git-repo in in azure devops", there is no native feature allowing you to chose a given Git repository template when initializing a new Project with Azure DevOps.
That means you could:
git remote set-url ...)You can see that approach atomated through Azure piplines with "Create a new repository from a template in Azure DevOps" from Stephen Allwright
- Create a repository in Azure DevOps that you would like to use as your template. Let's call it 'project-template'
- Create a second repository to contain the build pipeline you will create. We will call this 'utilities'. This is a useful repository to have in general to house all your automation pipelines and other functions which improve the ease of development
- Create a starter build pipeline and host it within the utilities repository
- Create a variable within the pipeline UI called 'project-name', this will be used as the name of your newly created repository. Defining this variable within the UI allows us to choose a project name when we run the pipeline in DevOps
- Use the following code, making sure to replace 'devops-organisation', 'devops-project', 'email', and 'user' with your own values
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With