update credenziali gitea azzano
This commit is contained in:
@@ -49,9 +49,9 @@ $giteaAzzano = "gitea-azzano.steamware.net"
|
||||
#nome utente gitea che effettua i mirror push
|
||||
$giteaAzzanoUser = "replica"
|
||||
#autenticazione replica gitea
|
||||
$giteaAzzanoPass = "kj5uQz9QpVdrwXj"
|
||||
$giteaAzzanoPass = "uf7NRD6JbeeDsk5"
|
||||
#token autenticazione utente replica gitea
|
||||
$tokenGiteaAzzano = "9e9958e9d46d78cc098b3ba7341e750f2d2fd8a3"
|
||||
$tokenGiteaAzzano = "8dc51d95f14c0b13d709855a5f0b3a608538ad46"
|
||||
#access token per autenticazione gitea da profilo replica
|
||||
$giteaAzzanoHead = @{"Authorization" = "token $($tokenGiteaAzzano)" }
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ Function FreshMirrorCreation {
|
||||
#compongo url da chiamare per creazione nuovo mirror
|
||||
$callUrlCreateMirror = "https://gitlab.steamware.net/api/v4/projects/" + $projectNumber + "/remote_mirrors"
|
||||
#creo url del nuovo mirror con username e token relativi a gitlab
|
||||
$newMirror = "http://" + $user + ":" + $auth + "@" + $destination + "/" + $path
|
||||
$newMirror = "https://" + $user + ":" + $auth + "@" + $destination + "/" + $path
|
||||
#creo body da convertire in json
|
||||
$body =
|
||||
@{
|
||||
|
||||
@@ -24,7 +24,7 @@ $logFile = "MirrorsDelete.log"
|
||||
#nome file di log old
|
||||
$oldLogFile = "MirrorsDelete.old"
|
||||
#stringa da cercare per cancellare il mirror
|
||||
$mirrorToDelete = "gitlab-azzano"
|
||||
$mirrorToDelete = "gitea-azzano"
|
||||
|
||||
#creazione folder di Log se non esiste
|
||||
CheckLogFolder
|
||||
@@ -59,7 +59,7 @@ for ($projectCount = $startProj; $projectCount -le $endProj; $projectCount++) {
|
||||
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
|
||||
Invoke-WebRequest -URI $deleteUrl -Method DELETE -Headers $gitlabHead -ContentType "application/json" -UseBasicParsing
|
||||
WriteLogOutput $logFile 1 "Eliminato mirror: $gitResponse"
|
||||
$deletedMirrors++
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ $mainStopWatch = [system.diagnostics.stopwatch]::StartNew()
|
||||
#contatore ciclo do while
|
||||
$startProj = 1
|
||||
#numero massimo di progetti da analizzare
|
||||
$endProj = 300
|
||||
$endProj = 260
|
||||
#conteggio progetti trovati
|
||||
$existingProjects = 0
|
||||
#contatore mirror trovati
|
||||
@@ -68,6 +68,7 @@ for ($projectCount = $startProj; $projectCount -le $endProj; $projectCount++) {
|
||||
$mirrorCount++
|
||||
}
|
||||
$existingProjects++
|
||||
#Start-Sleep -Seconds 10
|
||||
}
|
||||
#scrivo se trovo un errore durante il try/catch
|
||||
catch {
|
||||
|
||||
@@ -87,7 +87,7 @@ for ($projectCount = $startProj; $projectCount -le $endProj; $projectCount++){
|
||||
WriteLogOutput $logFile 1 "**PROGETTO $projectCount**"
|
||||
foreach ($gitlabItem in $parsedGitlabResponse) {
|
||||
WriteLogOutput $logFile 1 "Gitlab Project Name: $($gitlabItem.name)"
|
||||
$callGiteaUrl = "http://" + $giteaDestination + "/api/v1/orgs/Egalware/repos"
|
||||
$callGiteaUrl = "https://" + $giteaDestination + "/api/v1/orgs/Egalware/repos"
|
||||
#dichiaro un body da convertire in JSON con il nome del repo da creare (prendo path o name a seconda delle necessità)
|
||||
$giteaBody =
|
||||
@{
|
||||
|
||||
Reference in New Issue
Block a user