Created
March 18, 2020 17:04
-
-
Save rajesh-gonuguntla/fddbcbe09d7dbb9ebd1c8fce7cfa8cb0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GITHUB_PROJECT = “https://github.com/zagadishreddy/game-of-life.git” | |
GITHUB_CREDENTIALS_ID = “Telcel” //maps to a Jenkins Credentials Vault ID | |
APPLICATION_NAME = “Telcel” | |
GITHUB_BRANCH = ‘${env.BRANCH_NAME}’ | |
node{ | |
// Stages | |
stage (“Listing Branches”) { | |
echo “Initializing workflow” | |
//checkout code | |
echo GITHUB_PROJECT | |
git url: GITHUB_PROJECT, credentialsId: GITHUB_CREDENTIALS_ID | |
sh ‘git branch -r | awk \'{print $1}\’ ORS=\’\\n\’ >branches.txt’ | |
sh ”’cut -d ‘/’ -f 2 branches.txt > branch.txt”’ | |
//sh “sed s’/origin”\’///g branches.txt > branch.tx” | |
//sed ‘s/$/from S0 to S1/’ | |
} | |
stage(‘get build branch Parameter User Input’) { | |
liste = readFile ‘branch.txt’ | |
echo “please click on the link here to chose the branch to build” | |
env.BRANCH_SCOPE = input message: ‘Please choose the branch to build ‘, ok: ‘Validate!’, | |
parameters: [choice(name: ‘BRANCH_NAME’, choices: “${liste}”, description: ‘Branch to build?’)] | |
} | |
stage(‘Checkout external proj’) { | |
echo “${env.BRANCH_SCOPE}” | |
git branch: “${env.BRANCH_SCOPE}”, | |
credentialsId: ‘Telcel’, | |
url: ‘https://github.com/zagadishreddy/game-of-life.git’ | |
sh “ls -lat” | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment