Skip to content
Merged
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
17 changes: 11 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ node ("small-ec2-fleet") {
}

stage('Checkout to version branch'){
sh 'sudo yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo'
sh 'sudo yum install gh -y'
sh(script:"""cat setup.py | grep version | cut -d\\\' -f 2 > version.conf""", returnStdout: true)
sh """
sudo yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
sudo yum install gh -y
sed -i -r "s/version=\'[0-9].[0-9].[0-9]/version=\'\$(cat version.conf)/g" setup.py
sed -i -r "s/v[0-9].[0-9].[0-9]/v\$(cat version.conf)/g" setup.py
"""
withCredentials([sshUserPrivateKey(keyFileVariable:'check',credentialsId: 'main-github')]) {
sh "git reset --hard origin/latest"
sh "GIT_SSH_COMMAND='ssh -i $check' git checkout -b \$(cat version.conf)"
sh "GIT_SSH_COMMAND='ssh -i $check' git push --set-upstream origin \$(cat version.conf)"
sh """
git reset --hard origin/latest
GIT_SSH_COMMAND='ssh -i $check' git checkout -b \$(cat version.conf)
GIT_SSH_COMMAND='ssh -i $check' git push --set-upstream origin \$(cat version.conf)
"""
}
withCredentials([string(credentialsId: 'gh_token', variable: 'GH_TOKEN')]) {
sh(script:"""gh release create \$(cat version.conf) --generate-notes""", returnStdout: true)
Expand Down