more global variables

This commit is contained in:
Primakov Alexandr Alexandrovich 2020-03-04 19:41:58 +03:00
parent 7d73129731
commit 55a346c526
8 changed files with 26 additions and 14 deletions

View File

@ -1,3 +1,3 @@
stage ('production build') {
stage ('build') {
sh 'npm run build'
}

4
clone/Jenkinsfile vendored
View File

@ -1,4 +0,0 @@
def loadApp(String addr) {
sh 'git clone ${addr} ./'
}
}

4
install/details/Jenkinsfile vendored Normal file
View File

@ -0,0 +1,4 @@
stage('install') {
echo 'starting installing'
sh 'npm install -d'
}

12
predeploy/Jenkinsfile vendored
View File

@ -1,18 +1,22 @@
stage ('predeploy') {
echo 'checking tag'
script {
if (sh(returnStdout: true, script: "git tag --contains").trim()) {
def tag = sh(returnStdout: true, script: "git tag --contains").trim()
if (tag) {
echo 'found tag ' + tag
sh "cd dist ; echo 'mkdir ${tag}; mv ./master/* ./${tag}; rm -r -d ./master; rm version.sh' > version.sh"
def tagNoV = tag.substring(1)
sh "cd ${TARGET_FOLDER} ; echo 'mkdir ${tagNoV}; mv ./master/* ./${tagNoV}; rm -r -d ./master; rm ${DEPLOY_VERSION_SH}' > ${DEPLOY_VERSION_SH}"
} else {
echo 'tag not found'
sh "cd dist ; echo 'rm version.sh' > version.sh"
sh "cd ${TARGET_FOLDER} ; echo 'rm ${DEPLOY_VERSION_SH}' > ${DEPLOY_VERSION_SH}"
}
}
}
stage ('archiving') {
// Archive the build output artifacts.
archiveArtifacts artifacts: 'dist/*'
script {
archiveArtifacts artifacts: "${TARGET_FOLDER}/*"
}
}

View File

@ -13,7 +13,7 @@ def clone (String repoPath, String folder) {
}
def loadScript (String scriptName) {
load "tmp--jfiles/${scriptName}/Jenkinsfile"
load "${JEN_FILES_TMP_NAME}/${scriptName}/Jenkinsfile"
}
pipeline {
@ -23,13 +23,17 @@ pipeline {
stage('processing') {
steps {
clean()
clone('https://aaprimakov@bitbucket.org/jsadvance20201/jenkins', 'tmp--jfiles')
clone(JENKINS_SCRIPTS_URL, JEN_FILES_TMP_NAME)
loadScript('stats')
clone('https://aaprimakov@bitbucket.org/jsadvance20201/dev-server', './')
clone('https://aaprimakov@bitbucket.org/aaprimakov/r-and-m', './')
loadScript('install')
loadScript('build/dev')
loadScript('tests/ts')
loadScript('tests/ui')
loadScript('publish')
loadScript('predeploy')
loadScript('clean-all')
}
}
}
}

4
tests/ts/Jenkinsfile vendored Normal file
View File

@ -0,0 +1,4 @@
stage('unit tests') {
echo 'runing ts tests...'
sh 'npm run test:ts'
}