5
5
using System . Linq ;
6
6
using System . Runtime . CompilerServices ;
7
7
using Amazon . Common . DotNetCli . Tools ;
8
+ using Amazon . Common . DotNetCli . Tools . Options ;
8
9
using Amazon . ElasticBeanstalk . Model ;
9
10
using Amazon . ElasticBeanstalk . Tools . Commands ;
10
11
using ThirdParty . Json . LitJson ;
@@ -109,25 +110,23 @@ public static bool IsLoadBalancedEnvironmentType(string environmentType)
109
110
}
110
111
111
112
112
- public static void SetupPackageForLinux ( IToolLogger logger , EBBaseCommand command , DeployEnvironmentProperties options , string publishLocation , string reverseProxy , int ? applicationPort )
113
+ public static void SetupPackageForLinux ( IToolLogger logger , EBBaseCommand command , DeployEnvironmentProperties options , string publishLocation , string reverseProxy , int ? applicationPort , string projectLocation )
113
114
{
114
115
// Setup Procfile
115
116
var procfilePath = Path . Combine ( publishLocation , "Procfile" ) ;
116
117
117
- if ( File . Exists ( procfilePath ) )
118
+ if ( File . Exists ( procfilePath ) )
118
119
{
119
120
logger ? . WriteLine ( "Found existing Procfile file found and using that for deployment" ) ;
120
121
return ;
121
122
}
122
123
123
124
logger ? . WriteLine ( "Writing Procfile for deployment bundle" ) ;
124
-
125
- var runtimeConfigFilePath = Directory . GetFiles ( publishLocation , "*.runtimeconfig.json" ) . FirstOrDefault ( ) ;
126
- var runtimeConfigFileName = Path . GetFileName ( runtimeConfigFilePath ) ;
127
- var executingAssembly = runtimeConfigFileName . Substring ( 0 , runtimeConfigFileName . Length - "runtimeconfig.json" . Length - 1 ) ;
125
+ var executingAssembly = Utilities . LookupAssemblyNameFromProjectFile ( projectLocation , null ) ;
126
+ var runtimeConfigFilePath = Directory . GetFiles ( publishLocation , $ "{ executingAssembly } .runtimeconfig.json") . FirstOrDefault ( ) ;
128
127
129
128
string webCommandLine ;
130
- if ( IsSelfContainedPublish ( runtimeConfigFilePath ) )
129
+ if ( IsSelfContainedPublish ( runtimeConfigFilePath ) )
131
130
{
132
131
webCommandLine = $ "./{ executingAssembly } ";
133
132
}
@@ -136,7 +135,7 @@ public static void SetupPackageForLinux(IToolLogger logger, EBBaseCommand comman
136
135
webCommandLine = $ "dotnet exec ./{ executingAssembly } .dll";
137
136
}
138
137
139
- if ( string . Equals ( reverseProxy , EBConstants . PROXY_SERVER_NONE , StringComparison . InvariantCulture ) )
138
+ if ( string . Equals ( reverseProxy , EBConstants . PROXY_SERVER_NONE , StringComparison . InvariantCulture ) )
140
139
{
141
140
logger ? . WriteLine ( "... Proxy server disabled, configuring Kestrel to listen to traffic from all hosts" ) ;
142
141
var port = applicationPort . HasValue ? applicationPort . Value : EBConstants . DEFAULT_APPLICATION_PORT ;
0 commit comments