ok no I think I got it fixed. Curl can't handle long parameters, e.g., a 2MB file.
All checks were successful
beefhavers/potterverse-wizards-are-morons/pipeline/head This commit looks good
All checks were successful
beefhavers/potterverse-wizards-are-morons/pipeline/head This commit looks good
This commit is contained in:
parent
010e42370f
commit
b3d11bf29d
21
Jenkinsfile
vendored
21
Jenkinsfile
vendored
@ -4,7 +4,7 @@ pipeline {
|
||||
environment {
|
||||
JENKINSONGITEA=credentials('d0e86441-2157-405f-8539-a9a9010c6ecf')
|
||||
JENKINSONMATRIXTOKEN=credentials('17d18fd7-29eb-4957-9532-ce42aaa9b4ec')
|
||||
MATRIX_ROOMID="//todo"
|
||||
MATRIX_ROOMID="!ViwVCXWvgsjFhMZlLX:greyn.club"
|
||||
GITEA_PROJECT="https://gitea.arg.rip/beefhavers/potterverse-wizards-are-morons"
|
||||
}
|
||||
stages {
|
||||
@ -12,17 +12,18 @@ pipeline {
|
||||
when { changeset "meta/avatar.png"}
|
||||
steps {
|
||||
script{
|
||||
env.avatar=sh(returnStdout: true, script: "base64 meta/avatar.png");
|
||||
//to gitea
|
||||
sh(returnStdout: true, script: """
|
||||
curl -X 'POST' \
|
||||
'https://gitea.arg.rip/api/v1/repos/beefhavers/potterverse-wizards-are-morons/avatar' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: token ${env.JENKINSONGITEA}' \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"image": "${env.avatar}"
|
||||
}'
|
||||
echo "{\"image\": \"\$(base64 --wrap=0 meta/avatar.png)\"}" > post.json
|
||||
|
||||
curl -X 'POST' \
|
||||
'https://gitea.arg.rip/api/v1/repos/beefhavers/potterverse-wizards-are-morons/avatar' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: token ${env.JENKINSONGITEA}' \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-binary post.json'
|
||||
|
||||
rm post.json
|
||||
""")
|
||||
|
||||
//to matrix
|
||||
|
Loading…
Reference in New Issue
Block a user