diff --git a/build/dev/Jenkinsfile b/build/dev/Jenkinsfile index 8a6ee39..33a5235 100644 --- a/build/dev/Jenkinsfile +++ b/build/dev/Jenkinsfile @@ -1,3 +1,3 @@ -stage ('production build') { +stage ('build') { sh 'npm run build' } diff --git a/clone/Jenkinsfile b/clone/Jenkinsfile deleted file mode 100644 index fd8b929..0000000 --- a/clone/Jenkinsfile +++ /dev/null @@ -1,4 +0,0 @@ -def loadApp(String addr) { - sh 'git clone ${addr} ./' - } -} diff --git a/install/details/Jenkinsfile b/install/details/Jenkinsfile new file mode 100644 index 0000000..0a16156 --- /dev/null +++ b/install/details/Jenkinsfile @@ -0,0 +1,4 @@ +stage('install') { + echo 'starting installing' + sh 'npm install -d' +} \ No newline at end of file diff --git a/predeploy/Jenkinsfile b/predeploy/Jenkinsfile index f517b3f..a0c197c 100644 --- a/predeploy/Jenkinsfile +++ b/predeploy/Jenkinsfile @@ -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() + 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}/*" + } } diff --git a/template b/template index d5921c9..d58f838 100644 --- a/template +++ b/template @@ -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') } } } } - diff --git a/tests/ts/Jenkinsfile b/tests/ts/Jenkinsfile new file mode 100644 index 0000000..e00fd98 --- /dev/null +++ b/tests/ts/Jenkinsfile @@ -0,0 +1,4 @@ +stage('unit tests') { + echo 'runing ts tests...' + sh 'npm run test:ts' +} \ No newline at end of file diff --git a/ui/Jenkinsfile b/tests/ui/Jenkinsfile similarity index 100% rename from ui/Jenkinsfile rename to tests/ui/Jenkinsfile diff --git a/unit/Jenkinsfile b/tests/unit/Jenkinsfile similarity index 100% rename from unit/Jenkinsfile rename to tests/unit/Jenkinsfile