From 9d49b54d30e7cb538abd3a5067259d1d5b8195db Mon Sep 17 00:00:00 2001 From: spark-store Date: Mon, 19 Apr 2021 19:28:05 +0000 Subject: [PATCH 01/36] Added Jenkinsfile --- Jenkinsfile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..06a5afc6 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,17 @@ +pipeline { + agent any + stages { + stage('') { + agent { + docker { + image 'jerry979/dtke:5.11' + } + + } + steps { + sh 'mkdir build && cd build && qmake .. && make -j' + } + } + + } +} \ No newline at end of file -- Gitee From ebb12b7072ea06c693abb97874b09845123f5284 Mon Sep 17 00:00:00 2001 From: spark-store Date: Mon, 19 Apr 2021 19:39:05 +0000 Subject: [PATCH 02/36] Added Jenkinsfile --- Jenkinsfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 06a5afc6..fcf6940e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,7 @@ pipeline { agent any stages { - stage('') { + stage('build') { agent { docker { image 'jerry979/dtke:5.11' @@ -13,5 +13,11 @@ pipeline { } } + stage('ar') { + steps { + archiveArtifacts 'build/src/spark-store' + } + } + } } \ No newline at end of file -- Gitee From cfd323cff0d3719ef49d9b3fc87503d4784caa71 Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 03:41:41 +0800 Subject: [PATCH 03/36] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=97=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fonts/hksnzt.ttf | Bin assets/icons.qrc | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename "assets/fonts/\345\215\216\345\272\267\345\260\221\345\245\263\345\255\227\344\275\223.ttf" => assets/fonts/hksnzt.ttf (100%) diff --git "a/assets/fonts/\345\215\216\345\272\267\345\260\221\345\245\263\345\255\227\344\275\223.ttf" b/assets/fonts/hksnzt.ttf similarity index 100% rename from "assets/fonts/\345\215\216\345\272\267\345\260\221\345\245\263\345\255\227\344\275\223.ttf" rename to assets/fonts/hksnzt.ttf diff --git a/assets/icons.qrc b/assets/icons.qrc index 6c797cbe..9c8ed019 100644 --- a/assets/icons.qrc +++ b/assets/icons.qrc @@ -64,6 +64,6 @@ tags/dwine2-small.png - fonts/华康少女字体.ttf + fonts/hksnzt.ttf -- Gitee From cb14f5cf0ff3b8deccd8132cf349ecb514be80ae Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 03:46:22 +0800 Subject: [PATCH 04/36] =?UTF-8?q?=E4=B8=8D=E4=BD=BF=E7=94=A8=20make=20-j?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index fcf6940e..9133a26b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,7 +9,7 @@ pipeline { } steps { - sh 'mkdir build && cd build && qmake .. && make -j' + sh 'mkdir build && cd build && qmake .. && make ' } } -- Gitee From b9a95f817bdd97f964ed941d17e4c892cbe48bdc Mon Sep 17 00:00:00 2001 From: spark-store Date: Mon, 19 Apr 2021 19:48:33 +0000 Subject: [PATCH 05/36] Added Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9133a26b..d5c20bb0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,7 +15,7 @@ pipeline { stage('ar') { steps { - archiveArtifacts 'build/src/spark-store' + archiveArtifacts 'src/spark-store' } } -- Gitee From 340ef75542eedbdd47e215bdfaa079b444f676ae Mon Sep 17 00:00:00 2001 From: spark-store Date: Mon, 19 Apr 2021 19:53:27 +0000 Subject: [PATCH 06/36] Added Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d5c20bb0..33fb893e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,7 +15,7 @@ pipeline { stage('ar') { steps { - archiveArtifacts 'src/spark-store' + archiveArtifacts(artifacts: 'build/src/spark-store', allowEmptyArchive: true, defaultExcludes: true) } } -- Gitee From 1910d6c9048c919dce31d8183ebd7c0aeae4ee3c Mon Sep 17 00:00:00 2001 From: spark-store Date: Mon, 19 Apr 2021 19:56:46 +0000 Subject: [PATCH 07/36] Added Jenkinsfile --- Jenkinsfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 33fb893e..04451f42 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,11 +10,6 @@ pipeline { } steps { sh 'mkdir build && cd build && qmake .. && make ' - } - } - - stage('ar') { - steps { archiveArtifacts(artifacts: 'build/src/spark-store', allowEmptyArchive: true, defaultExcludes: true) } } -- Gitee From bd26c662e60528c62718c466571f81414c56125d Mon Sep 17 00:00:00 2001 From: spark-store Date: Mon, 19 Apr 2021 20:17:18 +0000 Subject: [PATCH 08/36] Added Jenkinsfile --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 04451f42..8c97d579 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,6 +11,7 @@ pipeline { steps { sh 'mkdir build && cd build && qmake .. && make ' archiveArtifacts(artifacts: 'build/src/spark-store', allowEmptyArchive: true, defaultExcludes: true) + addGiteeMRComment(comment: 'hello') } } -- Gitee From cf983c0498523003cdcb55a7b74ff64c84f051bb Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 04:57:09 +0800 Subject: [PATCH 09/36] update --- .gitee/Dockerfile | 2 ++ .gitee/callback.py | 13 +++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 .gitee/Dockerfile create mode 100644 .gitee/callback.py diff --git a/.gitee/Dockerfile b/.gitee/Dockerfile new file mode 100644 index 00000000..a5d6f02c --- /dev/null +++ b/.gitee/Dockerfile @@ -0,0 +1,2 @@ +FROM Python:3 +pip3 install requests \ No newline at end of file diff --git a/.gitee/callback.py b/.gitee/callback.py new file mode 100644 index 00000000..e10070e0 --- /dev/null +++ b/.gitee/callback.py @@ -0,0 +1,13 @@ +import os +import requests + +owner="deepin-community-store" +repo="spark-store" +# sha=os.system("git rev-parse HEAD") +sha = os.getenv("GIT_COMMIT") +#get sha from environment +url = "https://gitee.com/api/v5/repos/" + owner + "/"+repo+ "/commits/"+ "/comments" + +body = "hello world" + +res = requests.post(url,data=body) \ No newline at end of file -- Gitee From 989d7e2b76ccc67fe93cf948dedd7fe28d22f604 Mon Sep 17 00:00:00 2001 From: spark-store Date: Mon, 19 Apr 2021 21:00:59 +0000 Subject: [PATCH 10/36] Added Jenkinsfile --- Jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 8c97d579..5c7574ab 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,6 +8,9 @@ pipeline { } } + environment { + token = 'credentials("1")' + } steps { sh 'mkdir build && cd build && qmake .. && make ' archiveArtifacts(artifacts: 'build/src/spark-store', allowEmptyArchive: true, defaultExcludes: true) -- Gitee From efaaad2d6c609debd004b4660a6c00235faf93eb Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 05:03:59 +0800 Subject: [PATCH 11/36] update --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5c7574ab..fbe5084c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,7 +9,7 @@ pipeline { } environment { - token = 'credentials("1")' + gitee_token = credentials("1") } steps { sh 'mkdir build && cd build && qmake .. && make ' -- Gitee From a3d83fda5dbf1b8e52c5a59b7144078491008950 Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 05:05:10 +0800 Subject: [PATCH 12/36] 1 --- .gitee/callback.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitee/callback.py b/.gitee/callback.py index e10070e0..ab440f2a 100644 --- a/.gitee/callback.py +++ b/.gitee/callback.py @@ -8,6 +8,10 @@ sha = os.getenv("GIT_COMMIT") #get sha from environment url = "https://gitee.com/api/v5/repos/" + owner + "/"+repo+ "/commits/"+ "/comments" -body = "hello world" +d = { + 'access_token': os.getenv("gitee_token"), + "body": 'hello world' +} -res = requests.post(url,data=body) \ No newline at end of file + +res = requests.post(url,data=d) \ No newline at end of file -- Gitee From c8f16c2e38f3fcbc47543491c47bf8d6f3016924 Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 05:05:59 +0800 Subject: [PATCH 13/36] up --- .gitee/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitee/Dockerfile b/.gitee/Dockerfile index a5d6f02c..8f6a530b 100644 --- a/.gitee/Dockerfile +++ b/.gitee/Dockerfile @@ -1,2 +1,2 @@ FROM Python:3 -pip3 install requests \ No newline at end of file +RUN pip3 install requests \ No newline at end of file -- Gitee From a7e43975da262f58d8f6112b2c33e8e9584b07e2 Mon Sep 17 00:00:00 2001 From: spark-store Date: Mon, 19 Apr 2021 21:06:07 +0000 Subject: [PATCH 14/36] Added Jenkinsfile --- Jenkinsfile | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fbe5084c..cdd29830 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,12 +9,23 @@ pipeline { } environment { - gitee_token = credentials("1") + gitee_token = credentials('1') } steps { sh 'mkdir build && cd build && qmake .. && make ' archiveArtifacts(artifacts: 'build/src/spark-store', allowEmptyArchive: true, defaultExcludes: true) - addGiteeMRComment(comment: 'hello') + } + } + + stage('send') { + agent { + dockerfile { + filename '.gitee/Dockerfile' + } + + } + steps { + sh 'python3 .gitee/callback.py' } } -- Gitee From a003df4f21675b09316e0b8a04611d7a80b5fd5b Mon Sep 17 00:00:00 2001 From: spark-store Date: Mon, 19 Apr 2021 21:09:35 +0000 Subject: [PATCH 15/36] Added Jenkinsfile --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index cdd29830..cbffa37b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,9 +8,6 @@ pipeline { } } - environment { - gitee_token = credentials('1') - } steps { sh 'mkdir build && cd build && qmake .. && make ' archiveArtifacts(artifacts: 'build/src/spark-store', allowEmptyArchive: true, defaultExcludes: true) @@ -24,6 +21,9 @@ pipeline { } } + environment { + gitee_token = '17978b8794a0b452fefbfb6be28dfb02' + } steps { sh 'python3 .gitee/callback.py' } -- Gitee From 78f1d339e6b185e710ea22d83f7f73653b6abfb8 Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 05:12:40 +0800 Subject: [PATCH 16/36] debug --- .gitee/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitee/Dockerfile b/.gitee/Dockerfile index 8f6a530b..89c525f9 100644 --- a/.gitee/Dockerfile +++ b/.gitee/Dockerfile @@ -1,2 +1,2 @@ -FROM Python:3 +FROM [ython:3 RUN pip3 install requests \ No newline at end of file -- Gitee From e24fbb3abcc596d6196fc705c3a2f7b69c59d8b0 Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 05:15:04 +0800 Subject: [PATCH 17/36] debug --- .gitee/Dockerfile | 2 +- Jenkinsfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitee/Dockerfile b/.gitee/Dockerfile index 89c525f9..88afd34c 100644 --- a/.gitee/Dockerfile +++ b/.gitee/Dockerfile @@ -1,2 +1,2 @@ -FROM [ython:3 +FROM python:3 RUN pip3 install requests \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index cbffa37b..0d14640f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,7 +22,7 @@ pipeline { } environment { - gitee_token = '17978b8794a0b452fefbfb6be28dfb02' + gitee_token = credentials("1") } steps { sh 'python3 .gitee/callback.py' -- Gitee From aa9a36f6fe9ad2cb7c86700acbf7f220ef6623f6 Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 05:32:09 +0800 Subject: [PATCH 18/36] up --- .gitee/callback.py | 4 ++-- Jenkinsfile | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitee/callback.py b/.gitee/callback.py index ab440f2a..cfb7d1b6 100644 --- a/.gitee/callback.py +++ b/.gitee/callback.py @@ -4,9 +4,9 @@ import requests owner="deepin-community-store" repo="spark-store" # sha=os.system("git rev-parse HEAD") -sha = os.getenv("GIT_COMMIT") +sha = os.getenv("GIT_COMMIT")[0:5] #get sha from environment -url = "https://gitee.com/api/v5/repos/" + owner + "/"+repo+ "/commits/"+ "/comments" +url = "https://gitee.com/api/v5/repos/" + owner + "/"+repo+ "/commits"+ "/comments" d = { 'access_token': os.getenv("gitee_token"), diff --git a/Jenkinsfile b/Jenkinsfile index 0d14640f..e1eaeb48 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,8 +16,8 @@ pipeline { stage('send') { agent { - dockerfile { - filename '.gitee/Dockerfile' + docker { + image curlimages/curl } } @@ -25,7 +25,13 @@ pipeline { gitee_token = credentials("1") } steps { - sh 'python3 .gitee/callback.py' + sh ''' + curl -X POST --header 'Content-Type: application/json;charset=UTF-8' \ + 'https://gitee.com/api/v5/repos/deepin-community-store/spark-store/commits/${GIT_COMMIT}/comments' + -d '{"access_token":${gitee_token},"body":"hello world"}' + + + ''' } } -- Gitee From 48fed26c51a8c42554e45f72f43e49703e04c97f Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 05:38:38 +0800 Subject: [PATCH 19/36] debug --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e1eaeb48..08b91a0e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,7 +17,7 @@ pipeline { stage('send') { agent { docker { - image curlimages/curl + image 'curlimages/curl' } } -- Gitee From 8bbcfb0cc3754bc6ed6429996157d230899f2955 Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 05:43:38 +0800 Subject: [PATCH 20/36] up --- .gitee/callback.sh | 3 +++ Jenkinsfile | 8 +------- 2 files changed, 4 insertions(+), 7 deletions(-) create mode 100644 .gitee/callback.sh diff --git a/.gitee/callback.sh b/.gitee/callback.sh new file mode 100644 index 00000000..7eaa71c9 --- /dev/null +++ b/.gitee/callback.sh @@ -0,0 +1,3 @@ +curl -X POST --header 'Content-Type: application/json;charset=UTF-8' \ +'https://gitee.com/api/v5/repos/deepin-community-store/spark-store/commits/${GIT_COMMIT}/comments' +-d '{"access_token":${gitee_token},"body":"hello world"}' \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index 08b91a0e..a5edc555 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,13 +25,7 @@ pipeline { gitee_token = credentials("1") } steps { - sh ''' - curl -X POST --header 'Content-Type: application/json;charset=UTF-8' \ - 'https://gitee.com/api/v5/repos/deepin-community-store/spark-store/commits/${GIT_COMMIT}/comments' - -d '{"access_token":${gitee_token},"body":"hello world"}' - - - ''' + } } -- Gitee From 05831c06d422d23b04db096fe82944735b2fe0d5 Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 05:44:21 +0800 Subject: [PATCH 21/36] up --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a5edc555..180d3143 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,7 +25,7 @@ pipeline { gitee_token = credentials("1") } steps { - + sh -c '.gitee/callback.sh' } } -- Gitee From 7308cf13194557dfd1bbad19895925c304d60c18 Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 05:49:40 +0800 Subject: [PATCH 22/36] debug --- .gitee/callback.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitee/callback.sh b/.gitee/callback.sh index 7eaa71c9..2d99a106 100644 --- a/.gitee/callback.sh +++ b/.gitee/callback.sh @@ -1,3 +1,3 @@ curl -X POST --header 'Content-Type: application/json;charset=UTF-8' \ -'https://gitee.com/api/v5/repos/deepin-community-store/spark-store/commits/${GIT_COMMIT}/comments' +'https://gitee.com/api/v5/repos/deepin-community-store/spark-store/commits/${GIT_COMMIT}/comments' \ -d '{"access_token":${gitee_token},"body":"hello world"}' \ No newline at end of file -- Gitee From 2b60a444c2829ec8d4bb33764b02128fd3ddfd89 Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 05:54:15 +0800 Subject: [PATCH 23/36] debug --- .gitee/callback.sh | 3 --- Jenkinsfile | 6 +++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitee/callback.sh b/.gitee/callback.sh index 2d99a106..e69de29b 100644 --- a/.gitee/callback.sh +++ b/.gitee/callback.sh @@ -1,3 +0,0 @@ -curl -X POST --header 'Content-Type: application/json;charset=UTF-8' \ -'https://gitee.com/api/v5/repos/deepin-community-store/spark-store/commits/${GIT_COMMIT}/comments' \ --d '{"access_token":${gitee_token},"body":"hello world"}' \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index 180d3143..4041885f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,7 +25,11 @@ pipeline { gitee_token = credentials("1") } steps { - sh -c '.gitee/callback.sh' + sh ''' + curl -X POST --header 'Content-Type: application/json;charset=UTF-8' \ + 'https://gitee.com/api/v5/repos/deepin-community-store/spark-store/commits/${GIT_COMMIT}/comments' \ + -d '{"access_token":${gitee_token},"body":"hello world"}' + ''' } } -- Gitee From f7ca2acaddccae53e57513590c3af5caf8d1f110 Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 05:55:47 +0800 Subject: [PATCH 24/36] debug --- Jenkinsfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4041885f..0fb84845 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,9 +26,7 @@ pipeline { } steps { sh ''' - curl -X POST --header 'Content-Type: application/json;charset=UTF-8' \ - 'https://gitee.com/api/v5/repos/deepin-community-store/spark-store/commits/${GIT_COMMIT}/comments' \ - -d '{"access_token":${gitee_token},"body":"hello world"}' + curl -X POST --header 'Content-Type: application/json;charset=UTF-8' 'https://gitee.com/api/v5/repos/deepin-community-store/spark-store/commits/${GIT_COMMIT}/comments' -d '{"access_token":${gitee_token},"body":"hello world"}' ''' } } -- Gitee From 8f32cdac4541f71181abe86016ebbd25baef19d9 Mon Sep 17 00:00:00 2001 From: spark-store Date: Mon, 19 Apr 2021 22:06:40 +0000 Subject: [PATCH 25/36] Added Jenkinsfile --- Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0fb84845..f84ac797 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,17 +16,17 @@ pipeline { stage('send') { agent { - docker { - image 'curlimages/curl' + dockerfile { + filename '.gitee/Dockerfile' } } environment { - gitee_token = credentials("1") + gitee_token = credentials('1') } steps { sh ''' - curl -X POST --header 'Content-Type: application/json;charset=UTF-8' 'https://gitee.com/api/v5/repos/deepin-community-store/spark-store/commits/${GIT_COMMIT}/comments' -d '{"access_token":${gitee_token},"body":"hello world"}' + curl -X POST --header \'Content-Type: application/json;charset=UTF-8\' \'https://gitee.com/api/v5/repos/deepin-community-store/spark-store/commits/${GIT_COMMIT}/comments\' -d \'{"access_token":${gitee_token},"body":"hello world"}\' ''' } } -- Gitee From ac9a0f2caf215cee3f599ee60b61be107dca2375 Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 06:07:01 +0800 Subject: [PATCH 26/36] up --- .gitee/callback.py | 7 +++++-- Jenkinsfile | 8 +++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitee/callback.py b/.gitee/callback.py index cfb7d1b6..0eaeb171 100644 --- a/.gitee/callback.py +++ b/.gitee/callback.py @@ -4,7 +4,7 @@ import requests owner="deepin-community-store" repo="spark-store" # sha=os.system("git rev-parse HEAD") -sha = os.getenv("GIT_COMMIT")[0:5] +sha = os.getenv("GIT_COMMIT") #get sha from environment url = "https://gitee.com/api/v5/repos/" + owner + "/"+repo+ "/commits"+ "/comments" @@ -13,5 +13,8 @@ d = { "body": 'hello world' } +h = { + "Content-Type": "application/json;charset=UTF-8" +} -res = requests.post(url,data=d) \ No newline at end of file +res = requests.post(url,headers=h, data=d) \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index 0fb84845..2c390366 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,8 +16,8 @@ pipeline { stage('send') { agent { - docker { - image 'curlimages/curl' + dockfile { + dockfile .gitee/Dockerfile } } @@ -25,9 +25,7 @@ pipeline { gitee_token = credentials("1") } steps { - sh ''' - curl -X POST --header 'Content-Type: application/json;charset=UTF-8' 'https://gitee.com/api/v5/repos/deepin-community-store/spark-store/commits/${GIT_COMMIT}/comments' -d '{"access_token":${gitee_token},"body":"hello world"}' - ''' + sh "python3 .gitee/callback.py" } } -- Gitee From 5d50cfa1b3f2655990b8dd63a3a20dede1690027 Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 06:35:55 +0800 Subject: [PATCH 27/36] debug --- .gitee/callback.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitee/callback.py b/.gitee/callback.py index 0eaeb171..ed1911f9 100644 --- a/.gitee/callback.py +++ b/.gitee/callback.py @@ -1,15 +1,18 @@ import os import requests +import json + -owner="deepin-community-store" -repo="spark-store" # sha=os.system("git rev-parse HEAD") sha = os.getenv("GIT_COMMIT") +# sha = '48fed26c51a8c42554e45f72f43e49703e04c97f' #get sha from environment -url = "https://gitee.com/api/v5/repos/" + owner + "/"+repo+ "/commits"+ "/comments" +url = "https://gitee.com/api/v5/repos/deepin-community-store/spark-store/commits/{}/comments".format(sha) + +token = os.getenv("gitee_token") d = { - 'access_token': os.getenv("gitee_token"), + 'access_token': token, "body": 'hello world' } @@ -17,4 +20,6 @@ h = { "Content-Type": "application/json;charset=UTF-8" } -res = requests.post(url,headers=h, data=d) \ No newline at end of file +res = requests.post(url,headers=h, data=json.dumps(d)) +# print(res.status_code) +# print(res.content) \ No newline at end of file -- Gitee From 300349803d773e6cf1f39f9a8eeb7db59703c21a Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 13:58:13 +0800 Subject: [PATCH 28/36] update --- .gitee/callback.py | 2 ++ .gitee/callback.sh | 0 2 files changed, 2 insertions(+) delete mode 100644 .gitee/callback.sh diff --git a/.gitee/callback.py b/.gitee/callback.py index ed1911f9..a459ef94 100644 --- a/.gitee/callback.py +++ b/.gitee/callback.py @@ -11,6 +11,8 @@ url = "https://gitee.com/api/v5/repos/deepin-community-store/spark-store/commits token = os.getenv("gitee_token") +body = "构建详情请见" + os.getenv("BUILD_URL") + d = { 'access_token': token, "body": 'hello world' diff --git a/.gitee/callback.sh b/.gitee/callback.sh deleted file mode 100644 index e69de29b..00000000 -- Gitee From 083b06ad78aabe42949e217b7748857cb37a8d72 Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 15:06:40 +0800 Subject: [PATCH 29/36] update --- .gitee/callback.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitee/callback.py b/.gitee/callback.py index a459ef94..6c2bdf3a 100644 --- a/.gitee/callback.py +++ b/.gitee/callback.py @@ -11,11 +11,12 @@ url = "https://gitee.com/api/v5/repos/deepin-community-store/spark-store/commits token = os.getenv("gitee_token") -body = "构建详情请见" + os.getenv("BUILD_URL") +body = "构建详情请见" + os.getenv("JENKINS_URL") + "/blue/organizations/" + os.getenv("JOB_NAME") + "/detail/"+ \ + os.system("git symbolic-ref --short -q HEAD")+ "/" + os.getenv("BUILD_ID") d = { 'access_token': token, - "body": 'hello world' + "body": body } h = { -- Gitee From 62d34f4ef93e8395a3310e81d447e3951750df95 Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 15:11:14 +0800 Subject: [PATCH 30/36] debug --- .gitee/callback.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitee/callback.py b/.gitee/callback.py index 6c2bdf3a..375c31fe 100644 --- a/.gitee/callback.py +++ b/.gitee/callback.py @@ -12,7 +12,7 @@ url = "https://gitee.com/api/v5/repos/deepin-community-store/spark-store/commits token = os.getenv("gitee_token") body = "构建详情请见" + os.getenv("JENKINS_URL") + "/blue/organizations/" + os.getenv("JOB_NAME") + "/detail/"+ \ - os.system("git symbolic-ref --short -q HEAD")+ "/" + os.getenv("BUILD_ID") + os.system("git symbolic-ref --short -q HEAD")+ "/" + str(os.getenv("BUILD_ID")) d = { 'access_token': token, -- Gitee From ca631ec2e6534c70aba13d4fdf19542447d45540 Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 15:14:41 +0800 Subject: [PATCH 31/36] debug --- .gitee/callback.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitee/callback.py b/.gitee/callback.py index 375c31fe..6082cc0e 100644 --- a/.gitee/callback.py +++ b/.gitee/callback.py @@ -11,8 +11,7 @@ url = "https://gitee.com/api/v5/repos/deepin-community-store/spark-store/commits token = os.getenv("gitee_token") -body = "构建详情请见" + os.getenv("JENKINS_URL") + "/blue/organizations/" + os.getenv("JOB_NAME") + "/detail/"+ \ - os.system("git symbolic-ref --short -q HEAD")+ "/" + str(os.getenv("BUILD_ID")) +body = "构建详情请见" + os.getenv("JENKINS_URL") + "/blue/organizations/" + os.getenv("JOB_NAME") + "/detail/"+ os.system("git symbolic-ref --short -q HEAD")+ "/" + str(os.getenv("BUILD_ID")) d = { 'access_token': token, -- Gitee From 03321b1cc46434788ece11a3c34d050cd66cd1cd Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 15:22:20 +0800 Subject: [PATCH 32/36] debug --- .gitee/callback.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitee/callback.py b/.gitee/callback.py index 6082cc0e..a341d4b2 100644 --- a/.gitee/callback.py +++ b/.gitee/callback.py @@ -11,7 +11,12 @@ url = "https://gitee.com/api/v5/repos/deepin-community-store/spark-store/commits token = os.getenv("gitee_token") -body = "构建详情请见" + os.getenv("JENKINS_URL") + "/blue/organizations/" + os.getenv("JOB_NAME") + "/detail/"+ os.system("git symbolic-ref --short -q HEAD")+ "/" + str(os.getenv("BUILD_ID")) +process = os.popen("git symbolic-ref --short -q HEAD") + +body = "构建详情请见" + os.getenv("JENKINS_URL") + "/blue/organizations/" + os.getenv("JOB_NAME") + "/detail/"+ str(process.read()) + \ + "/" + str(os.getenv("BUILD_ID")) + +process.close() d = { 'access_token': token, -- Gitee From 59af1a7eccd8a565c1b4f47b0969e20a6352180e Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 15:27:01 +0800 Subject: [PATCH 33/36] debug --- .gitee/callback.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitee/callback.py b/.gitee/callback.py index a341d4b2..39f0ec58 100644 --- a/.gitee/callback.py +++ b/.gitee/callback.py @@ -13,8 +13,7 @@ token = os.getenv("gitee_token") process = os.popen("git symbolic-ref --short -q HEAD") -body = "构建详情请见" + os.getenv("JENKINS_URL") + "/blue/organizations/" + os.getenv("JOB_NAME") + "/detail/"+ str(process.read()) + \ - "/" + str(os.getenv("BUILD_ID")) +body = "构建详情请见" + os.getenv("JENKINS_URL") + "/blue/organizations/" + os.getenv("JOB_NAME") + "/detail/"+ str(process.read()) + "/" + str(os.getenv("BUILD_ID")) process.close() -- Gitee From 148d83eb494a822d82d198f4656d1a7127a00c67 Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 15:30:49 +0800 Subject: [PATCH 34/36] debug --- .gitee/callback.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitee/callback.py b/.gitee/callback.py index 39f0ec58..a51109cf 100644 --- a/.gitee/callback.py +++ b/.gitee/callback.py @@ -11,11 +11,11 @@ url = "https://gitee.com/api/v5/repos/deepin-community-store/spark-store/commits token = os.getenv("gitee_token") -process = os.popen("git symbolic-ref --short -q HEAD") +# process = os.popen("git symbolic-ref --short -q HEAD") -body = "构建详情请见" + os.getenv("JENKINS_URL") + "/blue/organizations/" + os.getenv("JOB_NAME") + "/detail/"+ str(process.read()) + "/" + str(os.getenv("BUILD_ID")) +body = "构建详情请见" + os.getenv("JENKINS_URL") + "blue/organizations/" + os.getenv("JOB_NAME").replace("/", "/detail/") + "/" + str(os.getenv("BUILD_ID")) -process.close() +# process.close() d = { 'access_token': token, -- Gitee From 9c1d9ca689c3387a012c46f353eb4a50c239362a Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 15:35:11 +0800 Subject: [PATCH 35/36] update --- .gitee/callback.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitee/callback.py b/.gitee/callback.py index a51109cf..42e66edb 100644 --- a/.gitee/callback.py +++ b/.gitee/callback.py @@ -13,7 +13,7 @@ token = os.getenv("gitee_token") # process = os.popen("git symbolic-ref --short -q HEAD") -body = "构建详情请见" + os.getenv("JENKINS_URL") + "blue/organizations/" + os.getenv("JOB_NAME").replace("/", "/detail/") + "/" + str(os.getenv("BUILD_ID")) +body = "构建详情请见" + os.getenv("JENKINS_URL") + "blue/organizations/jenkins" + os.getenv("JOB_NAME").replace("/", "/detail/") + "/" + str(os.getenv("BUILD_ID")) # process.close() -- Gitee From e2cca1c3d390ed15efe015ed0dabc59760d85579 Mon Sep 17 00:00:00 2001 From: Jerry <767729940@qq.com> Date: Tue, 20 Apr 2021 15:42:12 +0800 Subject: [PATCH 36/36] debug --- .gitee/callback.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitee/callback.py b/.gitee/callback.py index 42e66edb..b52d7020 100644 --- a/.gitee/callback.py +++ b/.gitee/callback.py @@ -13,7 +13,7 @@ token = os.getenv("gitee_token") # process = os.popen("git symbolic-ref --short -q HEAD") -body = "构建详情请见" + os.getenv("JENKINS_URL") + "blue/organizations/jenkins" + os.getenv("JOB_NAME").replace("/", "/detail/") + "/" + str(os.getenv("BUILD_ID")) +body = "构建详情请见" + os.getenv("JENKINS_URL") + "blue/organizations/jenkins/" + os.getenv("JOB_NAME").replace("/", "/detail/") + "/" + str(os.getenv("BUILD_ID")) # process.close() -- Gitee