Created
September 21, 2018 14:07
-
-
Save VladFrost/d8c62be2aae85068645adbcb600494b1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node { | |
env.LOGOS_LEVEL = 'DEBUG' | |
def RESULT_FILE = 'validation-result.txt' | |
def PREV_RESULT_FILE = "prev-${RESULT_FILE}" | |
def PREV_PARAM = "--prev-validation-result ${PREV_RESULT_FILE}" | |
def LOCAL_REPO = 'c:/local-repo' | |
def REMOTE_REPO = '[email protected]:project-name/project-name.git' | |
def REPO_BRANCH = 'develop' | |
def PROJECT_PATH = 'c:/local-repo/project-name' | |
stage('Подготовка окружения') { | |
deleteDir(); | |
cmd('mkdir allure-results') | |
cmd("mkdir edt-wsp") | |
try { | |
copyArtifacts filter: RESULT_FILE, fingerprintArtifacts: true, flatten: true, projectName: JOB_NAME, selector: lastSuccessful() | |
cmd("mv ${RESULT_FILE} ${PREV_RESULT_FILE}") | |
} catch (e) { | |
PREV_PARAM = '' | |
} | |
} | |
stage('Обновление репозитория') { | |
dir(LOCAL_REPO) { | |
git branch: REPO_BRANCH, url: REMOTE_REPO | |
} | |
} | |
stage('Валидация EDT') { | |
cmd("vrunner edt-validate --workspace-location \"${WORKSPACE}/edt-wsp\" " | |
+ "--project-list ${PROJECT_PATH} --allure-results allure-results " | |
+ "--validation-result \"${WORKSPACE}/${RESULT_FILE}\" " | |
+ PREV_PARAM) | |
archiveArtifacts RESULT_FILE | |
} | |
stage('Отчет Allure') { | |
allure includeProperties: false, jdk: '', results: [[path: 'allure-results']] | |
} | |
} | |
def cmd(command) { | |
// при запуске Jenkins не в режиме UTF-8 нужно написать chcp 1251 вместо chcp 65001 | |
if (isUnix()) { sh "${command}" } else { bat "chcp 65001\n${command}"} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment