Browse Source

Add clone directory (#589)

jkotalik/fixAzureFunctions
Justin Kotalik 6 years ago
committed by GitHub
parent
commit
14f08ccf05
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      docs/reference/schema.md
  2. 2
      src/Microsoft.Tye.Core/ApplicationFactory.cs
  3. 1
      src/Microsoft.Tye.Core/ConfigModel/ConfigService.cs
  4. 3
      src/Microsoft.Tye.Core/Serialization/ConfigServiceParser.cs
  5. 5
      src/schema/tye-schema.json

4
docs/reference/schema.md

@ -216,6 +216,10 @@ A path to another tye.yaml to be used by the application.
A reference to a repository that will be cloned and used by the application. By default, it is a string that would be passed after `git clone`.
#### `cloneDirectory` (string)
The directory to clone to. If unspecified, tye will clone into the .tye/deps relative to where tye is started.
#### `azureFunction` (string)
A path to a folder which contains an azure function project.

2
src/Microsoft.Tye.Core/ApplicationFactory.cs

@ -186,7 +186,7 @@ namespace Microsoft.Tye
else if (!string.IsNullOrEmpty(configService.Repository))
{
// clone to .tye folder
var path = Path.Join(rootConfig.Source.DirectoryName, ".tye", "deps");
var path = configService.CloneDirectory ?? Path.Join(rootConfig.Source.DirectoryName, ".tye", "deps");
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);

1
src/Microsoft.Tye.Core/ConfigModel/ConfigService.cs

@ -44,5 +44,6 @@ namespace Microsoft.Tye.ConfigModel
public string? FuncExecutable { get; set; }
public string? Version { get; set; }
public string? Architecture { get; set; }
public string? CloneDirectory { get; internal set; }
}
}

3
src/Microsoft.Tye.Core/Serialization/ConfigServiceParser.cs

@ -152,6 +152,9 @@ namespace Tye.Serialization
case "pathToFunc":
service.FuncExecutable = YamlParser.GetScalarValue(key, child.Value);
break;
case "cloneDirectory":
service.CloneDirectory = YamlParser.GetScalarValue(key, child.Value);
break;
default:
throw new TyeYamlException(child.Key.Start, CoreStrings.FormatUnrecognizedKey(key));
}

5
src/schema/tye-schema.json

@ -285,6 +285,11 @@
{
"description": "The repository url which will be cloned.",
"type": "string"
},
"cloneDirectory":
{
"description": "The directory to clone the repository into.",
"type": "string"
}
},
"required": [

Loading…
Cancel
Save