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";
|
||||
} else {
|
||||
echo 'tag not found'
|
||||
sh "VERSION=master npm run build:prod"
|
||||
sh "VERSION=${branchName} npm run build:prod"
|
||||
}
|
||||
|
||||
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
|
||||
19
install/ci/Jenkinsfile
vendored
19
install/ci/Jenkinsfile
vendored
@@ -1,4 +1,19 @@
|
||||
stage('install:ci') {
|
||||
echo 'starting installing'
|
||||
sh 'npm 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'
|
||||
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') {
|
||||
echo 'checking tag'
|
||||
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()
|
||||
|
||||
if (tag) {
|
||||
echo 'found tag ' + tag
|
||||
println "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}"
|
||||
def tagNoV = tagModule.getTagNoV()
|
||||
sh "mkdir ${tagNoV}"
|
||||
sh "mv ${TARGET_FOLDER}/* ${tagNoV}"
|
||||
archiveArtifacts artifacts: "${tagNoV}/*/**"
|
||||
} else {
|
||||
echo 'tag not found'
|
||||
addBadge(
|
||||
icon: 'info.gif',
|
||||
text: "Сборка в master")
|
||||
sh "cd ${TARGET_FOLDER}; echo '${branchName}' > ${DEPLOY_VERSION_VAR}"
|
||||
text: "Сборка в ${branchName}")
|
||||
// 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}"
|
||||
archiveArtifacts artifacts: "${branchName}/*/**"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage ('archiving') {
|
||||
// Archive the build output artifacts.
|
||||
script {
|
||||
archiveArtifacts artifacts: "${TARGET_FOLDER}/*/**"
|
||||
}
|
||||
}
|
||||
// stage ('archiving') {
|
||||
// // Archive the build output artifacts.
|
||||
// script {
|
||||
// archiveArtifacts artifacts: "${TARGET_FOLDER}/*/**"
|
||||
// }
|
||||
// }
|
||||
|
||||
6
stats/Jenkinsfile
vendored
6
stats/Jenkinsfile
vendored
@@ -2,8 +2,8 @@ stage('stats') {
|
||||
echo 'checking node and npm versions'
|
||||
sh 'node -v'
|
||||
sh 'npm -v'
|
||||
sh 'ls -a'
|
||||
sh 'df -h'
|
||||
sh 'free -m'
|
||||
// sh 'ls -a'
|
||||
// sh 'df -h'
|
||||
// sh 'free -m'
|
||||
// sh 'vmstat -s'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user