From 62a24aa94d04ccb1d2cd96008ecbd6fc55cd6e6d Mon Sep 17 00:00:00 2001 From: Keshav Prasad Date: Fri, 5 Mar 2021 13:51:11 +0530 Subject: [PATCH] fix: updated jenkins file for new build process (#95) * fix: updating jenkins build as per new format * fix: removed unused JF --- .../pipelines/sunbird-auth-build/Jenkinsfile | 17 +++--------- .../SunbirdAuthBuildJenkinsfile.dev | 26 ------------------- 2 files changed, 3 insertions(+), 40 deletions(-) delete mode 100644 keycloak/scripts/pipelines/sunbird-auth-build/SunbirdAuthBuildJenkinsfile.dev diff --git a/keycloak/scripts/pipelines/sunbird-auth-build/Jenkinsfile b/keycloak/scripts/pipelines/sunbird-auth-build/Jenkinsfile index bc17b9ea..57240515 100644 --- a/keycloak/scripts/pipelines/sunbird-auth-build/Jenkinsfile +++ b/keycloak/scripts/pipelines/sunbird-auth-build/Jenkinsfile @@ -9,23 +9,12 @@ node('build-slave') { ansiColor('xterm') { stage('Checkout') { cleanWs() - def scmVars = checkout scm - if (params.github_release_tag == "") { - checkout scm - commit_hash = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim() - branch_name = sh(script: 'git name-rev --name-only HEAD | rev | cut -d "/" -f1| rev', returnStdout: true).trim() - artifact_version = branch_name + "_" + commit_hash - println(ANSI_BOLD + ANSI_YELLOW + "github_release_tag not specified, using the latest commit hash: " + commit_hash + ANSI_NORMAL) - } - else { - checkout scm: [$class: 'GitSCM', branches: [[name: "refs/tags/${params.github_release_tag}"]], userRemoteConfigs: [[url: scmVars.GIT_URL]]] - artifact_version = params.github_release_tag - println(ANSI_BOLD + ANSI_YELLOW + "github_release_tag specified, building from: " + params.github_release_tag + ANSI_NORMAL) - } + checkout scm + commit_hash = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim() + artifact_version = sh(script: "echo " + params.github_release_tag.split('/')[-1] + "_" + commit_hash + "_" + env.BUILD_NUMBER, returnStdout: true).trim() echo "artifact_version: "+ artifact_version } - stage('Build') { sh """ mkdir sunbird_auth_1.0v diff --git a/keycloak/scripts/pipelines/sunbird-auth-build/SunbirdAuthBuildJenkinsfile.dev b/keycloak/scripts/pipelines/sunbird-auth-build/SunbirdAuthBuildJenkinsfile.dev deleted file mode 100644 index 1a88ca0d..00000000 --- a/keycloak/scripts/pipelines/sunbird-auth-build/SunbirdAuthBuildJenkinsfile.dev +++ /dev/null @@ -1,26 +0,0 @@ -#!groovy - -node('build-slave') { - - currentBuild.result = "SUCCESS" - - try { - - stage('checkout') { - checkout scm - } - - stage('Build'){ - sh('cd keycloak/scripts/ansible && ansible-playbook sunbird-auth-build.yml --limit localhost -vv') - } - - stage('Archive'){ - // sh('cp sunbird-devops/ansible/sunbird_auth_1.0v.zip .') - archiveArtifacts('sunbird_auth_1.0v.zip'); - } - } - catch (err) { - currentBuild.result = "FAILURE" - throw err - } -}