is that token right? who knows
Some checks failed
gitea.arg.rip/jenkins-playground/pipeline/head There was a failure building this commit
Some checks failed
gitea.arg.rip/jenkins-playground/pipeline/head There was a failure building this commit
This commit is contained in:
parent
a3c7dc6238
commit
10fd09d6eb
36
Jenkinsfile
vendored
36
Jenkinsfile
vendored
@ -9,6 +9,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
stage('build numberify'){
|
stage('build numberify'){
|
||||||
steps{
|
steps{
|
||||||
|
//sed -i 's/<Version>\\([0-9]\\+\\.[0-9]\\)\\.[0-9]\\+<\\/Version>/<Version>\\1.$BUILD_NUMBER<\\/Version>/' nugettest/nugettest.csproj
|
||||||
sh """
|
sh """
|
||||||
filename=\$(ls ./*.nupkg | head -1)
|
filename=\$(ls ./*.nupkg | head -1)
|
||||||
fullfilename=\$(basename -- \$filename)
|
fullfilename=\$(basename -- \$filename)
|
||||||
@ -22,8 +23,41 @@ pipeline {
|
|||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('publish package'){
|
stage('release'){
|
||||||
|
when {
|
||||||
|
branch "release"
|
||||||
|
}
|
||||||
steps{
|
steps{
|
||||||
|
sh """
|
||||||
|
filename=\$(ls ./*.nupkg | head -1)
|
||||||
|
fullfilename=\$(basename -- \$filename)
|
||||||
|
noext=\${fullfilename%.*}
|
||||||
|
curl -X 'POST' \
|
||||||
|
-o release.json
|
||||||
|
'https://gitea.arg.rip/api/v1/repos/greyn/jenkins-playground/releases?token=$0bd7c8f5-046c-44b9-9c77-7a28a219ae31' \
|
||||||
|
-H 'accept: application/json' \
|
||||||
|
-H 'Content-Type: application/json' \
|
||||||
|
-d '{
|
||||||
|
"body": "\$(date)",
|
||||||
|
"draft": false,
|
||||||
|
"name": "$BUILD_NUMBER",
|
||||||
|
"prerelease": false,
|
||||||
|
"tag_name": "$BUILD_NUMBER",
|
||||||
|
"target_commitish": "$GIT_COMMIT"
|
||||||
|
}'
|
||||||
|
releaseid=\$(cat release.json | jq .id)
|
||||||
|
|
||||||
|
curl -X 'POST' \
|
||||||
|
'https://gitea.arg.rip/api/v1/repos/greyn/jenkins-playground/releases/\$releaseid/assets?name=\$noext&token=$0bd7c8f5-046c-44b9-9c77-7a28a219ae31' \
|
||||||
|
-H 'accept: application/json' \
|
||||||
|
-H 'Content-Type: multipart/form-data' \
|
||||||
|
-F 'attachment=@\$fullfilename'
|
||||||
|
|
||||||
|
releaseid=null
|
||||||
|
filename=null
|
||||||
|
fullfilename=null
|
||||||
|
noext=null
|
||||||
|
"""
|
||||||
dotnetNuGetPush(root: "./*.nupkg", source:"greyngitea", skipDuplicate:true)
|
dotnetNuGetPush(root: "./*.nupkg", source:"greyngitea", skipDuplicate:true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user