Merge branch 'develop' into main
This commit is contained in:
@@ -4,7 +4,9 @@
|
||||
#access token per autenticazione gitlab da profilo marco.locatelli@egalware.com con scadenza 31 dicembre 2024
|
||||
#$gitlabHead2024 = @{"PRIVATE-TOKEN" = "glpat-VjT_SAsBk3s-yWE1LDUF" }
|
||||
#access token per autenticazione gitlab da profilo marco.locatelli@egalware.com con scadenza 31 dicembre 2025
|
||||
$tokenGitlab = "glpat-AGzz46yrxj7rTjzSVYCH"
|
||||
#$tokenGitlab = "glpat-AGzz46yrxj7rTjzSVYCH"
|
||||
#access token per autenticazione gitlab da profilo marco.locatelli@egalware.com con scadenza 31 dicembre 2026
|
||||
$tokenGitlab = "glpat-CnHov-GaFjozv34MsnRx8m86MQp1OjgH.01.0w1or5g5w"
|
||||
$gitlabHead = @{"PRIVATE-TOKEN" = "$($tokenGitlab)" }
|
||||
#nome utente che effettua i mirror push
|
||||
$userName = "replica"
|
||||
@@ -13,7 +15,10 @@ $userName = "replica"
|
||||
#destinazione mirror per azzano
|
||||
$destinationAzzano = "gitlab-azzano.steamware.net"
|
||||
#token autenticazione utente replica azzano
|
||||
$tokenAzzano = "glpat-tCyVnkDQb3uB_yFywQtK"
|
||||
#token 2025:$tokenAzzano = "glpat-tCyVnkDQb3uB_yFywQtK"
|
||||
|
||||
#token autenticazione utente replica azzano Gennaio 2026:
|
||||
$tokenAzzano = "glpat-xbCbgalMbPwJ9MDvZTU3rW86MQp1OnAH.01.0w17pjo4t"
|
||||
#access token per autenticazione gitlab-azzano
|
||||
$azzanoHead = @{"PRIVATE-TOKEN" = "$($tokenAzzano)" }
|
||||
|
||||
@@ -25,13 +30,13 @@ $tokenNembro = "glpat--9NqsusKLmHdF8z1kU9t"
|
||||
#access token per autenticazione gitlab-nembro
|
||||
$nembroHead = @{"PRIVATE-TOKEN" = "$($tokenNembro)" }
|
||||
|
||||
#### CONF gitea.steamware.net ####
|
||||
#### CONF gitea-nembro.steamware.net ####
|
||||
#destinazione mirror per gitea
|
||||
$giteaNembro = "gitea-nembro.steamware.net"
|
||||
#nome utente gitea che effettua i mirror push
|
||||
$giteaNembroUser = "replica"
|
||||
#autenticazione replica gitea
|
||||
$giteaNembroPass = "vpsad24068"
|
||||
$giteaNembroPass = "IXQkDchDwMah8E"
|
||||
#token autenticazione utente replica gitea
|
||||
$tokenGiteaNembro = "c58a2fdf6493bb690e8c39b393e06a121f8a6761"
|
||||
#access token per autenticazione gitea da profilo replica
|
||||
|
||||
@@ -96,13 +96,13 @@ $endTime = (Get-Date).toString("yyyy/MM/dd HH:mm:ss")
|
||||
|
||||
#invio a zabbix le metriche rilevate tramite zabbix_sender.exe
|
||||
#WriteLogOutput $logFile 0 ""
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.Projects -o $existingProjects
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.TotalJobArtifacts -o $JobArtifactsCount
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.SuccessJobArtifacts -o $JobArtifactsSuccessCount
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.ErrorsJobArtifacts -o $JobArtifactsErrorsCount
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.SuccessJobArtifactsPercent -o $JobArtifactsSuccessPercentage
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.ErrorsJobArtifactsPercent -o $JobArtifactsErrorsPercentage
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.CheckJobArtifactsDuration -o $durataScript
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.Projects -o $existingProjects
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.TotalJobArtifacts -o $JobArtifactsCount
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.SuccessJobArtifacts -o $JobArtifactsSuccessCount
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.ErrorsJobArtifacts -o $JobArtifactsErrorsCount
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.SuccessJobArtifactsPercent -o $JobArtifactsSuccessPercentage
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.ErrorsJobArtifactsPercent -o $JobArtifactsErrorsPercentage
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.CheckJobArtifactsDuration -o $durataScript
|
||||
|
||||
#scrivo a video le statistiche
|
||||
WriteLogOutput $logFile 0 ""
|
||||
|
||||
@@ -104,14 +104,14 @@ $endTime = (Get-Date).toString("yyyy/MM/dd HH:mm:ss")
|
||||
|
||||
#invio a zabbix le metriche rilevate tramite zabbix_sender.exe
|
||||
WriteLogOutput $logFile 0 ""
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.ProjectsFound -o $projectsFound
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.LastDaysCommits -o $lastDays
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.RecentCommits -o $recentCommits
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.ProjectWithCommits -o $projectWithCommits
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.ProjectWithNoCommits -o $projectWithNoCommits
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.ProjectWithCommitsPercentage -o $projectWithCommitsPercentage
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.ProjectWithNoCommitsPercentage -o $projectWithNoCommitsPercentage
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.CheckCommitsDuration -o $durataScript
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.ProjectsFound -o $projectsFound
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.LastDaysCommits -o $lastDays
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.RecentCommits -o $recentCommits
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.ProjectWithCommits -o $projectWithCommits
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.ProjectWithNoCommits -o $projectWithNoCommits
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.ProjectWithCommitsPercentage -o $projectWithCommitsPercentage
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.ProjectWithNoCommitsPercentage -o $projectWithNoCommitsPercentage
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.CheckCommitsDuration -o $durataScript
|
||||
|
||||
#scrivo a video le statistiche
|
||||
WriteLogOutput $logFile 0 ""
|
||||
|
||||
@@ -15,7 +15,7 @@ $mainStopWatch = [system.diagnostics.stopwatch]::StartNew()
|
||||
#contatore ciclo do while
|
||||
$startProj = 1
|
||||
#numero massimo di progetti da analizzare
|
||||
$endProj = 250
|
||||
$endProj = 300
|
||||
#conteggio progetti trovati
|
||||
$existingProjects = 0
|
||||
#conteggio mirroring in errore
|
||||
@@ -98,13 +98,13 @@ $endTime = (Get-Date).toString("yyyy/MM/dd HH:mm:ss")
|
||||
|
||||
#invio a zabbix le metriche rilevate tramite zabbix_sender.exe
|
||||
WriteLogOutput $logFile 0 ""
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabbix.egalware -s "IIS04" -k Gitlab.Projects -o $existingProjects
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabbix.egalware -s "IIS04" -k Gitlab.TotalMirror -o $mirrorCount
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabbix.egalware -s "IIS04" -k Gitlab.SuccessMirror -o $mirrorSuccessCount
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabbix.egalware -s "IIS04" -k Gitlab.ErrorsMirror -o $mirrorErrorsCount
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabbix.egalware -s "IIS04" -k Gitlab.SuccessMirrorPercent -o $mirrorSuccessPercentage
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabbix.egalware -s "IIS04" -k Gitlab.ErrorsMirrorPercent -o $mirrorErrorsPercentage
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabbix.egalware -s "IIS04" -k Gitlab.CheckMirrorDuration -o $durataScript
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.Projects -o $existingProjects
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.TotalMirror -o $mirrorCount
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.SuccessMirror -o $mirrorSuccessCount
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.ErrorsMirror -o $mirrorErrorsCount
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.SuccessMirrorPercent -o $mirrorSuccessPercentage
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.ErrorsMirrorPercent -o $mirrorErrorsPercentage
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.CheckMirrorDuration -o $durataScript
|
||||
|
||||
#scrivo a video le statistiche
|
||||
WriteLogOutput $logFile 0 ""
|
||||
|
||||
@@ -13,9 +13,9 @@ $startTime = (Get-Date).toString("yyyy/MM/dd HH:mm:ss")
|
||||
# avvio stopwatch
|
||||
$mainStopWatch = [system.diagnostics.stopwatch]::StartNew()
|
||||
#contatore ciclo do while
|
||||
$startProj = 1
|
||||
$startProj = 200
|
||||
#numero massimo di progetti da analizzare
|
||||
$endProj = 250
|
||||
$endProj = 300
|
||||
#nome file di log
|
||||
$logFile = "NewMirrorsCreation.log"
|
||||
#nome file di log old
|
||||
@@ -62,6 +62,7 @@ for ($projectCount = $startProj; $projectCount -le $endProj; $projectCount++) {
|
||||
#chiamo funzione per creare mirror verso gitea-steamware
|
||||
FreshMirrorCreation $projectCount $giteaSteamwUser $giteaSteamwPass $giteaSteamw $simplePath
|
||||
}
|
||||
#se la risposta non contiene "gitea-nembro" procedo a creare mirror relativo
|
||||
if ($gitlabResponse.Content -inotmatch "gitea-nembro.steamware.net") {
|
||||
#chiamo funzione per creare mirror verso gitea-nembro
|
||||
FreshMirrorCreation $projectCount $giteaNembroUser $giteaNembroPass $giteaNembro $simplePath
|
||||
@@ -71,16 +72,16 @@ for ($projectCount = $startProj; $projectCount -le $endProj; $projectCount++) {
|
||||
#chiamo funzione per creare mirror verso gogs
|
||||
FreshMirrorCreation $projectCount $gogsUser $gogsPass $gogsDestination $simplePath
|
||||
}
|
||||
#se la risposta non contiene "gitlab-nembro" procedo a creare mirror relativo
|
||||
if ($gitlabResponse.Content -inotmatch "gitlab-nembro") {
|
||||
#chiamo funzione per creare mirror verso gitlab-nembro
|
||||
FreshMirrorCreation $projectCount $userName $tokenNembro $destinationNembro $simplePath
|
||||
}
|
||||
#se la risposta non contiene "gitlab-azzano" procedo a creare mirror relativo
|
||||
if ($gitlabResponse.Content -inotmatch "gitlab-azzano") {
|
||||
#chiamo funzione per creare mirror verso gitlab-azzano
|
||||
FreshMirrorCreation $projectCount $userName $tokenAzzano $destinationAzzano $simplePath
|
||||
}
|
||||
#OLD: se la risposta non contiene "gitlab-nembro" procedo a creare mirror relativo
|
||||
#if ($gitlabResponse.Content -inotmatch "gitlab-nembro") {
|
||||
# #chiamo funzione per creare mirror verso gitlab-nembro
|
||||
# FreshMirrorCreation $projectCount $userName $tokenNembro $destinationNembro $simplePath
|
||||
#}
|
||||
}
|
||||
#scrivo se trovo un errore durante il try/catch
|
||||
catch {
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
###Gitlab: delete mirrors###
|
||||
|
||||
#Questo script passa in rassegna tutti i progetti esistenti sul gitlab aziendale e per ognuno può cancellare i mirror desiderati
|
||||
|
||||
#IMPORTANTE: SCRIPT PERICOLOSO. TOGLIERE COMMENTO A RIGA 60 PER CANCELLARE.
|
||||
|
||||
#importo file contenente configurazioni
|
||||
. .\ApiGit\ApiGitResources\ApiScriptsConfig.ps1
|
||||
#importo file contenente funzioni
|
||||
. .\ApiGit\ApiGitResources\ApiScriptsFunctions.ps1
|
||||
|
||||
#rilevo time per log inizio analisi
|
||||
$startTime = (Get-Date).toString("yyyy/MM/dd HH:mm:ss")
|
||||
# avvio stopwatch
|
||||
$mainStopWatch = [system.diagnostics.stopwatch]::StartNew()
|
||||
#contatore ciclo do while
|
||||
$startProj = 1
|
||||
#numero massimo di progetti da analizzare
|
||||
$endProj = 250
|
||||
#nome file di log
|
||||
$logFile = "MirrorsDelete.log"
|
||||
#nome file di log old
|
||||
$oldLogFile = "MirrorsDelete.old"
|
||||
#stringa da cercare per cancellare il mirror
|
||||
$mirrorToDelete = "gitlab-nembro"
|
||||
|
||||
#creazione folder di Log se non esiste
|
||||
CheckLogFolder
|
||||
|
||||
#rotazione vecchio logFile da .log a .old se esiste
|
||||
RotateOldLog
|
||||
|
||||
#scrivo intestazione e inizio analisi
|
||||
WriteLogOutput $logFile 0 "--------------------"
|
||||
Switch ($logLevel) {
|
||||
0 { WriteLogOutput $logFile 0 "LOG SINTETICO DELETE MIRROR" }
|
||||
1 { WriteLogOutput $logFile 0 "LOG ERRORI DELETE MIRROR" }
|
||||
2 { WriteLogOutput $logFile 0 "LOG FULL DELETE MIRROR" }
|
||||
3 { WriteLogOutput $logFile 0 "LOG AMPOLLOSO DELETE MIRROR" }
|
||||
}
|
||||
WriteLogOutput $logFile 0 ""
|
||||
WriteLogOutput $logFile 0 "Percorso log: $logFolder"
|
||||
WriteLogOutput $logFile 0 ""
|
||||
WriteLogOutput $logFile 0 "Inizio Esecuzione Script: $startTime"
|
||||
|
||||
#ciclo principale for che cicla da 1 a N projectNumber
|
||||
for ($projectCount = $startProj; $projectCount -le $endProj; $projectCount++) {
|
||||
$callUrl = "https://gitlab.steamware.net/api/v4/projects/" + $projectCount + "/remote_mirrors"
|
||||
try {
|
||||
$gitlabResponse = Invoke-WebRequest -URI $callUrl -Headers $gitlabHead -ContentType "application/json" -UseBasicParsing
|
||||
$parsedGitlabResponse = $gitlabResponse.Content | ConvertFrom-Json
|
||||
#scrivo il numero del progetto nel terminale e su file
|
||||
WriteLogOutput $logFile 1 ""
|
||||
WriteLogOutput $logFile 1 "--------------------"
|
||||
WriteLogOutput $logFile 1 "**PROGETTO $projectCount**"
|
||||
foreach ($gitResponse IN $parsedGitlabResponse){
|
||||
if ($gitResponse -match $mirrorToDelete) {
|
||||
#Cancello mirror verso gitlab-nembro
|
||||
$deleteUrl = "https://gitlab.steamware.net/api/v4/projects/" + $projectCount + "/remote_mirrors/" + $gitResponse.id
|
||||
#Invoke-WebRequest -URI $deleteUrl -Method DELETE -Headers $gitlabHead -ContentType "application/json" -UseBasicParsing
|
||||
WriteLogOutput $logFile 1 "Eliminato mirror: $gitResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
#scrivo se trovo un errore durante il try/catch
|
||||
catch {
|
||||
$parsedError = $_ | ConvertFrom-Json
|
||||
WriteLogOutput $logFile 3 ""
|
||||
WriteLogOutput $logFile 3 "--------------------"
|
||||
WriteLogOutput $logFile 3 "**ERRORE NEL PROGETTO $projectCount**"
|
||||
WriteLogOutput $logFile 3 $($parsedError.message)
|
||||
}
|
||||
}
|
||||
#fine ciclo principale
|
||||
|
||||
# fermo stopwatch e calcolo durata script
|
||||
$mainStopWatch.Stop()
|
||||
$durataScript = $mainStopWatch.Elapsed.TotalSeconds
|
||||
|
||||
#rilevo time per log fine analisi
|
||||
$endTime = (Get-Date).toString("yyyy/MM/dd HH:mm:ss")
|
||||
|
||||
#scrivo a video le statistiche
|
||||
WriteLogOutput $logFile 0 ""
|
||||
WriteLogOutput $logFile 0 "Fine Esecuzione Script: $endTime"
|
||||
WriteLogOutput $logFile 0 ""
|
||||
WriteLogOutput $logFile 0 "Durata Esecuzione Script: $durataScript secondi"
|
||||
WriteLogOutput $logFile 0 ""
|
||||
@@ -14,7 +14,7 @@ $mainStopWatch = [system.diagnostics.stopwatch]::StartNew()
|
||||
#contatore ciclo do while
|
||||
$startProj = 1
|
||||
#numero massimo di progetti da analizzare
|
||||
$endProj = 250
|
||||
$endProj = 300
|
||||
#conteggio progetti trovati
|
||||
$existingProjects = 0
|
||||
#contatore mirror trovati
|
||||
|
||||
@@ -14,7 +14,7 @@ $mainStopWatch = [system.diagnostics.stopwatch]::StartNew()
|
||||
#contatore ciclo do while
|
||||
$startProj = 1
|
||||
#numero massimo di progetti da analizzare
|
||||
$endProj = 250
|
||||
$endProj = 300
|
||||
#inizializzo variabili vuote
|
||||
$mirrorId = ""
|
||||
$mirrorUrl = ""
|
||||
|
||||
@@ -69,11 +69,11 @@ for ($projectCount = $startProj; $projectCount -le $endProj; $projectCount++){
|
||||
$mirrorDestination = "@gitlab-azzano.steamware.net"
|
||||
}
|
||||
#controllo se l'url del mirror contiene nembro, riscrivo mirror
|
||||
elseif ($item.url.Contains("nembro")) {
|
||||
$doExecute = "true"
|
||||
$destinationToken = $tokenNembro
|
||||
$mirrorDestination = "@gitlab-nembro.steamware.net"
|
||||
}
|
||||
#elseif ($item.url.Contains("nembro")) {
|
||||
# $doExecute = "true"
|
||||
# $destinationToken = $tokenNembro
|
||||
# $mirrorDestination = "@gitlab-nembro.steamware.net"
|
||||
#}
|
||||
#verifico se devo effettuare cancellazione e creazione nuovo mirror
|
||||
if ($doExecute -eq "true") {
|
||||
#salvo id mirror e url mirror
|
||||
|
||||
@@ -14,7 +14,7 @@ $mainStopWatch = [system.diagnostics.stopwatch]::StartNew()
|
||||
#contatore ciclo do while
|
||||
$startProj = 1
|
||||
#numero massimo di progetti da analizzare
|
||||
$endProj = 250
|
||||
$endProj = 300
|
||||
#conteggio progetti trovati
|
||||
$existingProjects = 0
|
||||
#conteggio progetti trovati
|
||||
@@ -45,18 +45,8 @@ WriteLogOutput $logFile 0 "Percorso log: $logFolder"
|
||||
WriteLogOutput $logFile 0 ""
|
||||
WriteLogOutput $logFile 0 "Inizio Esecuzione Script: $startTime"
|
||||
|
||||
$locations = @('Nembro','Azzano')
|
||||
|
||||
#ciclo for per lavorare su gitlab nembro e poi su gitlab azzano
|
||||
foreach ($remote in $locations){
|
||||
if ($remote -eq "Nembro"){
|
||||
$gitlabIstance = $destinationNembro
|
||||
$head = $nembroHead
|
||||
}
|
||||
elseif ($remote -eq "Azzano"){
|
||||
$gitlabIstance = $destinationAzzano
|
||||
$head = $azzanoHead
|
||||
}
|
||||
$gitlabIstance = $destinationAzzano
|
||||
$head = $azzanoHead
|
||||
#ciclo principale for che cicla da startProj a endProj
|
||||
for ($projectCount = $startProj; $projectCount -le $endProj; $projectCount++) {
|
||||
#chiamata api che restituisce informazioni sullo stato dei mirror
|
||||
@@ -91,8 +81,6 @@ foreach ($remote in $locations){
|
||||
}
|
||||
#fine ciclo dei progetti
|
||||
}
|
||||
#fine ciclo remote nembro/azzano
|
||||
}
|
||||
# fermo stopwatch e calcolo durata script
|
||||
$mainStopWatch.Stop()
|
||||
$durataScript = $mainStopWatch.Elapsed.TotalSeconds
|
||||
|
||||
@@ -96,13 +96,13 @@ $endTime = (Get-Date).toString("yyyy/MM/dd HH:mm:ss")
|
||||
|
||||
#invio a zabbix le metriche rilevate tramite zabbix_sender.exe
|
||||
#WriteLogOutput $logFile 0 ""
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.ProjectsWithPipeline -o $projectsWithPipeline
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.TotalPipeline -o $pipelineCount
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.SuccessPipeline -o $pipelineSuccessCount
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.ErrorsPipeline -o $pipelineErrorsCount
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.SuccessPipelinePercent -o $pipelineSuccessPercentage
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.ErrorsPipelinePercent -o $pipelineErrorsPercentage
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.CheckPipelineDuration -o $durataScript
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.ProjectsWithPipeline -o $projectsWithPipeline
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.TotalPipeline -o $pipelineCount
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.SuccessPipeline -o $pipelineSuccessCount
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.ErrorsPipeline -o $pipelineErrorsCount
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.SuccessPipelinePercent -o $pipelineSuccessPercentage
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.ErrorsPipelinePercent -o $pipelineErrorsPercentage
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.CheckPipelineDuration -o $durataScript
|
||||
|
||||
#scrivo a video le statistiche
|
||||
WriteLogOutput $logFile 0 ""
|
||||
|
||||
@@ -96,13 +96,13 @@ $endTime = (Get-Date).toString("yyyy/MM/dd HH:mm:ss")
|
||||
|
||||
#invio a zabbix le metriche rilevate tramite zabbix_sender.exe
|
||||
#WriteLogOutput $logFile 0 ""
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.ProjectsWithPipeline -o $projectsWithPipeline
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.TotalPipeline -o $pipelineCount
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.SuccessPipeline -o $pipelineSuccessCount
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.ErrorsPipeline -o $pipelineErrorsCount
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.SuccessPipelinePercent -o $pipelineSuccessPercentage
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.ErrorsPipelinePercent -o $pipelineErrorsPercentage
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.CheckPipelineDuration -o $durataScript
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.ProjectsWithPipeline -o $projectsWithPipeline
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.TotalPipeline -o $pipelineCount
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.SuccessPipeline -o $pipelineSuccessCount
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.ErrorsPipeline -o $pipelineErrorsCount
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.SuccessPipelinePercent -o $pipelineSuccessPercentage
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.ErrorsPipelinePercent -o $pipelineErrorsPercentage
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.CheckPipelineDuration -o $durataScript
|
||||
|
||||
#scrivo a video le statistiche
|
||||
WriteLogOutput $logFile 0 ""
|
||||
|
||||
@@ -99,13 +99,13 @@ $endTime = (Get-Date).toString("yyyy/MM/dd HH:mm:ss")
|
||||
|
||||
#invio a zabbix le metriche rilevate tramite zabbix_sender.exe
|
||||
WriteLogOutput $logFile 0 ""
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.ProjectsWithPipeline -o $projectsWithPipeline
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.TotalPipeline -o $pipelineCount
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.SuccessPipeline -o $pipelineSuccessCount
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.ErrorsPipeline -o $pipelineErrorsCount
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.SuccessPipelinePercent -o $pipelineSuccessPercentage
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.ErrorsPipelinePercent -o $pipelineErrorsPercentage
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gitlab.CheckPipelineDuration -o $durataScript
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.ProjectsWithPipeline -o $projectsWithPipeline
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.TotalPipeline -o $pipelineCount
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.SuccessPipeline -o $pipelineSuccessCount
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.ErrorsPipeline -o $pipelineErrorsCount
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.SuccessPipelinePercent -o $pipelineSuccessPercentage
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.ErrorsPipelinePercent -o $pipelineErrorsPercentage
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gitlab.CheckPipelineDuration -o $durataScript
|
||||
|
||||
#scrivo a video le statistiche
|
||||
WriteLogOutput $logFile 0 ""
|
||||
|
||||
@@ -13,9 +13,9 @@ $startTime = (Get-Date).toString("yyyy/MM/dd HH:mm:ss")
|
||||
# avvio stopwatch
|
||||
$mainStopWatch = [system.diagnostics.stopwatch]::StartNew()
|
||||
#contatore ciclo do while
|
||||
$startProj = 1
|
||||
$startProj = 200
|
||||
#numero massimo di progetti da analizzare
|
||||
$endProj = 250
|
||||
$endProj = 300
|
||||
#nome file di log
|
||||
$logFile = "AzzanoNembroReposCreation.log"
|
||||
#nome file di log old
|
||||
@@ -28,8 +28,8 @@ CheckLogFolder
|
||||
RotateOldLog
|
||||
|
||||
#specifica quale installazione di gitlab va controllata
|
||||
$remote = "Nembro"
|
||||
#$remote = "Azzano"
|
||||
#$remote = "Nembro"
|
||||
$remote = "Azzano"
|
||||
|
||||
if ($remote -eq "Nembro"){
|
||||
$gitlabIstance = $destinationNembro
|
||||
|
||||
@@ -12,9 +12,9 @@ $startTime = (Get-Date).toString("yyyy/MM/dd HH:mm:ss")
|
||||
# avvio stopwatch
|
||||
$mainStopWatch = [system.diagnostics.stopwatch]::StartNew()
|
||||
#contatore ciclo do while
|
||||
$startProj = 1
|
||||
$startProj = 200
|
||||
#numero massimo di progetti da analizzare
|
||||
$endProj = 250
|
||||
$endProj = 260
|
||||
#nome file di log
|
||||
$logFile = "GiteaReposCreation.log"
|
||||
#nome file di log old
|
||||
@@ -40,7 +40,7 @@ $giteaPass = $giteaSteamwPass
|
||||
#access token per autenticazione gitea Steamw da profilo replica
|
||||
$giteaHead = $giteaSteamwHead
|
||||
}
|
||||
if ($target = "nembro"){
|
||||
if ($target = "nembro") {
|
||||
#destinazione mirror per gitea nembro
|
||||
$giteaDestination = $giteaNembro
|
||||
#nome utente gitea nembro che effettua i mirror push
|
||||
|
||||
@@ -12,9 +12,9 @@ $startTime = (Get-Date).toString("yyyy/MM/dd HH:mm:ss")
|
||||
# avvio stopwatch
|
||||
$mainStopWatch = [system.diagnostics.stopwatch]::StartNew()
|
||||
#contatore ciclo do while
|
||||
$startProj = 1
|
||||
$startProj = 200
|
||||
#numero massimo di progetti da analizzare
|
||||
$endProj = 250
|
||||
$endProj = 300
|
||||
#nome file di log
|
||||
$logFile = "GogsReposCreation.log"
|
||||
#nome file di log old
|
||||
|
||||
@@ -104,6 +104,6 @@ else {
|
||||
# fermo stopwatch e conteggio...
|
||||
$stopwatch.Stop()
|
||||
$durata = $stopwatch.Elapsed.TotalSeconds
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gpw.Proj -o $durata
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gpw.Proj -o $durata
|
||||
LogWrite("Durata esecuzione: $durata")
|
||||
}
|
||||
|
||||
@@ -65,5 +65,5 @@ finally
|
||||
# fermo stopwatch e conteggio...
|
||||
$stopwatch.Stop()
|
||||
$durata = $stopwatch.Elapsed.TotalSeconds
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k LiMan.Lic -o $durata
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k LiMan.Lic -o $durata
|
||||
LogWrite("Durata esecuzione: $durata")
|
||||
|
||||
@@ -104,5 +104,5 @@ finally
|
||||
# fermo stopwatch e conteggio...
|
||||
$stopwatch.Stop()
|
||||
$durata = $stopwatch.Elapsed.TotalSeconds
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gpw.Timb -o $durata
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gpw.Timb -o $durata
|
||||
LogWrite("Durata esecuzione: $durata")
|
||||
@@ -80,5 +80,5 @@ finally
|
||||
# fermo stopwatch e conteggio...
|
||||
$stopwatch.Stop()
|
||||
$durata = $stopwatch.Elapsed.TotalSeconds
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "IIS04" -k Gpw.Core -o $durata
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ufficio -s "W2022-IIS04" -k Gpw.Core -o $durata
|
||||
LogWrite("Durata esecuzione: $durata")
|
||||
@@ -34,4 +34,4 @@ Remove-Variable * -ErrorAction SilentlyContinue # pulisco variabili x ISE
|
||||
|
||||
$durata = 5
|
||||
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabbix.ufficio -s "IIS04" -k TESTER -o $durata
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabbix.ufficio -s "W2022-IIS04" -k TESTER -o $durata
|
||||
@@ -28,9 +28,9 @@ $sourceFolder = "U:\NextCloud\ABH\Compo"
|
||||
#folder destination per robocopy
|
||||
$destFolder = "U:\WebDoorSync\NewComp\Compo"
|
||||
|
||||
# ex IIS04
|
||||
# ex W2022-IIS04
|
||||
#$sourceFolder = "\\stor01\TEAM DRIVES\30_Clienti\ABH\DataImport\Compo"
|
||||
#$destFolder = "\\IIS04\WebDoorSync\NewComp\Compo"
|
||||
#$destFolder = "\\W2022-IIS04\WebDoorSync\NewComp\Compo"
|
||||
|
||||
####FINE DICHIARAZIONE VARIABILI####
|
||||
|
||||
|
||||
Reference in New Issue
Block a user