Skip to content

[DO NOT MERGE] Featureimage/obs to mbt #170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: release/IPM-2.5.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 8 additions & 43 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

pipeline {
agent {
label infra.getAgentLabels()
docker {
label 'docker-dev-1'
image infra.getDockerAgentImage()
args '--entrypoint=/startup.sh --oom-score-adj=100 -v /opt/cov:/opt/cov:ro -v /etc/ssh/id_rsa_git-proxy-cache:/etc/ssh/id_rsa_git-proxy-cache:ro -v /etc/ssh/ssh_config:/etc/ssh/ssh_config:ro -v /etc/gitconfig:/etc/gitconfig:ro'
}
}
parameters {
// Use DEFAULT_DEPLOY_BRANCH_PATTERN and DEFAULT_DEPLOY_JOB_NAME if
Expand Down Expand Up @@ -102,7 +106,6 @@ pipeline {
// record that a particular commit is being processed, but the explicit ways
// might work better. In either case it honors SCM settings like refrepo if
// set up in the Pipeline or MultiBranchPipeline job.
skipDefaultCheckout()
}
// Note: your Jenkins setup may benefit from similar setup on side of agents:
// PATH="/usr/lib64/ccache:/usr/lib/ccache:/usr/bin:/bin:${PATH}"
Expand All @@ -120,15 +123,6 @@ pipeline {
}
}

stage ('git') {
steps {
retry(3) {
checkout scm
}
milestone ordinal: 30, label: "${env.JOB_NAME}@${env.BRANCH_NAME}"
}
}

stage ('prepare') {
steps {
sh './autogen.sh'
Expand Down Expand Up @@ -614,40 +608,11 @@ OUT="`git status -s`" && [ -z "\$OUT" ] \\
}
} // Commit Coverity

stage ('deploy if appropriate') {
stage ('deploy') {
steps {
script {
def myDEPLOY_JOB_NAME = sh(returnStdout: true, script: """echo "${params["DEPLOY_JOB_NAME"]}" """).trim();
def myDEPLOY_BRANCH_PATTERN = sh(returnStdout: true, script: """echo "${params["DEPLOY_BRANCH_PATTERN"]}" """).trim();
def myDEPLOY_REPORT_RESULT = sh(returnStdout: true, script: """echo "${params["DEPLOY_REPORT_RESULT"]}" """).trim().toBoolean();
echo "Original: DEPLOY_JOB_NAME : ${params["DEPLOY_JOB_NAME"]} DEPLOY_BRANCH_PATTERN : ${params["DEPLOY_BRANCH_PATTERN"]} DEPLOY_REPORT_RESULT : ${params["DEPLOY_REPORT_RESULT"]}"
echo "Used: myDEPLOY_JOB_NAME:${myDEPLOY_JOB_NAME} myDEPLOY_BRANCH_PATTERN:${myDEPLOY_BRANCH_PATTERN} myDEPLOY_REPORT_RESULT:${myDEPLOY_REPORT_RESULT}"
if ( (myDEPLOY_JOB_NAME != "") && (myDEPLOY_BRANCH_PATTERN != "") ) {
if ( env.BRANCH_NAME =~ myDEPLOY_BRANCH_PATTERN ) {
def GIT_URL = sh(returnStdout: true, script: """git remote -v | egrep '^origin' | awk '{print \$2}' | head -1""").trim()
def GIT_COMMIT = sh(returnStdout: true, script: 'git rev-parse --verify HEAD').trim()
def DIST_ARCHIVE = ""
def msg = "Would deploy ${GIT_URL} ${GIT_COMMIT} because tested branch '${env.BRANCH_NAME}' matches filter '${myDEPLOY_BRANCH_PATTERN}'"
if ( params.DO_DIST_DOCS ) {
DIST_ARCHIVE = env.BUILD_URL + "artifact/__dist.tar.gz"
msg += ", using dist archive '${DIST_ARCHIVE}' to speed up deployment"
}
echo msg
//milestone ordinal: 100, label: "${env.JOB_NAME}@${env.BRANCH_NAME}"
build job: "${myDEPLOY_JOB_NAME}", parameters: [
string(name: 'DEPLOY_GIT_URL', value: "${GIT_URL}"),
string(name: 'DEPLOY_GIT_BRANCH', value: env.BRANCH_NAME),
string(name: 'DEPLOY_GIT_COMMIT', value: "${GIT_COMMIT}"),
string(name: 'DEPLOY_DIST_ARCHIVE', value: "${DIST_ARCHIVE}")
], quietPeriod: 0, wait: myDEPLOY_REPORT_RESULT, propagate: myDEPLOY_REPORT_RESULT
} else {
echo "Not deploying because branch '${env.BRANCH_NAME}' did not match filter '${myDEPLOY_BRANCH_PATTERN}'"
}
} else {
echo "Not deploying because deploy-job parameters are not set"
}

manager.addShortText("Processing of push to packaging completed")
deploy.pushToOBS()
manager.addShortText("Pushed to OBS")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion obs/debian.rules
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ endif
DEB_CONFIGURE_EXTRA_FLAGS+=--with-doc=man=dist-auto

configure: configure.ac
(cd tools; python nut-snmpinfo.py)
#(cd tools; python nut-snmpinfo.py)
sh autogen.sh

pre-build:: debian/compat configure
Expand Down