16 Commits

Author SHA1 Message Date
Samuele Locatelli 4068e72ead Merge branch 'release/DeleteOldPdf' 2023-10-20 12:07:16 +02:00
Samuele Locatelli 10e3004977 Update con cancellazione pdf oltre 6 mesi 2023-10-20 12:06:29 +02:00
Samuele Locatelli c30fc6033b Merge tag 'FixHttpsNexusUpload' into develop
Fix nexus upload http/https
2022-04-07 14:54:33 +02:00
Samuele Locatelli 33f9070c42 Merge branch 'release/FixHttpsNexusUpload' 2022-04-07 14:54:24 +02:00
Samuele Locatelli 8b31af034e Update http --> https x nexus PUT 2022-04-07 14:52:39 +02:00
Samuele Locatelli c09cc2dcfc Merge branch 'master' into develop 2022-04-07 13:00:23 +02:00
Samuele Locatelli ac70c48a2d refresh 2022-04-07 13:00:09 +02:00
Samuele Locatelli 531eb4d79a eliminazione dll inutili 2022-04-07 12:58:56 +02:00
Samuele Locatelli d1a12c5709 Update comportamento in stampa (gestione eccezioni e lettura dati file) 2022-04-07 12:58:44 +02:00
Samuele Locatelli c0a85b6dc3 Merge tag 'FixCICD' into develop
Fix CiCd x tag win su build machine
2021-09-02 12:57:57 +02:00
Samuele Locatelli 001c8dbb58 Merge branch 'release/FixCICD' 2021-09-02 12:57:36 +02:00
Samuele Locatelli 3e9d703c48 fix gitlab build 2021-09-02 12:57:02 +02:00
Samuele Locatelli 37858a857e fix nuget download passwd 2021-04-16 08:51:31 +02:00
Samuele Locatelli 9d23f67dba Merge branch 'master' into develop 2021-04-16 08:48:36 +02:00
Samuele Locatelli b79ac951e2 Aggiunta variabile hidden x pwd 2021-04-16 08:48:22 +02:00
Samuele Locatelli b61d1852a1 rimozione backup e old file jenkins (non + usato) da rimuovere in futuro 2021-04-16 08:40:45 +02:00
10 changed files with 66 additions and 84 deletions
+9 -9
View File
@@ -15,9 +15,9 @@ variables:
- |
$hasSource = C:\Tools\nuget.exe sources list | find "`"Steamware Nexus`"" /C
if ($hasSource -eq 0) {
C:\Tools\nuget.exe sources Add -Name "`"Steamware Nexus`"" -Source http://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
C:\Tools\nuget.exe sources Add -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"$NEXUS_PASSWD`""
} else {
C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source http://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"$NEXUS_PASSWD`""
}
echo $hasSource
@@ -79,9 +79,9 @@ variables:
$version = "unstable"
}
$File2Send = "Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
mCurl -v -u GitLab:viaDante16 --upload-file $File2Send http://nexus.steamware.net/repository/utility/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip
mCurl -v -u GitLab:viaDante16 --upload-file $File2Send".md5" http://nexus.steamware.net/repository/utility/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip".md5"
mCurl -v -u GitLab:viaDante16 --upload-file $File2Send".sha1" http://nexus.steamware.net/repository/utility/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip".sha1"
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File2Send https://nexus.steamware.net/repository/utility/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File2Send".md5" https://nexus.steamware.net/repository/utility/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip".md5"
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File2Send".sha1" https://nexus.steamware.net/repository/utility/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip".sha1"
# mCurl -v -u $env:NEXUS_USER:$env:NEXUS_PASSWD --upload-file bin/release/$env:APP_NAME.zip $env:NEXUS_SERVER/utility/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip
@@ -92,8 +92,8 @@ stages:
build_job:
stage: build
# rules:
# - if: '$CI_COMMIT_BRANCH == "develop"'
tags:
- win
before_script:
- *nuget-fix
- '& "$env:NUGET_PATH" restore LPA.sln' # path alla solution corrente
@@ -103,8 +103,8 @@ build_job:
deploy_job:
stage: deploy
# rules:
# - if: '$CI_COMMIT_BRANCH == "master"'
tags:
- win
before_script:
- *nuget-fix
- '& "$env:NUGET_PATH" restore LPA.sln' # path alla solution corrente
-56
View File
@@ -1,56 +0,0 @@
# This file is a template, and might need editing before it works on your project.
# The following script will work for any project that can be built from command line by msbuild
# It uses powershell shell executor, so you need to add the following line to your config.toml file
# (located in gitlab-runner.exe directory):
# shell = "powershell"
#
# The script is composed of 3 stages: build, test and deploy.
#
# The build stage restores NuGet packages and uses msbuild to build the exe and msi
# One major issue you'll find is that you can't build msi projects from command line
# if you use vdproj. There are workarounds building msi via devenv, but they rarely work
# The best solution is migrating your vdproj projects to WiX, as it can be build directly
# by msbuild.
#
# The test stage runs nunit from command line against Test project inside your solution
# It also saves the resulting TestResult.xml file
#
# The deploy stage copies the exe and msi from build stage to a network drive
# You need to have the network drive mapped as Local System user for gitlab-runner service to see it
# The best way to persist the mapping is via a scheduled task (see: https://stackoverflow.com/a/7867064/1288473),
# running the following batch command: net use P: \\x.x.x.x\Projects /u:your_user your_pass /persistent:yes
# place project specific paths in variables to make the rest of the script more generic
variables:
EXE_RELEASE_FOLDER: 'C:\Testb\bin\Release'
MSI_RELEASE_FOLDER: 'C:\Testb\Setup\bin\Release'
TEST_FOLDER: 'C:\Testb\Tests\bin\Release'
#DEPLOY_FOLDER: 'P:\Projects\YourApp\Builds'
NUGET_PATH: 'C:\Tools\NuGet\nuget.exe'
#MSBUILD_PATH: 'C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe'
MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\msbuild.exe'
#NUNIT_PATH: 'C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe'
stages:
- build
#- test
#- deploy
build_job:
stage: build
only:
- master # the build process will only be started by git tag commits
tags:
- msbuild
script:
- '& "$env:NUGET_PATH" restore' # restore Nuget dependencies
- '& "$env:MSBUILD_PATH" LPA/LPA.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m' # build the project
artifacts:
expire_in: 1 week # save gitlab server space, we copy the files we need to deploy folder later on
paths:
- '$env:EXE_RELEASE_FOLDER\LPA.exe' # saving exe to copy to deploy folder
- '$env:MSI_RELEASE_FOLDER\LPA.msi' # saving msi to copy to deploy folder
#- '$env:TEST_FOLDER\' # saving entire Test project so NUnit can run tests
+6 -4
View File
@@ -5,10 +5,12 @@
</startup>
<appSettings>
<add key="appName" value="LPA" />
<add key="serverBaseAddr" value="http://iis01/MP/MAG/" />
<add key="serverIp" value="iis01" />
<!--<add key="serverBaseAddr" value="http://iis02/NKC/" />
<add key="serverIp" value="iis02" />-->
<!--<add key="serverBaseAddr" value="http://iis01/MP/MAG/" />
<add key="serverIp" value="iis01" />-->
<add key="serverBaseAddr" value="http://iis01.egalware.com/NKC/" />
<add key="serverIp" value="iis01.egalware.com" />
<!--<add key="serverBaseAddr" value="http://iis02.egalware.com/NKC/" />
<add key="serverIp" value="iis02.egalware.com" />-->
<add key="localReportPath" value="reports" />
<add key="localPdfPath" value="pdf" />
<add key="_logDir" value="/logs/" />
-2
View File
@@ -312,8 +312,6 @@
<Content Include="Core\Compression\Snappy\lib\win\snappy64.dll" />
<Content Include="Core\Compression\Zstandard\lib\win\libzstd.dll" />
<Content Include="Resources\SteamWare.ico" />
<Content Include="snappy32.dll" />
<Content Include="snappy64.dll" />
<Content Include="SqlServerTypes\readme.htm" />
<Content Include="SqlServerTypes\x64\msvcr120.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+12 -4
View File
@@ -642,11 +642,19 @@ namespace LPA
{
// parto da template base
template = item.template;
// cerco nel dato da singolo item
var templateConf = reportConf.Find(conf => conf.name == item.template);
if (reportConf != null)
//se non c'è uso quello della coda...
if (string.IsNullOrEmpty(template))
{
template = templateConf.template;
template = confCoda.template;
}
else
{
// cerco nel dato da singolo item
var templateConf = reportConf.Find(conf => conf.name == item.template);
if (reportConf != null)
{
template = templateConf.template;
}
}
// stampo
fatto = rPrint.printReport(template, localReportPath, coda.Value.Printer, item.rdsData, confCoda.deviceInfoParam, true);
+1 -1
View File
@@ -1,4 +1,4 @@
{
"serverIp": "iis01",
"serverBaseAddr": "http://iis01/MP/MAG/"
"serverBaseAddr": "http://iis01/NKC/"
}
+38 -8
View File
@@ -95,8 +95,10 @@ namespace LPA
string dailyDir = $"{baseDir}{localPdfPath}\\{adesso:yyyy}\\{adesso:MM}\\{adesso:dd}\\";
string pdfPathName = $"{dailyDir}\\{name}_{adesso:HHmmss}_{adesso:ffff}.{fileNameExtension}";
// creo Directory se non c'è
fileMover fm = new fileMover(dailyDir, "");
fm.checkDir();
if (!Directory.Exists(dailyDir))
{
Directory.CreateDirectory(dailyDir);
}
Stream stream = new FileStream(pdfPathName, FileMode.Create);
m_streams.Add(stream);
return stream;
@@ -299,16 +301,17 @@ namespace LPA
}
// ottengo elenco files *.emf
fileMover.obj.setDirectory(currPath);
FileInfo[] _fis = fileMover.obj.elencoFiles_FI("*.EMF");
var _fis = Directory.GetFiles(currPath, "*.EMF");
bool fatto = false;
foreach (FileInfo _file in _fis)
foreach (var _fileName in _fis)
{
if (_file.CreationTime < DateTime.Now.AddMinutes(-maxAgeMinutes)) // elimino files vecchi...
FileInfo file = new FileInfo(_fileName);
if (file.CreationTime < DateTime.Now.AddMinutes(-maxAgeMinutes)) // elimino files vecchi...
{
fatto = fileMover.obj.eliminaFile(_file);
fatto = fileMover.obj.eliminaFile(file);
if (fatto)
{
Log.Instance.Info($"Eliminato file {_file.Name}");
Log.Instance.Info($"Eliminato file {file.Name}");
eliminati++;
}
}
@@ -316,7 +319,34 @@ namespace LPA
// salvo il log degli update
if (eliminati > 0)
{
Log.Instance.Info($"Eliminati {eliminati} files temporanei da area temp");
Log.Instance.Info($"Eliminati {eliminati} files EMF temporanei da area temp");
}
// verifica file pdf vecchi (oltre 5 mesi...)
currPath = $"{baseDir}{localPdfPath}";
eliminati = 0;
// ottengo elenco files *.emf
fileMover.obj.setDirectory(currPath);
_fis = Directory.GetFiles(currPath, "*.pdf", SearchOption.AllDirectories);
fatto = false;
foreach (var _fileName in _fis)
{
FileInfo file = new FileInfo(_fileName);
if (file.CreationTime < DateTime.Now.AddMonths(-5)) // elimino files vecchi...
{
fatto = fileMover.obj.eliminaFile(file);
if (fatto)
{
Log.Instance.Info($"Eliminato file {file.Name}");
eliminati++;
}
}
}
// salvo il log degli update
if (eliminati > 0)
{
Log.Instance.Info($"Eliminati {eliminati} files EMF temporanei da area temp");
}
}
catch (Exception exc)
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
View File