Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
feat: Support for .NET Core Function Apps
Browse files Browse the repository at this point in the history
  • Loading branch information
tbarlow12 committed May 11, 2020
1 parent c5c44c9 commit 3f35c44
Show file tree
Hide file tree
Showing 33 changed files with 563 additions and 205 deletions.
187 changes: 143 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
"request": "^2.81.0",
"rimraf": "^2.7.1",
"semver": "^6.3.0",
"xml2js": "^0.4.22"
"xml2js": "^0.4.22",
"zip-folder": "^1.0.0"
},
"devDependencies": {
"@azure/ms-rest-js": "^1.8.7",
Expand All @@ -85,7 +86,7 @@
"axios-mock-adapter": "^1.16.0",
"babel-jest": "^24.8.0",
"babel-preset-react-app": "^9.0.0",
"clvr": "^0.3.6",
"clvr": "^0.3.8",
"conventional-changelog-cli": "^2.0.23",
"eslint": "^5.16.0",
"jest": "^24.8.0",
Expand Down
4 changes: 2 additions & 2 deletions src/armTemplates/resources/apim.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ApimResource } from "./apim";
import { ServerlessAzureConfig } from "../../models/serverless";
import md5 from "md5";
import { configConstants } from "../../config/constants";
import { constants } from "../../shared/constants";
import { Runtime } from "../../config/runtime";

describe("APIM Resource", () => {
Expand All @@ -13,7 +13,7 @@ describe("APIM Resource", () => {
it("generates the correct resource name", () => {
const resourceGroupHash = md5(resourceGroupName).substr(
0,
configConstants.resourceGroupHashLength
constants.resourceGroupHashLength
);

const config: ServerlessAzureConfig = {
Expand Down
4 changes: 2 additions & 2 deletions src/armTemplates/resources/appInsights.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AppInsightsResource } from "./appInsights";
import { ServerlessAzureConfig } from "../../models/serverless";
import md5 from "md5";
import { configConstants } from "../../config/constants";
import { constants } from "../../shared/constants";
import { Runtime } from "../../config/runtime";

describe("App Insights Resource", () => {
Expand All @@ -13,7 +13,7 @@ describe("App Insights Resource", () => {
it("generates the correct resource name", () => {
const resourceGroupHash = md5(resourceGroupName).substr(
0,
configConstants.resourceGroupHashLength
constants.resourceGroupHashLength
);

const config: ServerlessAzureConfig = {
Expand Down
4 changes: 2 additions & 2 deletions src/armTemplates/resources/appServicePlan.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AppServicePlanResource } from "./appServicePlan";
import { ServerlessAzureConfig } from "../../models/serverless";
import md5 from "md5";
import { configConstants } from "../../config/constants";
import { constants } from "../../shared/constants";
import { Runtime, FunctionAppOS } from "../../config/runtime";

describe("App Service Plan Resource", () => {
Expand All @@ -25,7 +25,7 @@ describe("App Service Plan Resource", () => {
it("generates the correct resource name", () => {
const resourceGroupHash = md5(resourceGroupName).substr(
0,
configConstants.resourceGroupHashLength
constants.resourceGroupHashLength
);

const config: ServerlessAzureConfig = {
Expand Down
4 changes: 2 additions & 2 deletions src/armTemplates/resources/functionApp.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { dockerImages, getRuntimeLanguage, getRuntimeVersion, FunctionAppOS, isNodeRuntime, Runtime, RuntimeLanguages } from "../../config/runtime";
import { dockerImages, getRuntimeLanguage, getRuntimeVersion, FunctionAppOS, isNodeRuntime, Runtime, RuntimeLanguage } from "../../config/runtime";
import { ArmParameter, ArmParameters, ArmParamType, ArmResourceTemplate, ArmResourceTemplateGenerator, DefaultArmParams } from "../../models/armTemplates";
import { FunctionAppConfig, ServerlessAzureConfig } from "../../models/serverless";
import { AzureNamingService, AzureNamingServiceOptions } from "../../services/namingService";
Expand Down Expand Up @@ -256,7 +256,7 @@ export class FunctionAppResource implements ArmResourceTemplateGenerator {

private getFunctionWorkerRuntime(runtime: Runtime): string {
const language = getRuntimeLanguage(runtime);
if (language === RuntimeLanguages.NODE){
if (language === RuntimeLanguage.NODE){
return "node";
}
return language;
Expand Down
4 changes: 2 additions & 2 deletions src/armTemplates/resources/hostingEnvironment.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HostingEnvironmentResource } from "./hostingEnvironment";
import { ServerlessAzureConfig } from "../../models/serverless";
import md5 from "md5";
import { configConstants } from "../../config/constants";
import { constants } from "../../shared/constants";
import { Runtime } from "../../config/runtime";

describe("Azure Hosting Environment Resource", () => {
Expand All @@ -13,7 +13,7 @@ describe("Azure Hosting Environment Resource", () => {
it("generates the correct resource name", () => {
const resourceGroupHash = md5(resourceGroupName).substr(
0,
configConstants.resourceGroupHashLength
constants.resourceGroupHashLength
);

const config: ServerlessAzureConfig = {
Expand Down
4 changes: 2 additions & 2 deletions src/armTemplates/resources/storageAccount.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { configConstants } from "../../config/constants";
import { constants } from "../../shared/constants";
import { ArmParameters, ArmParamType, ArmResourceTemplate, ArmResourceTemplateGenerator, DefaultArmParams, ArmParameter } from "../../models/armTemplates";
import { ResourceConfig, ServerlessAzureConfig } from "../../models/serverless";
import { AzureNamingService, AzureNamingServiceOptions } from "../../services/namingService";
Expand All @@ -18,7 +18,7 @@ export class StorageAccountResource implements ArmResourceTemplateGenerator {
};
return AzureNamingService.getSafeResourceName({
...options,
maxLength: configConstants.naming.maxLength.storageAccount
maxLength: constants.naming.maxLength.storageAccount
});
}

Expand Down
4 changes: 2 additions & 2 deletions src/armTemplates/resources/virtualNetwork.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { VirtualNetworkResource } from "./virtualNetwork";
import { ServerlessAzureConfig } from "../../models/serverless";
import md5 from "md5";
import { configConstants } from "../../config/constants";
import { constants } from "../../shared/constants";
import { Runtime } from "../../config/runtime";

describe("Virtual Network Resource", () => {
Expand All @@ -13,7 +13,7 @@ describe("Virtual Network Resource", () => {
it("generates the correct resource name", () => {
const resourceGroupHash = md5(resourceGroupName).substr(
0,
configConstants.resourceGroupHashLength
constants.resourceGroupHashLength
);

const config: ServerlessAzureConfig = {
Expand Down
15 changes: 15 additions & 0 deletions src/config/cliCommandFactory.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { CliCommandFactory, CliCommand } from "./cliCommandFactory"

describe("Cli Command Factory", () => {
it("registers a CLI command", () => {
const testCommand: CliCommand = {
command: "testCommand",
args: [ "test", "args" ],
}
const factory = new CliCommandFactory();
factory.registerCommand("test", testCommand);
const result = factory.getCommand("test");
expect(result.command).toEqual(testCommand.command);
expect(result.args).toEqual(testCommand.args);
});
});
Loading

0 comments on commit 3f35c44

Please sign in to comment.