diff --git a/Jenkinsfile b/Jenkinsfile index ac8374d..1bec92c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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