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' 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'
}

14
predeploy/Jenkinsfile vendored
View File

@ -1,18 +1,22 @@
stage ('predeploy') { stage ('predeploy') {
echo 'checking tag' echo 'checking tag'
script { script {
if (sh(returnStdout: true, script: "git tag --contains").trim()) { def tag = sh(returnStdout: true, script: "git tag --contains").trim()
def tag = sh(returnStdout: true, script: "git tag --contains").trim()
if (tag) {
echo 'found tag ' + 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 { } else {
echo 'tag not found' 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') { stage ('archiving') {
// Archive the build output artifacts. // 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) { def loadScript (String scriptName) {
load "tmp--jfiles/${scriptName}/Jenkinsfile" load "${JEN_FILES_TMP_NAME}/${scriptName}/Jenkinsfile"
} }
pipeline { pipeline {
@ -23,13 +23,17 @@ pipeline {
stage('processing') { stage('processing') {
steps { steps {
clean() clean()
clone('https://aaprimakov@bitbucket.org/jsadvance20201/jenkins', 'tmp--jfiles') clone(JENKINS_SCRIPTS_URL, JEN_FILES_TMP_NAME)
loadScript('stats') 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('publish')
loadScript('predeploy')
loadScript('clean-all') 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'
}