Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions docs/preview/yamlgettingstarted-directory.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# YAML getting started - YAML directory (not available, for discussion only)

## Summary

We plan to support a convention-based directory structure, with a couple goals in mind:

1. Today we only create a build definition on-push for the root file `.vsts-ci.yml`. And resource authorization on-push is only handled for that one file. With a convention based
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the file have to be in the root of the repo? If we put the file under another directory that isn't the root would it still work but just not auto update?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

root of the repo or the folder structure below if you want it to auto create.

directory structure, we can watch for files under a specific directory.

2. For template scenarios, a convention-based directory structure would enable referencing templates by name, instead of by relative path.

## Directory structure

```
.vsts-pipelines/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the folder name be shortened to .vsts/?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we will probably shorten to .pipelines

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @natemcmaster. What happens if I use multiple build systems and they all use .pipelines/? I would rather the folder be specific to vsts, and have the shortest name possible.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI - we started using .vsts/ in aspnet, but for a different reason: we don't want build definitions to be auto-created on push. This spec didn't mention if there would be a way to prevent auto-definition creation, so we picked a folder name that isn't currently in these plans.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How many current build systems use/must use .pipelines for their yaml?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None that I am aware of currently. I know that Gitlab allows for custom paths. Still, I would associate .vsts/ with your product easier than .pipelines/

builds/
build.yml
releases/
release.yml
steps/
msbuild.yml
node.yml
phases/
stages/
```

## Definition creation on-push

On push, builds or releases would be created for yml files under the `builds` and `releases` directories.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to configure the directory to look under?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weshaggard - no. And that's very intentional. We need to scope our search for large pushes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the desire to limit the scope but it still feels like this could be configurable at some level (repo/definition/vsts instance). There are reasons for different projects to need a different set of directory structure.

Copy link
Contributor

@bryanmacfarlane bryanmacfarlane May 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interested in those scenarios ... feel free to email/discuss with @chrisrpatterson and I as well if that's easier.

There's also a desire for approachability of a repo where you can approach the repro and instantly know what it's process is (without access to the account's config). We're also considering marketing and names in this. (vsts-yaml is instantly recognizable, considering for folder as well)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to maintain the above described folder structure, but move the entire structure to some other directory and search for the existence of the .vsts-pipelines/ folder? So, your search is to find .vsts-pipelines, and then do all the yml search logic. That doesn't address the approachability aspect though.

Another option would be to have a root .vsts-config.yml file

The file names represent the definition name.

Subdirectories under `builds` and `releases` are supported as well, and create the same directory
structure in the web.

## Template references

Using the `steps`, `phases`, and `stages` folders enables referring to templates by name.

Consider the directory structure:

```
.vsts-pipelines/
builds/
foo/
foo-ci.yml
foo-pr.yml
foo-scheduled.yml
steps/
foo/
build.yml
```

Given the above directory structure, the steps-template can be referenced from the definition YAML file
by specifying the template's pathy-name. For example:

```yaml
steps:
- template: foo/build
```

Without relying on a convention-based layout, the relative path would need to be specified from the
definition YAML file. For example:

```yaml
steps:
- template: ../../steps/foo/build.yml
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a relative reference the only way to do this? ie, could you explicitly reference the root of the repo?

steps:
- template:/eng/common/steps/foo/build.yml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I believe that works today

```