Skip to content

Commit 956281b

Browse files
yangmvyangmv
authored andcommitted
更新api
1 parent 0da7c3c commit 956281b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+522
-38
lines changed

Jenkinsfile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
node('haimaxy-jnlp') {
2+
stage('Clone') {
3+
echo "1.Clone 代码"
4+
git url: "https://github.com/yangmv/SuperCMDB.git"
5+
script {
6+
build_tag = sh(returnStdout: true, script: 'git rev-parse --short HEAD').trim()
7+
}
8+
}
9+
stage('Test') {
10+
echo "2.代码测试[PAAS]"
11+
}
12+
stage('Build') {
13+
echo "3.构建打包 Docker 镜像"
14+
sh "docker build -t harbor-k8s.shinezone.com/ops/flask-demo:${build_tag} ."
15+
}
16+
stage('Push') {
17+
echo "4.推送 Docker 镜像到仓库"
18+
withCredentials([usernamePassword(credentialsId: 'dockerHubSZ', passwordVariable: 'dockerHubSZPassword', usernameVariable: 'dockerHubSZUser')]) {
19+
sh "docker login -u ${dockerHubSZUser} -p ${dockerHubSZPassword} https://harbor-k8s.shinezone.com"
20+
sh "docker push harbor-k8s.shinezone.com/ops/flask-demo:${build_tag}"
21+
}
22+
}
23+
stage('YAML') {
24+
echo "5.YAML配置"
25+
sh "sed -i 's/<BUILD_TAG>/${build_tag}/' flask-demo-deploy.yaml"
26+
sh "sed -i 's/<PORT>/${port}/' flask-demo-deploy.yaml"
27+
sh "sed -i 's/<PORT>/${port}/' flask-demo-ingress.yaml"
28+
sh "sed -i 's/<DOMAIN>/${domain}/' flask-demo-ingress.yaml"
29+
}
30+
stage('Deploy') {
31+
echo "6.开始部署"
32+
//if (userInput == "Dev") {
33+
//sh "kubectl apply -f flask-demo-deploy.yaml -n dev"
34+
//} else if (userInput == "QA"){
35+
//sh "kubectl apply -f flask-demo-deploy.yaml -n qa"
36+
//} else {
37+
//sh "kubectl apply -f flask-demo-deploy.yaml -n release"
38+
//}
39+
sh "kubectl apply -f flask-demo-deploy.yaml -n ${namespace}"
40+
sh "kubectl apply -f flask-demo-ingress.yaml -n ${namespace}"
41+
}
42+
}

__pycache__/manage.cpython-36.pyc

595 Bytes
Binary file not shown.
222 Bytes
Binary file not shown.
149 Bytes
Binary file not shown.
486 Bytes
Binary file not shown.
1.51 KB
Binary file not shown.

apps/assets/admin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from django.contrib import admin
22
from assets.models.server import *
3+
from assets.models.db import *
34

45
admin.site.register(Server)
6+
admin.site.register(DBServer)
57
admin.site.register(ServerGroup)
68
admin.site.register(ServerAuthRule)
79
admin.site.register(Tag)
235 Bytes
Binary file not shown.
996 Bytes
Binary file not shown.
1.05 KB
Binary file not shown.

0 commit comments

Comments
 (0)