Merge branch 'release/IobWinWps_02'

This commit is contained in:
Samuele Locatelli
2025-01-08 14:38:29 +01:00
17 changed files with 42 additions and 1365 deletions
+1 -1
View File
@@ -1077,7 +1077,7 @@
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "AdapterForm";
this.Text = "IOB-WIN-NEXT";
this.Text = "IOB-WIN-FORM";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
this.Shown += new System.EventHandler(this.MainForm_Shown);
this.Resize += new System.EventHandler(this.MainForm_Resize);
+2 -2
View File
@@ -257,7 +257,7 @@
// notifyIcon1
//
this.notifyIcon1.ContextMenuStrip = this.trayMenu;
this.notifyIcon1.Text = "IOB-WIN-NEXT";
this.notifyIcon1.Text = "IOB-WIN-FORM";
this.notifyIcon1.Visible = true;
this.notifyIcon1.DoubleClick += new System.EventHandler(this.notifyIcon1_DoubleClick);
//
@@ -280,7 +280,7 @@
this.MainMenuStrip = this.menuStrip1;
this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "MainForm";
this.Text = "IOB WIN 2025";
this.Text = "IOB WIN MAIN FORM";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
this.Shown += new System.EventHandler(this.MainForm_Shown);
this.Resize += new System.EventHandler(this.MainForm_Resize);
+9 -4
View File
@@ -494,6 +494,11 @@ namespace IOB_WIN_FORM
}
}
/// <summary>
/// Nome applicazione (da app.config)
/// </summary>
private string nomeApp = "";
protected void myInit()
{
DateTime adesso = DateTime.Now;
@@ -503,7 +508,7 @@ namespace IOB_WIN_FORM
lblStatus.Text = "Loading";
// fix versione e nome APP!
string nomeApp = $"{ConfigurationManager.AppSettings.Get("appName")}";
nomeApp = $"{ConfigurationManager.AppSettings.Get("appName")}";
string versione = $" v.{System.Reflection.Assembly.GetExecutingAssembly().GetName().Version}";
// fix icon!
@@ -577,7 +582,7 @@ namespace IOB_WIN_FORM
}
catch (Exception exc)
{
lgError(string.Format("MainForm myInit EXCEPTION in fase di chiamata URL di reboot:{0}{1}{2}", urlReboot, Environment.NewLine, exc));
lgError($"MainForm myInit EXCEPTION in fase di chiamata URL di reboot:{urlReboot}{Environment.NewLine}{exc}");
}
displayTaskAndLog("Main Form OK");
}
@@ -832,12 +837,12 @@ namespace IOB_WIN_FORM
// SE permessa massimizzazione...
if (utils.CRB("windowCanMax"))
{
trayMenu.Items.Add("Show IOB-WIN-NEXT");
trayMenu.Items.Add($"Show {nomeApp} App");
}
// se è permesso tray close...
if (utils.CRB("trayClose"))
{
trayMenu.Items.Add("Close IOB-WIN-NEXT");
trayMenu.Items.Add($"Close {nomeApp} App");
}
}
+17
View File
@@ -34,6 +34,15 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote_DEBUG|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Remote_DEBUG\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="MapoSDK, Version=6.14.2411.518, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MapoSDK.6.14.2411.518\lib\MapoSDK.dll</HintPath>
@@ -124,13 +133,20 @@
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<Content Include="NLog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include=".editorconfig" />
<None Include="App.Debug.config">
<DependentUpon>App.config</DependentUpon>
<IsTransformFile>True</IsTransformFile>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="App.Release.config">
<DependentUpon>App.config</DependentUpon>
<IsTransformFile>True</IsTransformFile>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\IOB.ini">
@@ -191,6 +207,7 @@
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
<TransformOnBuild>true</TransformOnBuild>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
+2 -2
View File
@@ -1,6 +1,6 @@
# IOB-WIN-NEXT
# IOB-WIN-PING
Documentazione relativa all'applicativo IOB-WIN-NEXT
Documentazione relativa all'applicativo IOB-WIN-PING
## Articles
Binary file not shown.
-1
View File
@@ -1 +0,0 @@

-959
View File
@@ -1,959 +0,0 @@
;------------------------------------------------------------------------------------
; filevalori simulati x provare sistema dati e filtraggio... commenti iniziano per ';', valori formato data#valore#counter
; NOTE FILE:
; - bit come macchine std IOB
; B0 = POWERON
; B1 = RUN
; B2 = CONTAPEZZO
; B3 = ALLARME
; B4 = MANUALE
; B5 = NA
; B6 = NA
; B7 = NA
; - segnali alternanti su 00011100
;------------------------------------------------------------------------------------
;
;----------------------------
; inizio da spenta
0
0
; indico accesa
1
1
1
; allarme (BLINK)
9
9
9
9
9
1
1
1
1
1
1
9
9
9
9
9
1
1
1
1
1
19
9
9
9
9
1
1
1
1
1
1
; allarme manuale (2 blink, periodo diverso)
25
25
17
17
9
9
1
1
25
25
17
17
9
9
1
1
25
25
17
17
9
9
1
1
25
25
17
17
9
9
1
1
25
25
17
17
9
9
1
1
; indico manuale
17
17
17
17
17
17
17
17
17
17
1
1
1
1
1
1
1
1
17
17
17
17
17
17
17
17
17
17
1
1
1
1
1
1
1
1
17
17
17
17
17
17
17
17
17
17
1
1
1
1
1
1
1
1
; RUN!
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
; contapezzo
7
7
7
7
7
3
3
3
3
3
3
7
7
7
7
7
3
3
3
3
3
3
7
7
7
7
7
3
3
3
3
3
3
7
7
7
7
7
3
3
3
3
3
3
; RUN
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
; contapezzo
7
7
7
7
7
3
3
3
3
3
3
7
7
7
7
7
3
3
3
3
3
3
7
7
7
7
7
3
3
3
3
3
3
7
7
7
7
7
3
3
3
3
3
3
; RUN
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
; contapezzo
7
7
7
7
7
3
3
3
3
3
3
7
7
7
7
7
3
3
3
3
3
3
7
7
7
7
7
3
3
3
3
3
3
7
7
7
7
7
3
3
3
3
3
3
; RUN
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
; allarme (BLINK)
9
9
9
9
9
1
1
1
1
1
1
9
9
9
9
9
1
1
1
1
1
19
9
9
9
9
1
1
1
1
1
1
; allarme manuale (2 blink, periodo diverso)
25
25
17
17
9
9
1
1
25
25
17
17
9
9
1
1
25
25
17
17
9
9
1
1
25
25
17
17
9
9
1
1
25
25
17
17
9
9
1
1
; indico manuale
17
17
17
17
17
17
17
17
17
17
1
1
1
1
1
1
1
1
17
17
17
17
17
17
17
17
17
17
1
1
1
1
1
1
1
1
17
17
17
17
17
17
17
17
17
17
1
1
1
1
1
1
1
1
; RUN!
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
; contapezzo
7
7
7
7
7
3
3
3
3
3
3
7
7
7
7
7
3
3
3
3
3
3
7
7
7
7
7
3
3
3
3
3
3
7
7
7
7
7
3
3
3
3
3
3
; RUN
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
; contapezzo
7
7
7
7
7
3
3
3
3
3
3
7
7
7
7
7
3
3
3
3
3
3
7
7
7
7
7
3
3
3
3
3
3
7
7
7
7
7
3
3
3
3
3
3
; RUN
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
+4 -59
View File
@@ -11,25 +11,9 @@
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<IsWebBootstrapper>false</IsWebBootstrapper>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x86</PlatformTarget>
@@ -40,7 +24,6 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -50,27 +33,6 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote_DEBUG|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
@@ -81,16 +43,6 @@
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote_DEBUG|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Remote_DEBUG\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="MapoSDK, Version=6.14.2411.518, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MapoSDK.6.14.2411.518\lib\MapoSDK.dll</HintPath>
@@ -156,7 +108,6 @@
<Content Include="logs\.placeholder.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Readme\ToDo.txt" />
<Content Include="Resources\ChangeLog.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
@@ -189,12 +140,12 @@
</Content>
<None Include=".editorconfig" />
<None Include="App.Debug.config">
<DependentUpon>app.config</DependentUpon>
<DependentUpon>App.config</DependentUpon>
<IsTransformFile>True</IsTransformFile>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="App.Release.config">
<DependentUpon>app.config</DependentUpon>
<DependentUpon>App.config</DependentUpon>
<IsTransformFile>True</IsTransformFile>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
@@ -227,12 +178,6 @@
<None Include="DATA\CONF\WPS.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\DAT\PersistData.dat">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\DAT\SimData.dat">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<Content Include="Resources\Start-IOB-WIN.bat">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
@@ -253,7 +198,7 @@
<None Include="setupTgt.bat" />
</ItemGroup>
<ItemGroup>
<None Include="app.config">
<None Include="App.config">
<SubType>Designer</SubType>
<TransformOnBuild>true</TransformOnBuild>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+1
View File
@@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Markup;
namespace IOB_WIN_WPS
{
+3 -3
View File
@@ -5,10 +5,10 @@ using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
// set di attributi. Modificare i valori di questi attributi per modificare le informazioni
// associate a un assembly.
[assembly: AssemblyTitle("IOB-WIN-NEXT")]
[assembly: AssemblyTitle("IOB-WIN-WPS")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("IOB-WIN-NEXT")]
[assembly: AssemblyProduct("IOB-WIN-WPS")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -18,5 +18,5 @@ using System.Runtime.InteropServices;
[assembly: ComVisible(false)]
// Se il progetto viene esposto a COM, il GUID seguente verrà utilizzato come ID della libreria dei tipi
[assembly: Guid("adcb8028-79c4-4896-a9a7-e3c5140fc00b")]
[assembly: Guid("1636aeb4-9932-48fd-88b4-001133c38ff7")]
-61
View File
@@ -1,61 +0,0 @@
-------------------------------------
- 2017.10.19
-------------------------------------
OK - da testare ora invio URL a MoonPro
OK - ALIVE
OK - ENABLED
OK - INPUT
OK - FARE lettura VERA da FANUC almeno della bitmap
OK - fare gestione come rPI-IOB, ovvero
OK - gestione QUEUE eventi
OK - salvataggio su file dello storico eventi rilevati
OK - gestione dei segnali ballerini (BITMASK!)
OK - gestione contapezzi CUSTOM
- fare gestione configurabile lettura FANUC
OK - gestione dati G43
OK - togliere dati F (E0 | 90)
- fare integrazione ALTRI varori FANUC, tra cui
- allarmi
OK - load/speed
OK - overrides (G12, G30)
OK - nuovo metodo chiamata x MP/IO (che dovrà avere nuovo comando x accettare queste chiamate e salvare su tabella SENZA processing, come eventi o come extra... evento NOTA?)
- verificare segnali: (vedi doc gsheet)
- F001.0: ALARM_PRESENT
- F001.7: CN_READY / POWER_ON
- STL000.5: AUTO (vers 1)
- STL000.7: AUTO (vers 2)
- Cambiare ordine valutazione eventi frequenza VLF-->VHF
- Azzerare I contatori quanto si arriva al più lento (quando si azzera lui ripartono comunque tutti...) -> in questo modo scatta un contatore QUANDO GENERAL_COUNTER MOD periodo_Ccntatore == 0
- rendere parametrica l'assegnazione delle funzioni al diverso ambito frequenza tra i 5 (VHF, HF, NF, LF, VLF)
- procedura x gestione dati REALTIME (da NON salvare su db ma al limite su REDIS, simil EQN con 2 tab x eliminare dati scaduti)
OK FINIRE SISTEMAZIONE JETCO:
OK - install servers
OK - install DB
OK - conf acquisitore togliendo parti abbozzate x contapezzi/fineciclo
OK - part program name MAIN con nuova funzione
CREARE NUOVO SW (o configurazione? o ramo alternativo a develop?) x mapping INIZIALE della macchina... ad esempio
- si collega a ns server
- chiede cosa deve fare (es mappa memorie D da 0 a 9999)
- effettua testing e poi fa upload risultati
- il ns sw fa i check/controlli modifica
in questo modo ad esmepio possiamo cercare i contapezzi, i segnali ceh cambiano con il fineciclo nelle aree Y, i contatori STANDARD nelle memorie D, ...
GESTIONE LIVE DATA
L'idea è ceh quando una macchina è "sotto osservazione" ovvero live viene aperta pagina questa debba inviare PIU' DATI di tipo realtime e mostrarli nel browser. Per farlo ci saranno questi elementi
- si apre una pagina di dettaglio macchina (da tablet? da SITE principale?)
- questo causa la modifica di una chiave su DB (e/o redis) di stato macchina, del tipo "OnAir=true", e potrebbe essere una chiave a tempo (30 sec poi scade?) e mentre la pagina è aperta e si aggiorna (ogni 1-2 sec oppure Signal-R) questo valore viene confermato (e prorigato)
- ogni IOB-WIN fa una chiamata "extra" all'URL dedicato al checl "OnAir", e se trova che è abilitato passa in modalità letture frequenti (1/2 al sec?) dei parametri LIVE (es: feed, speed, posizioni assi, load istantanei)
- se passa inq eusta modalità live invia DI CONTINUO il dato al server IO
- il server IO salva SU REDIS questi valori sia come "lastVal" che come serie storica
- le pagine che mostrano i dati si continuano ad aggiornare (da redis) con grafici (chartJs come PIC) e/o valori istantanei
- le serie storiche vengono ripulite periodicamente (ogni ora? valori + vecchi di 24h ad esempio?)
- struttura dati REDIS da creare SIMILE a struttura info URL...
- struttura dati LIVE: ../LIVE/COD_MACC/CURR_VAL (contiene TUTTI i dati LIVE, ultimi ricevuti...)
- struttura dati TimeSeries: ../LIVE/COD_MACC/DATA_NAME (contiene TUTTI i dati come timeseries, es SPEEDRATE, FEEDRATE, POS_X1, POS_X2, ...)
- operazione SAVE aggiorna SURR e accoda NUOVO valore...
- LOAD (rilettura9 POTREBBE fare pulizia se + vecchi di 24h...)
- la trasmissione verso IO deve avvenire con "multisend, nel
+1 -1
View File
@@ -1,4 +1,4 @@
# Logica di funzionamento IOB-WIN-NEXT:
# Logica di funzionamento IOB-WIN-WPS:
L'applicativo si occupa di dialogare con i diversi PLC/CNC utyilizzando diverse librerie di funzionamento, tra proprietarie (focas, s7net, OSAI...) che pubbliche (ModBus, MTConnet, OPC-UA).
Binary file not shown.
+2 -2
View File
@@ -1,6 +1,6 @@
# IOB-WIN-NEXT
# IOB-WIN-WPS
Documentazione relativa all'applicativo IOB-WIN-NEXT
Documentazione relativa all'applicativo IOB-WIN-WPS
## Articles
Binary file not shown.
Vendored
-270
View File
@@ -1,270 +0,0 @@
pipeline {
agent none
environment {
EMAIL_RECIPIENTS = 'samuele@steamware.net'
}
stages {
stage('Checkout') {
agent any
steps {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
env.versionNumber = VersionNumber(versionNumberString : '3.5.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILD_DATE_FORMATTED, "ddHH"}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
env.APP_NAME = 'MAPO-IOB-WIN'
}
script {
currentBuild.displayName = "${env.versionNumber}"
if (env.BRANCH_NAME == "master") {
currentBuild.description = "BUILD ${env.versionNumber}"
}
else {
currentBuild.description = "TEST ${env.versionNumber}"
}
}
/* CAMBIO numero versione in file sorgente!!! */
bat "e:\\fart.exe VersGen\\VersGen.cs 0.0.0.0 ${env.versionNumber} || EXIT /B 0"
}
}
stage('Build') {
agent any
steps {
// fix vers numb + pacchetti nuget
script {
// CAMBIO numero versione in file sorgente!!!
bat "e:\\fart.exe VersGen\\VersGen.cs 0.0.0.0 ${env.versionNumber} || EXIT /B 0"
// checkout NuGet in file sorgente!!!
fixNuget("${WORKSPACE}\\IOB-MAN.sln")
fixNuget("${WORKSPACE}\\IOB-WIN-NEXT.sln")
}
script {
if (env.BRANCH_NAME == "develop") {
parallel (
IOB_WIN: {
// BUILD!
bat "\"${tool 'MSBuild-16.0'}\" IOB-MAN/IOB-MAN.csproj -target:Build /p:Configuration=Release /p:Platform=\"x86\" /p:OutputPath=bin/ /verbosity:minimal /m"
bat "\"${tool 'MSBuild-16.0'}\" IOB-WIN-NEXT/IOB-WIN-NEXT.csproj -target:Build /p:Configuration=Release /p:Platform=\"x86\" /p:OutputPath=bin/ /verbosity:minimal /m"
},
// IOB_MAN: {
// // BUILD!
// bat "\"${tool 'MSBuild-16.0'}\" IOB-MAN/IOB-MAN.csproj -target:Build /p:Configuration=Release /p:Platform=\"x86\" /p:OutputPath=bin/ /verbosity:minimal /m"
// },
failFast: false
)
}
else {
echo 'NON faccio test di Build se non per BRANCH develop'
}
}
}
}
stage('Test') {
steps {
echo 'Testing.. 2 be done...'
}
}
stage('Deploy') {
agent any
steps {
// fix vers numb + pacchetti nuget
script {
// CAMBIO numero versione in file sorgente!!!
bat "e:\\fart.exe VersGen\\VersGen.cs 0.0.0.0 ${env.versionNumber} || EXIT /B 0"
// checkout NuGet in file sorgente!!!
fixNuget("${WORKSPACE}\\IOB-MAN.sln")
fixNuget("${WORKSPACE}\\IOB-WIN-NEXT.sln")
}
// a seconda del branch decido cosa e come compilare e caricare...
script {
if(env.BRANCH_NAME == "IobMan") {
// BUILD!
bat "\"${tool 'MSBuild-16.0'}\" IOB-MAN/IOB-MAN.csproj -target:Build /p:Configuration=Release /p:Platform=\"x86\" /p:OutputPath=bin/ /verbosity:minimal /m"
}
// procedo solo se NON si tratta di commit in ramo DOCUMentazione...
else if (env.BRANCH_NAME == "develop" || env.BRANCH_NAME.contains("master") ) {
// BUILD!
bat "\"${tool 'MSBuild-16.0'}\" IOB-MAN/IOB-MAN.csproj -target:Build /p:Configuration=Release /p:Platform=\"x86\" /p:OutputPath=bin/ /verbosity:minimal /m"
bat "\"${tool 'MSBuild-16.0'}\" IOB-WIN-NEXT/IOB-WIN-NEXT.csproj -target:Build /p:Configuration=Release /p:Platform=\"x86\" /p:OutputPath=bin/ /verbosity:minimal /m"
}
else
{
echo 'Nessun Deploy necessario'
}
}
// ora mi occupo delle operazioni di compressione e copia...
script {
// // se è ramo IobMan compilo SOLO IOB-MAN...
// if(env.BRANCH_NAME == "IobMan") {
// env.classifier = ""
// // rimuovo vecchio zip...
// bat "del /f ${WORKSPACE}\\Releases\\${env.BRANCH_NAME}\\*.zip || EXIT /B 0"
// // Compressione in .zip dell'installer...
// bat "e:\\7za.exe a -tzip ${WORKSPACE}\\Releases\\${env.BRANCH_NAME}\\MAPO-IOB-MAN.zip ${WORKSPACE}\\IOB-MAN\\bin\\*"
// // ora mi occupo delle operazioni di invio a NEXUS...
// nexusArtifactUploader(
// nexusVersion: 'nexus3',
// protocol: 'https',
// nexusUrl: 'nexus.steamware.net',
// groupId: 'MAPO',
// //version: "${env.versionNumber}",
// version: "stable",
// repository: 'utility',
// credentialsId: 'bc9d8e92-4302-3266-817f-7b58501d12d5',
// artifacts: [
// [artifactId: 'IOB-MAN',
// classifier: "${env.classifier}",
// file: "Releases\\${env.BRANCH_NAME}\\MAPO-IOB-MAN.zip",
// type: 'zip']
// ]
// )
// }
// ...
// else if (env.BRANCH_NAME == "develop" || env.BRANCH_NAME.contains("master") || env.BRANCH_NAME.contains("feature") ) {
if (env.BRANCH_NAME == "develop" || env.BRANCH_NAME.contains("master") ) {
fixResources("IOB-MAN")
fixResources("IOB-WIN-NEXT")
// elimino vecchio zip...
bat "RD /S /Q Releases\\${env.BRANCH_NAME}\\ || EXIT /B 0"
compressZip("IOB-MAN")
compressZip("IOB-WIN-NEXT")
// fix classificazione x develop/master...
if (env.BRANCH_NAME == "develop")
{
// env.classifier = "unstable"
env.version = "unstable"
}
else
{
// env.classifier = ""
env.version = "stable"
}
// ora mi occupo delle operazioni di invio a NEXUS...
nexusArtifactUploader(
nexusVersion: 'nexus3',
protocol: 'https',
nexusUrl: 'nexus.steamware.net',
groupId: 'MAPO',
//version: "${env.versionNumber}",
version: "${env.version}",
repository: 'utility',
credentialsId: 'bc9d8e92-4302-3266-817f-7b58501d12d5',
artifacts: [
// [artifactId: 'IOB-WIN',
// classifier: "",
// // classifier: "${env.classifier}",
// file: "Releases\\${env.BRANCH_NAME}\\MAPO-IOB-WIN.zip",
// type: 'zip'],
[artifactId: 'IOB-MAN',
classifier: "${env.classifier}",
file: "Releases\\${env.BRANCH_NAME}\\MAPO-IOB-MAN.zip",
type: 'zip'],
[artifactId: 'IOB-WIN-NEXT',
classifier: "",
// classifier: "${env.classifier}",
file: "Releases\\${env.BRANCH_NAME}\\MAPO-IOB-WIN-NEXT.zip",
type: 'zip']
]
)
}
else
{
echo 'Nessuna compressione+copia post deploy'
}
}
}
}
}
post {
success {
sendSlack("Successful", "good")
}
failure {
sendSlack("Failed", "danger")
}
unstable {
sendSlack("Unstable", "warning")
}
}
}
@NonCPS
def getChangeString() {
MAX_MSG_LEN = 100
def changeString = ""
echo "Gathering SCM changes"
def changeLogSets = currentBuild.changeSets
for (int i = 0; i < changeLogSets.size(); i++) {
def entries = changeLogSets[i].items
for (int j = 0; j < entries.length; j++) {
def entry = entries[j]
truncated_msg = entry.msg.take(MAX_MSG_LEN)
changeString += " - ${truncated_msg} [${entry.author}]\n"
}
}
if (!changeString) {
changeString = " - Nessuna Modifica"
}
return changeString
}
def fixResources(basePath){
echo "Start fixResources for ${basePath}"
def now = new Date()
def anno = now.format("yyyy", TimeZone.getTimeZone('UTC'))
// elimino files conf personalizzata per ogni install...
bat "RD /S /Q ${basePath}\\bin\\DATA || EXIT /B 0"
// manifest.xml: aggiorno versNumber ed URL del branch di update...
bat "e:\\fart.exe ${basePath}\\Resources\\manifest.xml 0.0.0.0 ${env.versionNumber} || EXIT /B 0"
bat "e:\\fart.exe ${basePath}\\Resources\\manifest.xml {{BRANCHNAME}} ${env.BRANCH_NAME} || EXIT /B 0"
bat "e:\\fart.exe ${basePath}\\Resources\\ChangeLog.html {{CURRENT-REL}} ${env.versionNumber} || EXIT /B 0"
bat "e:\\fart.exe ${basePath}\\Resources\\ChangeLog.html {{CURR-YEAR}} ${anno} || EXIT /B 0"
// // copio ed esporto in IIS02 i vari files .xml, .html, .zip
// powershell "(Get-Content ${basePath}\\Resources\\ChangeLog.html) | ForEach-Object { $_ -replace \"{{LAST-CHANGES}}\", \"${getChangeString()}\" } | Set-Content ${basePath}\\Resources\\ChangeLog.html"
bat "xcopy /y ${basePath}\\Resources\\manifest.xml c:\\inetpub\\wwwroot\\SWS\\MAPO\\${basePath}\\${env.BRANCH_NAME}\\ "
bat "xcopy /y ${basePath}\\Resources\\ChangeLog.html c:\\inetpub\\wwwroot\\SWS\\MAPO\\${basePath}\\${env.BRANCH_NAME}\\ "
bat "xcopy /y ${basePath}\\Resources\\logoSteamware.png c:\\inetpub\\wwwroot\\SWS\\MAPO\\${basePath}\\${env.BRANCH_NAME}\\ "
// elimino files inutili di resources e pubblico
bat "RD /S /Q ${basePath}\\Resources || EXIT /B 0"
}
def compressZip(basePath){
// Compressione in .zip dell'installer...
bat "e:\\7za.exe a -tzip ${WORKSPACE}\\Releases\\${env.BRANCH_NAME}\\MAPO-${basePath}.zip ${WORKSPACE}\\${basePath}\\bin\\*"
// salvo copia della versione in staging...
bat "xcopy /y Releases\\${env.BRANCH_NAME}\\MAPO-${basePath}.zip E:\\Staging\\byProd\\MP\\${env.BRANCH_NAME}\\${basePath}\\${env.versionNumber}\\ "
// copio in area WebDeploy
bat "xcopy /y Releases\\${env.BRANCH_NAME}\\MAPO-${basePath}.zip c:\\inetpub\\wwwroot\\SWS\\MAPO\\${basePath}\\${env.BRANCH_NAME}\\ "
}
// Funzione x invio slack
def sendSlack(status, colorCode) {
slackSend (
color: colorCode,
channel: "#mapo-dev",
message: "${env.JOB_NAME} ${env.versionNumber} | " + status + ": Build ${env.BUILD_NUMBER}\n\n" +
"Modifiche:\n " + getChangeString() + "\n\n Verifica build: <${env.BUILD_URL}|Apri>" + "\n"
)
}
// funzione x fix pacchetti nuget da NOSTRO repo Nexus con proxy
def fixNuget(solutionFile) {
// bat "e:\\nuget setapikey fe387daa-d07c-3207-877e-96c8be1be91b -source https://nexus.steamware.net/repository/nuget-group"
// solo la prima volta va aggiunta...
hasSource = bat "e:\\nuget sources list | find \"Steamware\" /C"
if (hasSource == "0")
{
bat "e:\\nuget sources Add -Name \"Steamware Nexus\" -Source https://nexus.steamware.net/repository/nuget-group -username \"nugetUser\" -password \"viaDante16\""
}
else
{
bat "e:\\nuget sources Update -Name \"Steamware Nexus\" -Source https://nexus.steamware.net/repository/nuget-group -username \"nugetUser\" -password \"viaDante16\""
}
bat "e:\\nuget.exe restore ${solutionFile}"
}