/
SubZero
/
utils
Обзор
Документация
Войти
/
SubZero
/
utils
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/io/sync_hran.groovy
81 строка
3 KB
Zaur
5
22 май 2025, 22:11
22 май 2025, 22:11
14f34aa
Код
Авторство
О чём код?
@Library('1c-utils') import io.libs.v8_utils utils = new v8_utils() pipeline { agent { label "localhost"} stages { stage('Init repo'){ steps{ script{ // Переключение на ветку storage_1c returnCode = utils.cmd("cd /D \"${rep_git_local}\" & git checkout -B \"storage_1c\" \"origin/storage_1c\""); if (returnCode != 0) { error 'Ошибка' } // Получение изменений с удаленного репозитория withCredentials([usernamePassword(credentialsId: '34bb4e2a-700d-408c-8fda-04c485f41478', usernameVariable: 'username', passwordVariable: 'password')]){ returnCode = utils.cmd("cd /D \"${rep_git_local}\" & git pull https://$username:$password@$rep_git_remote storage_1c"); } if (returnCode != 0) { error 'Ошибка' } // Инициализация хранилища 1С withCredentials([usernamePassword(credentialsId: '3aec0df3-52b8-49f0-8bb1-b112c0632ac3', usernameVariable: 'login_hran', passwordVariable: 'pass_hran')]){ returnCode = utils.init_hran(rep_1c, rep_git_local+"\\src\\cf",,""); if (returnCode != 0) { error 'Ошибка' } } } } } stage('sync repo'){ steps{ script{ withCredentials([usernamePassword(credentialsId: '3aec0df3-52b8-49f0-8bb1-b112c0632ac3', usernameVariable: 'login_hran', passwordVariable: 'pass_hran')]){ returnCode = utils.sync_hran(rep_1c, rep_git_local+"\\src\\cf", "https://"+rep_git_remote,"","",""); if (returnCode != 0) { error 'Ошибка' } } } } } stage('push repo'){ steps{ script{ withCredentials([usernamePassword(credentialsId: '34bb4e2a-700d-408c-8fda-04c485f41478', usernameVariable: 'username', passwordVariable: 'password')]){ returnCode = utils.cmd("cd /D \"${rep_git_local}\" & git push https://$username:$password@$rep_git_remote") } if (returnCode != 0) { error 'Ошибка' } } } } stage('branch install'){ steps{ script{ utils.cmd("cd /D \"${rep_git_local}\" & \"C:\\Program Files\\Git\\bin\\bash.exe\" build_branch.sh") } } } } }