|
@@ -26,7 +26,7 @@ pipeline {
|
|
stages {
|
|
stages {
|
|
stage("SVN Checkout") {
|
|
stage("SVN Checkout") {
|
|
steps {
|
|
steps {
|
|
- sh """svn cleanup analis
|
|
|
|
|
|
+ sh """[ -d analis/.svn ] && svn cleanup analis
|
|
svn co --force --no-auth-cache svn://192.168.21.250/programs/trunk/Services/Analis/Win32 analis --username public --password "sds#7753435"
|
|
svn co --force --no-auth-cache svn://192.168.21.250/programs/trunk/Services/Analis/Win32 analis --username public --password "sds#7753435"
|
|
"""
|
|
"""
|
|
}
|
|
}
|
|
@@ -35,7 +35,7 @@ pipeline {
|
|
steps {
|
|
steps {
|
|
script {
|
|
script {
|
|
// Discover revision number
|
|
// Discover revision number
|
|
- REV_NUMBER=sh(returnStdout: true, script: 'docker run --rm -v $(pwd):/repository registry.sdsys.ru/alpine-svn:0.3 info --show-item last-changed-revision analis').trim
|
|
|
|
|
|
+ REV_NUMBER=sh (script: "svn info --show-item last-changed-revision analis", returnStdout: true ).trim()
|
|
echo "Last-Changed-Revision number is '$REV_NUMBER'"
|
|
echo "Last-Changed-Revision number is '$REV_NUMBER'"
|
|
}
|
|
}
|
|
sh "docker build -t ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${REV_NUMBER}-${BUILD_NUMBER} ."
|
|
sh "docker build -t ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${REV_NUMBER}-${BUILD_NUMBER} ."
|
|
@@ -51,9 +51,10 @@ pipeline {
|
|
stage("Tagging"){
|
|
stage("Tagging"){
|
|
steps{
|
|
steps{
|
|
withCredentials([sshUserPrivateKey(credentialsId: 'provision', keyFileVariable: 'GIT_SSH_KEY', passphraseVariable: '', usernameVariable: 'GIT_SSH_USERNAME')]) {
|
|
withCredentials([sshUserPrivateKey(credentialsId: 'provision', keyFileVariable: 'GIT_SSH_KEY', passphraseVariable: '', usernameVariable: 'GIT_SSH_USERNAME')]) {
|
|
- sh """GIT_SSH_COMMAND='ssh -i ${GIT_SSH_KEY} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' \
|
|
|
|
|
|
+ sh """[ -d ${SWARM_GIT_NAME} ] && rm -rf ${SWARM_GIT_NAME}
|
|
|
|
+ GIT_SSH_COMMAND='ssh -i ${GIT_SSH_KEY} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' \
|
|
git clone ${SWARM_GIT_URL}
|
|
git clone ${SWARM_GIT_URL}
|
|
- pushd ${SWARM_GIT_NAME}
|
|
|
|
|
|
+ cd ${SWARM_GIT_NAME}
|
|
echo -n ${REV_NUMBER}-${BUILD_NUMBER} > tags/${DOCKER_IMAGE}.build-version
|
|
echo -n ${REV_NUMBER}-${BUILD_NUMBER} > tags/${DOCKER_IMAGE}.build-version
|
|
git add -A
|
|
git add -A
|
|
git config --global user.email "${JENKINS_MAIL}"
|
|
git config --global user.email "${JENKINS_MAIL}"
|
|
@@ -61,7 +62,7 @@ pipeline {
|
|
git commit -m "Version update tags/lab/${DOCKER_IMAGE}.build-version = ${REV_NUMBER}-${BUILD_NUMBER}"
|
|
git commit -m "Version update tags/lab/${DOCKER_IMAGE}.build-version = ${REV_NUMBER}-${BUILD_NUMBER}"
|
|
GIT_SSH_COMMAND='ssh -i ${GIT_SSH_KEY} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' \
|
|
GIT_SSH_COMMAND='ssh -i ${GIT_SSH_KEY} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' \
|
|
git push origin master
|
|
git push origin master
|
|
- popd
|
|
|
|
|
|
+ cd ..
|
|
rm -rf ${SWARM_GIT_NAME}
|
|
rm -rf ${SWARM_GIT_NAME}
|
|
ls"""
|
|
ls"""
|
|
}
|
|
}
|