Compare commits
15 Commits
3f690a6b74
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
815a3d8838 | ||
|
|
c7b1b2fdf3 | ||
|
|
d474d02217 | ||
|
|
3529316fdd | ||
|
|
9cc5f2734b | ||
|
|
9bccd1f0a1 | ||
|
|
3d902f7a67 | ||
| c5a16dd2c3 | |||
| ecbdbfc291 | |||
| da048592da | |||
| a19826ea49 | |||
| e1b4dcfb51 | |||
| b39f5d8708 | |||
| a3b99ccd20 | |||
| 5e7df3b8b3 |
2
build/prod/Jenkinsfile
vendored
2
build/prod/Jenkinsfile
vendored
@@ -9,7 +9,7 @@ stage ('production build') {
|
|||||||
sh "VERSION=${tagNoV} npm run build:prod";
|
sh "VERSION=${tagNoV} npm run build:prod";
|
||||||
} else {
|
} else {
|
||||||
echo 'tag not found'
|
echo 'tag not found'
|
||||||
sh "VERSION=master npm run build:prod"
|
sh "VERSION=${branchName} npm run build:prod"
|
||||||
}
|
}
|
||||||
|
|
||||||
sh 'ls dist';
|
sh 'ls dist';
|
||||||
|
|||||||
5
groovy/deploy.groovy
Normal file
5
groovy/deploy.groovy
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
def deploy(String versionName, String staticFolderName, String sshConfigName = 'bro-js-static') {
|
||||||
|
sshPublisher(publishers: [sshPublisherDesc(configName: sshConfigName, transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: '', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: staticFolderName, remoteDirectorySDF: false, removePrefix: '', sourceFiles: "${versionName}/**")], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: true)])
|
||||||
|
}
|
||||||
|
|
||||||
|
return this
|
||||||
12
groovy/tag.groovy
Normal file
12
groovy/tag.groovy
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
String tag = ''
|
||||||
|
|
||||||
|
def calcTag() {
|
||||||
|
tag = sh(returnStdout: true, script: "git tag --contains").trim()
|
||||||
|
return tag
|
||||||
|
}
|
||||||
|
|
||||||
|
def getTagNoV() {
|
||||||
|
return tag.substring(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
return this
|
||||||
17
install/ci/Jenkinsfile
vendored
17
install/ci/Jenkinsfile
vendored
@@ -1,4 +1,19 @@
|
|||||||
stage('install:ci') {
|
stage('install:ci') {
|
||||||
|
def tag = sh(returnStdout: true, script: "git tag --contains").trim()
|
||||||
|
def branchName = sh(returnStdout: true, script: "git rev-parse --abbrev-ref HEAD").trim()
|
||||||
|
def commit = sh(returnStdout: true, script: 'git log -1 --oneline').trim()
|
||||||
|
String commitMsg = commit.substring( commit.indexOf(' ') ).trim()
|
||||||
|
def lastLog = sh(returnStdout: true, script: "git log -1").trim()
|
||||||
|
if (tag) {
|
||||||
|
currentBuild.displayName = "#${BUILD_NUMBER}, tag ${tag}"
|
||||||
|
} else {
|
||||||
|
currentBuild.displayName = "#${BUILD_NUMBER}, branch ${branchName}"
|
||||||
|
}
|
||||||
|
|
||||||
|
String author = sh(returnStdout: true, script: "git log -1 --pretty=format:'%an'").trim()
|
||||||
|
currentBuild.description = "${author}<br />${commitMsg}"
|
||||||
|
// currentBuild.description = "#${BUILD_NUMBER}, branch ${branchName}, tag ${tag ? tag : 'no tag'}\n\n${lastLog}"
|
||||||
echo 'starting installing'
|
echo 'starting installing'
|
||||||
sh 'npm ci'
|
sh "pwd"
|
||||||
|
sh 'npm ci --progress=false --loglevel=error --fetch-retries=3'
|
||||||
}
|
}
|
||||||
64
predeploy/Jenkinsfile
vendored
64
predeploy/Jenkinsfile
vendored
@@ -1,31 +1,69 @@
|
|||||||
|
// stage ('predeploy') {
|
||||||
|
// echo 'checking tag'
|
||||||
|
// script {
|
||||||
|
// def tag = sh(returnStdout: true, script: "git tag --contains").trim()
|
||||||
|
// def branchName = sh(returnStdout: true, script: "git rev-parse --abbrev-ref HEAD").trim()
|
||||||
|
|
||||||
|
// if (tag) {
|
||||||
|
// echo 'found tag ' + tag
|
||||||
|
// addBadge(
|
||||||
|
// icon: 'completed.gif',
|
||||||
|
// text: "Release ${tag}")
|
||||||
|
// def tagNoV = tag.substring(1)
|
||||||
|
// sh "cd ${TARGET_FOLDER}; echo '${tagNoV}' > ${DEPLOY_VERSION_VAR}";
|
||||||
|
// // sh "cd ${TARGET_FOLDER} ; echo 'mkdir ${tagNoV}; mv ./${branchName}/* ./${tagNoV}; rm -r -d ./${branchName}; rm ${DEPLOY_VERSION_VAR}' > ${DEPLOY_VERSION_VAR}"
|
||||||
|
// } else {
|
||||||
|
// echo 'tag not found'
|
||||||
|
// addBadge(
|
||||||
|
// icon: 'info.gif',
|
||||||
|
// text: "Сборка в master")
|
||||||
|
// sh "cd ${TARGET_FOLDER}; echo '${branchName}' > ${DEPLOY_VERSION_VAR}"
|
||||||
|
// // sh "cd ${TARGET_FOLDER} ; echo 'rm ${DEPLOY_VERSION_VAR}' > ${DEPLOY_VERSION_VAR}"
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// stage ('archiving') {
|
||||||
|
// // Archive the build output artifacts.
|
||||||
|
// script {
|
||||||
|
// archiveArtifacts artifacts: "${TARGET_FOLDER}/*/**"
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
def tagModule = load "${JEN_FILES_TMP_NAME}/groovy/tag.groovy"
|
||||||
|
|
||||||
stage ('predeploy') {
|
stage ('predeploy') {
|
||||||
echo 'checking tag'
|
echo 'checking tag'
|
||||||
script {
|
script {
|
||||||
def tag = sh(returnStdout: true, script: "git tag --contains").trim()
|
tag = tagModule.calcTag()
|
||||||
def branchName = sh(returnStdout: true, script: "git rev-parse --abbrev-ref HEAD").trim()
|
def branchName = sh(returnStdout: true, script: "git rev-parse --abbrev-ref HEAD").trim()
|
||||||
|
|
||||||
if (tag) {
|
if (tag) {
|
||||||
echo 'found tag ' + tag
|
println "found tag ${tag}"
|
||||||
addBadge(
|
addBadge(
|
||||||
icon: 'completed.gif',
|
icon: 'completed.gif',
|
||||||
text: "Release ${tag}")
|
text: "Release ${tag}")
|
||||||
def tagNoV = tag.substring(1)
|
def tagNoV = tagModule.getTagNoV()
|
||||||
sh "cd ${TARGET_FOLDER}; echo '${tagNoV}' > ${DEPLOY_VERSION_VAR}";
|
sh "mkdir ${tagNoV}"
|
||||||
// sh "cd ${TARGET_FOLDER} ; echo 'mkdir ${tagNoV}; mv ./${branchName}/* ./${tagNoV}; rm -r -d ./${branchName}; rm ${DEPLOY_VERSION_VAR}' > ${DEPLOY_VERSION_VAR}"
|
sh "mv ${TARGET_FOLDER}/* ${tagNoV}"
|
||||||
|
archiveArtifacts artifacts: "${tagNoV}/*/**"
|
||||||
} else {
|
} else {
|
||||||
echo 'tag not found'
|
echo 'tag not found'
|
||||||
addBadge(
|
addBadge(
|
||||||
icon: 'info.gif',
|
icon: 'info.gif',
|
||||||
text: "Сборка в master")
|
text: "Сборка в ${branchName}")
|
||||||
sh "cd ${TARGET_FOLDER}; echo '${branchName}' > ${DEPLOY_VERSION_VAR}"
|
// sh "cd ${TARGET_FOLDER}; echo '${branchName}' > ${DEPLOY_VERSION_VAR}"
|
||||||
|
sh "mkdir ${branchName}"
|
||||||
|
sh "mv ${TARGET_FOLDER}/* ${branchName}"
|
||||||
// sh "cd ${TARGET_FOLDER} ; echo 'rm ${DEPLOY_VERSION_VAR}' > ${DEPLOY_VERSION_VAR}"
|
// sh "cd ${TARGET_FOLDER} ; echo 'rm ${DEPLOY_VERSION_VAR}' > ${DEPLOY_VERSION_VAR}"
|
||||||
|
archiveArtifacts artifacts: "${branchName}/*/**"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage ('archiving') {
|
// stage ('archiving') {
|
||||||
// Archive the build output artifacts.
|
// // Archive the build output artifacts.
|
||||||
script {
|
// script {
|
||||||
archiveArtifacts artifacts: "${TARGET_FOLDER}/*/**"
|
// archiveArtifacts artifacts: "${TARGET_FOLDER}/*/**"
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|||||||
6
stats/Jenkinsfile
vendored
6
stats/Jenkinsfile
vendored
@@ -2,8 +2,8 @@ stage('stats') {
|
|||||||
echo 'checking node and npm versions'
|
echo 'checking node and npm versions'
|
||||||
sh 'node -v'
|
sh 'node -v'
|
||||||
sh 'npm -v'
|
sh 'npm -v'
|
||||||
sh 'ls -a'
|
// sh 'ls -a'
|
||||||
sh 'df -h'
|
// sh 'df -h'
|
||||||
sh 'free -m'
|
// sh 'free -m'
|
||||||
// sh 'vmstat -s'
|
// sh 'vmstat -s'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user