This commit is contained in:
Primakov Alexandr Alexandrovich 2020-03-02 22:47:41 +03:00
parent b72fecbbec
commit 7d73129731
11 changed files with 76 additions and 61 deletions

View File

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

View File

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

5
clean-all/Jenkinsfile vendored Normal file
View File

@ -0,0 +1,5 @@
stage('clean-all') {
sh 'rm -rf .[!.]*'
sh 'rm -rf ./*'
sh 'ls -a'
}

2
install/Jenkinsfile vendored
View File

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

View File

@ -1,5 +1,4 @@
stage ('predeploy') {
steps {
echo 'checking tag'
script {
if (sh(returnStdout: true, script: "git tag --contains").trim()) {
@ -11,12 +10,9 @@ stage ('predeploy') {
sh "cd dist ; echo 'rm version.sh' > version.sh"
}
}
}
}
stage ('archiving') {
steps {
stage ('archiving') {
// Archive the build output artifacts.
archiveArtifacts artifacts: 'dist/*'
}
}
}

7
prepare/Jenkinsfile vendored
View File

@ -1,7 +0,0 @@
stage('prepare') {
steps {
sh 'rm -rf .[!.]*'
sh 'rm -rf ./*'
sh 'ls -a'
}
}

4
publish/Jenkinsfile vendored
View File

@ -1,14 +1,12 @@
stage ('publish') {
steps {
echo 'checking tag'
script {
def tag = sh(returnStdout: true, script: "git tag --contains").trim()
if (tag) {
echo 'found tag ' + tag
sh 'npm publish'
sh 'npm publish --access public'
} else {
echo 'tag not found'
}
}
}
}

2
stats/Jenkinsfile vendored
View File

@ -1,10 +1,8 @@
stage('stats') {
steps {
sh 'node -v'
sh 'npm -v'
sh 'ls -a'
sh 'df -h'
sh 'free -m'
sh 'vmstat -s'
}
}

35
template Normal file
View File

@ -0,0 +1,35 @@
def clean () {
sh 'rm -rf .[!.]*'
sh 'rm -rf ./*'
sh 'ls -a'
}
def clone (String repoPath, String folder) {
echo 'cloning...'
sh "git clone ${repoPath}.git tmp"
sh "mkdir -p ${folder}"
sh "mv ./tmp/* ./${folder}"
sh "mv ./tmp/.[!.]* ./${folder}"
}
def loadScript (String scriptName) {
load "tmp--jfiles/${scriptName}/Jenkinsfile"
}
pipeline {
agent any
stages {
stage('processing') {
steps {
clean()
clone('https://aaprimakov@bitbucket.org/jsadvance20201/jenkins', 'tmp--jfiles')
loadScript('stats')
clone('https://aaprimakov@bitbucket.org/jsadvance20201/dev-server', './')
loadScript('publish')
loadScript('clean-all')
}
}
}
}

2
ui/Jenkinsfile vendored
View File

@ -1,6 +1,4 @@
stage('ui tests') {
steps {
echo 'ui tests'
sh 'npm run test:ui'
}
}

2
unit/Jenkinsfile vendored
View File

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