mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-06-03 06:59:50 +08:00
add jenkins from master
This commit is contained in:
parent
e64e7fcae2
commit
e5fe80cb76
2
.gitee/Dockerfile
Normal file
2
.gitee/Dockerfile
Normal file
@ -0,0 +1,2 @@
|
||||
FROM python:3
|
||||
RUN pip3 install requests
|
31
.gitee/callback.py
Normal file
31
.gitee/callback.py
Normal file
@ -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)
|
33
Jenkinsfile
vendored
Normal file
33
Jenkinsfile
vendored
Normal file
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user