Skip to content

Commit 6e89f4d

Browse files
Merge pull request #11 from memphisdev/valeraBr-patch-1
Update Jenkinsfile
2 parents 5c2d113 + 48b44ca commit 6e89f4d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Jenkinsfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ def repoUrlPrefix = "memphisos"
55

66
node {
77
git credentialsId: 'main-github', url: gitURL, branch: gitBranch
8+
def versionTag = readFile "./version.conf"
89

910
try{
1011

@@ -19,6 +20,22 @@ node {
1920
sh "docker buildx use builder"
2021
sh "docker buildx build --push --tag ${repoUrlPrefix}/${imageName} --platform linux/amd64,linux/arm64 ."
2122
}
23+
24+
stage('checkout to version branch'){
25+
withCredentials([sshUserPrivateKey(keyFileVariable:'check',credentialsId: 'main-github')]) {
26+
sh "git reset --hard origin/latest"
27+
sh "GIT_SSH_COMMAND='ssh -i $check' git checkout -b ${versionTag}"
28+
sh "GIT_SSH_COMMAND='ssh -i $check' git push --set-upstream origin ${versionTag}"
29+
}
30+
}
31+
32+
stage('Create new release') {
33+
sh 'sudo yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo'
34+
sh 'sudo yum install gh -y'
35+
withCredentials([string(credentialsId: 'gh_token', variable: 'GH_TOKEN')]) {
36+
sh(script:"""gh release create \${versionTag} --generate-notes""", returnStdout: true)
37+
}
38+
}
2239

2340
notifySuccessful()
2441

0 commit comments

Comments
 (0)