Add try and update path + version in publish profile
This commit is contained in:
parent
c9269aaf3a
commit
69e86bfa26
@ -303,7 +303,7 @@ namespace ManagerService.Controllers
|
|||||||
#if RELEASE
|
#if RELEASE
|
||||||
Console.WriteLine($"currentDirectory: {Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}");
|
Console.WriteLine($"currentDirectory: {Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}");
|
||||||
//currentDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "service-data");
|
//currentDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "service-data");
|
||||||
currentDirectory = Path.Combine("home", "debian", "service-data");
|
currentDirectory = Path.Combine("/home", "debian", "service-data");
|
||||||
System.IO.Directory.CreateDirectory(currentDirectory.ToString());
|
System.IO.Directory.CreateDirectory(currentDirectory.ToString());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -540,14 +540,23 @@ namespace ManagerService.Controllers
|
|||||||
|
|
||||||
private void createFile(String fileName, byte[] fileBytes)
|
private void createFile(String fileName, byte[] fileBytes)
|
||||||
{
|
{
|
||||||
using (FileStream fs = System.IO.File.Create(fileName))
|
try
|
||||||
{
|
{
|
||||||
Console.WriteLine($"Try to create file at : {fileName}");
|
using (FileStream fs = System.IO.File.Create(fileName))
|
||||||
|
{
|
||||||
|
|
||||||
|
Console.WriteLine($"Try to create file at : {fileName}");
|
||||||
|
|
||||||
// Add some information to the file.
|
// Add some information to the file.
|
||||||
fs.Write(fileBytes, 0, fileBytes.Length);
|
fs.Write(fileBytes, 0, fileBytes.Length);
|
||||||
|
|
||||||
Console.WriteLine($"Created file: {fileName}");
|
Console.WriteLine($"Created file: {fileName}");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"An error occured during file creation: {fileName} - {ex.Message}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ by editing this MSBuild file. In order to learn more about this please visit htt
|
|||||||
<DockerPublish>true</DockerPublish>
|
<DockerPublish>true</DockerPublish>
|
||||||
<RegistryUrl>https://registry.unov.be</RegistryUrl>
|
<RegistryUrl>https://registry.unov.be</RegistryUrl>
|
||||||
<UserName>admin</UserName>
|
<UserName>admin</UserName>
|
||||||
<PublishImageTag>latest</PublishImageTag>
|
<PublishImageTag>version_1_0</PublishImageTag>
|
||||||
<PublishProvider>ContainerRegistry</PublishProvider>
|
<PublishProvider>ContainerRegistry</PublishProvider>
|
||||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user