diff --git a/.gitee/Dockerfile b/.gitee/Dockerfile new file mode 100644 index 0000000..88afd34 --- /dev/null +++ b/.gitee/Dockerfile @@ -0,0 +1,2 @@ +FROM python:3 +RUN pip3 install requests \ No newline at end of file diff --git a/.gitee/callback.py b/.gitee/callback.py new file mode 100644 index 0000000..b52d702 --- /dev/null +++ b/.gitee/callback.py @@ -0,0 +1,31 @@ +import os +import requests +import json + + +# 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/deepin-community-store/spark-store/commits/{}/comments".format(sha) + +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")) + +# process.close() + +d = { + 'access_token': token, + "body": body +} + +h = { + "Content-Type": "application/json;charset=UTF-8" +} + +res = requests.post(url,headers=h, data=json.dumps(d)) +# print(res.status_code) +# print(res.content) \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..dab36e4 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,33 @@ +pipeline { + agent any + stages { + stage('build') { + agent { + docker { + image 'jerry979/dtke:5.11' + } + + } + steps { + sh 'mkdir build && cd build && qmake .. && make ' + archiveArtifacts(artifacts: 'build/src/spark-store', allowEmptyArchive: true, defaultExcludes: true) + } + } + + stage('send') { + agent { + dockerfile { + filename '.gitee/Dockerfile' + } + + } + environment { + gitee_token = credentials('1') + } + steps { + sh "python3 .gitee/callback.py" + } + } + + } +} \ No newline at end of file diff --git a/assets/fonts/华康少女字体.ttf b/assets/fonts/hksnzt.ttf similarity index 100% rename from assets/fonts/华康少女字体.ttf rename to assets/fonts/hksnzt.ttf diff --git a/assets/icons.qrc b/assets/icons.qrc index 6c797cb..9c8ed01 100644 --- a/assets/icons.qrc +++ b/assets/icons.qrc @@ -64,6 +64,6 @@ <file>tags/dwine2-small.png</file> </qresource> <qresource prefix="/fonts"> - <file>fonts/华康少女字体.ttf</file> + <file>fonts/hksnzt.ttf</file> </qresource> </RCC>