Aggiornato build.gradle
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
This commit is contained in:
parent
bde41d21be
commit
22ad23c5b7
@ -16,6 +16,33 @@ pipeline {
|
|||||||
|
|
||||||
stages {
|
stages {
|
||||||
|
|
||||||
|
stage('Preparing') {
|
||||||
|
when(expression: { env.GIT_BRANCH == 'master-beta' })
|
||||||
|
steps {
|
||||||
|
powershell """
|
||||||
|
# Percorso del file build.gradle
|
||||||
|
$gradleFile = "app\\build.gradle"
|
||||||
|
|
||||||
|
# Legge il contenuto del file
|
||||||
|
$content = Get-Content $gradleFile -Raw
|
||||||
|
|
||||||
|
# Modifica appVersionName aggiungendo '-beta'
|
||||||
|
$content = $content -replace "(appVersionName\\s*=\\s*')([^']+)'", "`\$1`\$2-beta'"
|
||||||
|
|
||||||
|
# Modifica il nome del file di output aggiungendo '-beta' prima dell'estensione .apk
|
||||||
|
$content = $content -replace '(output\\.outputFileName\\s*=\\s*")([^"]+)(\\.apk")', "`\$1`\$2-beta`\$3"
|
||||||
|
|
||||||
|
# Modifica il percorso di version.txt in version-beta.txt
|
||||||
|
$content = $content -replace '("\\$projectDir/build/outputs/apk/release/version)(\\.txt")', '\$1-beta\$2'
|
||||||
|
|
||||||
|
# Sovrascrive il file con le modifiche
|
||||||
|
Set-Content $gradleFile -Value $content
|
||||||
|
|
||||||
|
Write-Host "Versione aggiornata con '-beta' in appVersionName, outputFileName e percorso di version.txt"
|
||||||
|
"""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
steps {
|
steps {
|
||||||
bat "./gradlew assembleRelease"
|
bat "./gradlew assembleRelease"
|
||||||
@ -35,21 +62,21 @@ pipeline {
|
|||||||
script {
|
script {
|
||||||
bat "curl -k https://devservices.studioml.it/ems-api/updateWMSApp"
|
bat "curl -k https://devservices.studioml.it/ems-api/updateWMSApp"
|
||||||
bat "curl -k https://services.studioml.it/ems-api/updateWMSApp"
|
bat "curl -k https://services.studioml.it/ems-api/updateWMSApp"
|
||||||
if (env.GIT_BRANCH == "master" || env.GIT_BRANCH == "develop") {
|
if (env.GIT_BRANCH == "master") {
|
||||||
office365ConnectorSend adaptiveCards: true, color: '#008000', message: 'WMS è stato compilato con successo', status: 'SUCCESS', webhookUrl: 'https://prod-89.westeurope.logic.azure.com:443/workflows/260580715a9d4447a54dea861a865536/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=EMqPHohvE5o5IGj_gir_iQaAufR4r8ZJxlFx52jklSE'
|
office365ConnectorSend adaptiveCards: true, color: '#008000', message: 'WMS è stato compilato con successo', status: 'SUCCESS', webhookUrl: 'https://prod-89.westeurope.logic.azure.com:443/workflows/260580715a9d4447a54dea861a865536/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=EMqPHohvE5o5IGj_gir_iQaAufR4r8ZJxlFx52jklSE'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unstable {
|
unstable {
|
||||||
script {
|
script {
|
||||||
if (env.GIT_BRANCH == "master" || env.GIT_BRANCH == "develop") {
|
if (env.GIT_BRANCH == "master") {
|
||||||
office365ConnectorSend adaptiveCards: true, color: '#FFDE21', message: 'WMS è INSTABILE', status: 'UNSTABLE', webhookUrl: 'https://prod-89.westeurope.logic.azure.com:443/workflows/260580715a9d4447a54dea861a865536/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=EMqPHohvE5o5IGj_gir_iQaAufR4r8ZJxlFx52jklSE'
|
office365ConnectorSend adaptiveCards: true, color: '#FFDE21', message: 'WMS è INSTABILE', status: 'UNSTABLE', webhookUrl: 'https://prod-89.westeurope.logic.azure.com:443/workflows/260580715a9d4447a54dea861a865536/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=EMqPHohvE5o5IGj_gir_iQaAufR4r8ZJxlFx52jklSE'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
failure {
|
failure {
|
||||||
script {
|
script {
|
||||||
if (env.GIT_BRANCH == "master" || env.GIT_BRANCH == "develop") {
|
if (env.GIT_BRANCH == "master") {
|
||||||
office365ConnectorSend adaptiveCards: true, color: '#FF2C2C', message: 'Errore di compilazione su WMS', status: 'FAILURE', webhookUrl: 'https://prod-89.westeurope.logic.azure.com:443/workflows/260580715a9d4447a54dea861a865536/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=EMqPHohvE5o5IGj_gir_iQaAufR4r8ZJxlFx52jklSE'
|
office365ConnectorSend adaptiveCards: true, color: '#FF2C2C', message: 'Errore di compilazione su WMS', status: 'FAILURE', webhookUrl: 'https://prod-89.westeurope.logic.azure.com:443/workflows/260580715a9d4447a54dea861a865536/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=EMqPHohvE5o5IGj_gir_iQaAufR4r8ZJxlFx52jklSE'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user