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

fix: add self contained config in dotnet publish #4391

Merged
merged 7 commits into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from 3 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
5 changes: 5 additions & 0 deletions extensions/azurePublish/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ const schema: JSONSchema7 = {
type: 'string',
title: 'Language for luis - default to en-us',
},
runtimeIdentifier: {
type: 'string',
title: 'Runtime identifier for hosting bot, default to win-x64, please refer to https://docs.microsoft.com/en-us/dotnet/core/rid-catalog'
},
settings: {
type: 'object',
title: 'Settings for Azure resources',
Expand Down Expand Up @@ -108,6 +112,7 @@ const schema: JSONSchema7 = {
accessToken: '<Access token from az account get-access-token>',
name: '<unique name in your subscription>',
environment: 'dev',
runtimeIdentifier: 'win-x64',
settings: {
applicationInsights: {
InstrumentationKey: '<Instrumentation Key>',
Expand Down
75 changes: 75 additions & 0 deletions extensions/azurePublish/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
version "1.0.0"
dependencies:
"@botframework-composer/types" "*"
"@types/passport" "^1.0.3"
debug "^4.1.1"
fs-extra "^9.0.1"
globby "^11.0.0"
Expand Down Expand Up @@ -456,6 +457,14 @@
resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.32.tgz#381e7b59e39f010d20bbf7e044e48f5caf1ab620"
integrity sha512-dIOxFfI0C+jz89g6lQ+TqhGgPQ0MxSnh/E4xuC0blhFtyW269+mPG5QeLgbdwst/LvdP8o1y0o/Gz5EHXLec/g==

"@types/body-parser@*":
version "1.19.0"
resolved "https://botbuilder.myget.org/F/botbuilder-v4-js-daily/npm/@types/body-parser/-/@types/body-parser-1.19.0.tgz#0685b3c47eb3006ffed117cdd55164b61f80538f"
integrity sha1-BoWzxH6zAG/+0RfN1VFkth+AU48=
dependencies:
"@types/connect" "*"
"@types/node" "*"

"@types/caseless@*":
version "0.12.2"
resolved "https://registry.yarnpkg.com/@types/caseless/-/caseless-0.12.2.tgz#f65d3d6389e01eeb458bd54dc8f52b95a9463bc8"
Expand All @@ -466,6 +475,32 @@
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==

"@types/connect@*":
version "3.4.33"
resolved "https://botbuilder.myget.org/F/botbuilder-v4-js-daily/npm/@types/connect/-/@types/connect-3.4.33.tgz#31610c901eca573b8713c3330abc6e6b9f588546"
integrity sha1-MWEMkB7KVzuHE8MzCrxua59YhUY=
dependencies:
"@types/node" "*"

"@types/express-serve-static-core@*":
version "4.17.13"
resolved "https://botbuilder.myget.org/F/botbuilder-v4-js-daily/npm/@types/express-serve-static-core/-/@types/express-serve-static-core-4.17.13.tgz#d9af025e925fc8b089be37423b8d1eac781be084"
integrity sha1-2a8CXpJfyLCJvjdCO40erHgb4IQ=
dependencies:
"@types/node" "*"
"@types/qs" "*"
"@types/range-parser" "*"

"@types/express@*":
version "4.17.8"
resolved "https://botbuilder.myget.org/F/botbuilder-v4-js-daily/npm/@types/express/-/@types/express-4.17.8.tgz#3df4293293317e61c60137d273a2e96cd8d5f27a"
integrity sha1-PfQpMpMxfmHGATfSc6LpbNjV8no=
dependencies:
"@types/body-parser" "*"
"@types/express-serve-static-core" "*"
"@types/qs" "*"
"@types/serve-static" "*"

"@types/fs-extra@8.1.0":
version "8.1.0"
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-8.1.0.tgz#1114834b53c3914806cd03b3304b37b3bd221a4d"
Expand All @@ -486,6 +521,11 @@
resolved "https://botbuilder.myget.org/F/botbuilder-v4-js-daily/npm/@types/lru-cache/-/@types/lru-cache-5.1.0.tgz#57f228f2b80c046b4a1bd5cac031f81f207f4f03"
integrity sha1-V/Io8rgMBGtKG9XKwDH4HyB/TwM=

"@types/mime@*":
version "2.0.3"
resolved "https://botbuilder.myget.org/F/botbuilder-v4-js-daily/npm/@types/mime/-/@types/mime-2.0.3.tgz#c893b73721db73699943bfc3653b1deb7faa4a3a"
integrity sha1-yJO3NyHbc2mZQ7/DZTsd63+qSjo=

"@types/minimatch@*":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
Expand Down Expand Up @@ -516,6 +556,23 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.61.tgz#d299136ce54bcaf1abaa4a487f9e4bedf6b0d393"
integrity sha512-l+zSbvT8TPRaCxL1l9cwHCb0tSqGAGcjPJFItGGYat5oCTiq1uQQKYg5m7AF1mgnEBzFXGLJ2LRmNjtreRX76Q==

"@types/passport@^1.0.3":
version "1.0.4"
resolved "https://botbuilder.myget.org/F/botbuilder-v4-js-daily/npm/@types/passport/-/@types/passport-1.0.4.tgz#1b35c4e197560d3974fa5f71711b6e9cce0711f0"
integrity sha1-GzXE4ZdWDTl0+l9xcRtunM4HEfA=
dependencies:
"@types/express" "*"

"@types/qs@*":
version "6.9.5"
resolved "https://botbuilder.myget.org/F/botbuilder-v4-js-daily/npm/@types/qs/-/@types/qs-6.9.5.tgz#434711bdd49eb5ee69d90c1d67c354a9a8ecb18b"
integrity sha1-Q0cRvdSete5p2QwdZ8NUqajssYs=

"@types/range-parser@*":
version "1.2.3"
resolved "https://botbuilder.myget.org/F/botbuilder-v4-js-daily/npm/@types/range-parser/-/@types/range-parser-1.2.3.tgz#7ee330ba7caafb98090bece86a5ee44115904c2c"
integrity sha1-fuMwunyq+5gJC+zoal7kQRWQTCw=

"@types/request-promise@4.1.45":
version "4.1.45"
resolved "https://registry.yarnpkg.com/@types/request-promise/-/request-promise-4.1.45.tgz#7fcdd39fd920674ab7bfb44197270f225fb4e585"
Expand Down Expand Up @@ -544,6 +601,14 @@
"@types/tough-cookie" "*"
form-data "^2.5.0"

"@types/serve-static@*":
version "1.13.6"
resolved "https://botbuilder.myget.org/F/botbuilder-v4-js-daily/npm/@types/serve-static/-/@types/serve-static-1.13.6.tgz#866b1b8dec41c36e28c7be40ac725b88be43c5c1"
integrity sha1-hmsbjexBw24ox75ArHJbiL5DxcE=
dependencies:
"@types/mime" "*"
"@types/node" "*"

"@types/sinon@^7.5.0":
version "7.5.2"
resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-7.5.2.tgz#5e2f1d120f07b9cda07e5dedd4f3bf8888fccdb9"
Expand Down Expand Up @@ -833,6 +898,11 @@ balanced-match@^1.0.0:
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=

base64-js@^1.0.2:
version "1.3.1"
resolved "https://botbuilder.myget.org/F/botbuilder-v4-js-daily/npm/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1"
integrity sha1-WOzoy3XdB+ce0IxzarxfrE2/jfE=

bcrypt-pbkdf@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e"
Expand Down Expand Up @@ -1585,6 +1655,11 @@ hyperlinker@^1.0.0:
resolved "https://registry.yarnpkg.com/hyperlinker/-/hyperlinker-1.0.0.tgz#23dc9e38a206b208ee49bc2d6c8ef47027df0c0e"
integrity sha512-Ty8UblRWFEcfSuIaajM34LdPXIhbs1ajEX/BBPv24J+enSVaEVY63xQ6lTO9VRYS5LAoghIG0IDJ+p+IPzKUQQ==

ieee754@^1.1.4:
version "1.1.13"
resolved "https://botbuilder.myget.org/F/botbuilder-v4-js-daily/npm/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84"
integrity sha1-7BaFWOlaoYH9h9N/VcMrvLZwi4Q=

ignore@^5.1.1, ignore@^5.1.4:
version "5.1.8"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57"
Expand Down
9 changes: 8 additions & 1 deletion extensions/runtimes/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,15 @@ export default async (composer: any): Promise<void> => {

// do the dotnet publish
try {
const configuration = JSON.parse(profile.configuration);
const runtimeIdentifier = configuration.runtimeIdentifier;
let buildCommand = `dotnet publish "${dotnetProjectPath}" -c release -o "${publishFolder}" -v q`;
if (runtimeIdentifier) {
// if runtime identifier set, make dotnet runtime to self contained, default runtime identifier is win-x64, please refer to https://docs.microsoft.com/en-us/dotnet/core/rid-catalog
buildCommand = `dotnet publish "${dotnetProjectPath}" -c release -o "${publishFolder}" -v q --self-contained true -r ${runtimeIdentifier}`;
}
const { stdout, stderr } = await execAsync(
`dotnet publish "${dotnetProjectPath}" -c release -o "${publishFolder}" -v q`,
buildCommand,
{
cwd: runtimePath,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ msRestNodeAuth
hostname: `${name}-${environment}`,
luisResource: `${name}-${environment}-luis`,
settings: createResult,
runtimeIdentifier: 'win-x64',
};

console.log(chalk.white(JSON.stringify(profile, null, 2)));
Expand Down