Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add php oryx build support #59

Merged
merged 1 commit into from
Jun 21, 2019
Merged
Show file tree
Hide file tree
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
12 changes: 10 additions & 2 deletions Kudu.Core/Deployment/Oryx/AppServiceOryxArguments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ private void SetLanguageOptions()
}

return;

case Framework.PHP:
return;
}
}

Expand Down Expand Up @@ -115,7 +118,6 @@ public string GenerateOryxBuildCommand(DeploymentContext context)
case Framework.NodeJs:
// Input/Output
OryxArgumentsHelper.AddOryxBuildCommand(args, source: context.OutputPath, destination: context.OutputPath);

OryxArgumentsHelper.AddLanguage(args, "nodejs");
break;

Expand All @@ -130,14 +132,20 @@ public string GenerateOryxBuildCommand(DeploymentContext context)
OryxArgumentsHelper.AddOryxBuildCommand(args, source: context.RepositoryPath, destination: context.OutputPath);
OryxArgumentsHelper.AddLanguage(args, "dotnet");
break;

case Framework.PHP:
// Input/Output
OryxArgumentsHelper.AddOryxBuildCommand(args, source: context.OutputPath, destination: context.OutputPath);
OryxArgumentsHelper.AddLanguage(args, "php");
break;
}

// Version
switch (Language)
{
case Framework.None:
break;

case Framework.PHP:
case Framework.NodeJs:
case Framework.Python:
OryxArgumentsHelper.AddLanguageVersion(args, Version);
Expand Down
4 changes: 4 additions & 0 deletions Kudu.Core/Deployment/Oryx/FunctionAppOryxArguments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ protected void AddLanguage(StringBuilder args, WorkerRuntime workerRuntime)
case WorkerRuntime.Python:
OryxArgumentsHelper.AddLanguage(args, "python");
break;

case WorkerRuntime.PHP:
OryxArgumentsHelper.AddLanguage(args, "php");
break;
}
}

Expand Down
10 changes: 9 additions & 1 deletion Kudu.Core/Deployment/Oryx/FunctionAppSupportedWorkerRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ public enum WorkerRuntime
None,
Node,
Python,
DotNet
DotNet,
PHP
}

public class FunctionAppSupportedWorkerRuntime
Expand All @@ -30,6 +31,10 @@ public static WorkerRuntime ParseWorkerRuntime(string value)
{
return WorkerRuntime.DotNet;
}
else if (value.StartsWith("PHP", StringComparison.OrdinalIgnoreCase))
{
return WorkerRuntime.PHP;
}

return WorkerRuntime.None;
}
Expand All @@ -47,6 +52,9 @@ public static string GetDefaultLanguageVersion(WorkerRuntime workerRuntime)
case WorkerRuntime.Python:
return OryxBuildConstants.FunctionAppWorkerRuntimeDefaults.Python;

case WorkerRuntime.PHP:
return OryxBuildConstants.FunctionAppWorkerRuntimeDefaults.PHP;

default:
return "";
}
Expand Down
15 changes: 11 additions & 4 deletions Kudu.Core/Deployment/Oryx/OryxArguments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ private void SetLanguageOptions()
}

return;

case Framework.PHP:
return;
}
}

Expand Down Expand Up @@ -103,20 +106,24 @@ public string GenerateOryxBuildCommand(DeploymentContext context)
break;

case Framework.NodeJs:
args.AppendFormat(" -l nodejs");
args.AppendFormat(" --platform nodejs");
break;

case Framework.Python:
args.AppendFormat(" -l python");
args.AppendFormat(" --platform python");
break;

case Framework.DotNETCore:
args.AppendFormat(" -l dotnet");
args.AppendFormat(" --platform dotnet");
break;

case Framework.PHP:
args.AppendFormat(" --platform php");
break;
}

// Version
args.AppendFormat(" --language-version {0}", Version);
args.AppendFormat(" --platform-version {0}", Version);

// Build Flags
switch (Flags)
Expand Down
1 change: 1 addition & 0 deletions Kudu.Core/Deployment/Oryx/OryxBuildConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ internal static class FunctionAppWorkerRuntimeDefaults
public static readonly string Node = "8.15";
public static readonly string Python = "3.6";
public static readonly string Dotnet = "2.2";
public static readonly string PHP = "7.3";
}

internal static class FunctionAppBuildSettings
Expand Down
7 changes: 6 additions & 1 deletion Kudu.Core/Deployment/Oryx/SupportedLanguages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ public enum Framework
None,
NodeJs,
Python,
DotNETCore
DotNETCore,
PHP
}

public class SupportedFrameworks
Expand All @@ -28,6 +29,10 @@ public static Framework ParseLanguage(string value)
{
return Framework.DotNETCore;
}
else if (value.StartsWith("PHP", StringComparison.OrdinalIgnoreCase))
{
return Framework.PHP;
}

return Framework.None;
}
Expand Down