作者 yangfu

配置修改

FROM 192.168.0.243:5000/mmm/mmmopp:20200226 as builder
FROM 192.168.0.243:5000/mmm/mmmopp:20200422 as builder
#FROM golang:1.13 as builder
ENV GOPROXY https://goproxy.cn
ENV GO111MODULE on
... ...
[dev-online]
#Ali could
AccessKeyID ="LTAI4FhiZ3UktC6N1u3H5GFC"
AccessKeySecret ="UyspWwdni55CYQ02hUCint4qY2jNYO"
\ No newline at end of file
AccessKeySecret ="UyspWwdni55CYQ02hUCint4qY2jNYO"
#日志
log_level = "${LOG_LEVEL||debug}"
aliyun_logs_access ="${aliyun_logs_access||F:/log/app.log}"
#阿里云
cname ="https://media.goexample.live/"
... ...
... ... @@ -3,3 +3,9 @@
AccessKeyID ="LTAI4FhiZ3UktC6N1u3H5GFC"
AccessKeySecret ="UyspWwdni55CYQ02hUCint4qY2jNYO"
#日志
log_level = "${LOG_LEVEL||debug}"
aliyun_logs_access ="${aliyun_logs_access||F:/log/app.log}"
#阿里云
cname ="https://media.goexample.live/"
... ...
... ... @@ -112,6 +112,7 @@ func (this *VodController) CreateUploadImages() {
err = e
break
} else {
rsp.FileName = r.FileName
response.List = append(response.List, rsp)
}
}
... ...
#!/bin/bash
export PATH=/root/local/bin:$PATH
kubectl -n mmm-suplus-dev get pods | grep -q mmmopp
kubectl -n mmm-suplus-dev get pods | grep -q mmmopenapi
if [ "$?" == "1" ];then
kubectl create -f /tmp/dev/mmm-go-opp/opp.yaml --record
kubectl -n mmm-suplus-dev get svc | grep -q mmmopp
kubectl -n mmm-suplus-dev get svc | grep -q mmmopenapi
if [ "$?" == "0" ];then
echo "mmmopp service install success!"
echo "mmmopenapi service install success!"
else
echo "mmmopp service install fail!"
echo "mmmopenapi service install fail!"
fi
kubectl -n mmm-suplus-dev get pods | grep -q mmmopp
kubectl -n mmm-suplus-dev get pods | grep -q mmmopenapi
if [ "$?" == "0" ];then
echo "mmmopp deployment install success!"
echo "mmmopenapi deployment install success!"
else
echo "mmmopp deployment install fail!"
echo "mmmopenapi deployment install fail!"
fi
else
kubectl delete -f /tmp/dev/mmm-go-opp/opp.yaml
kubectl -n mmm-suplus-dev get svc | grep -q mmmopp
kubectl -n mmm-suplus-dev get svc | grep -q mmmopenapi
while [ "$?" == "0" ]
do
kubectl -n mmm-suplus-dev get svc | grep -q mmmopp
kubectl -n mmm-suplus-dev get svc | grep -q mmmopenapi
done
kubectl -n mmm-suplus-dev get pods | grep -q mmmopp
kubectl -n mmm-suplus-dev get pods | grep -q mmmopenapi
while [ "$?" == "0" ]
do
kubectl -n mmm-suplus-dev get pods | grep -q mmmopp
kubectl -n mmm-suplus-dev get pods | grep -q mmmopenapi
done
kubectl create -f /tmp/dev/mmm-go-opp/opp.yaml --record
kubectl -n mmm-suplus-dev get svc | grep -q mmmopp
kubectl -n mmm-suplus-dev get svc | grep -q mmmopenapi
if [ "$?" == "0" ];then
echo "mmmopp service update success!"
echo "mmmopenapi service update success!"
else
echo "opp service update fail!"
fi
... ...
apiVersion: v1
kind: Service
metadata:
name: mmmopp
name: mmmopenapi
namespace: mmm-suplus-dev
labels:
k8s-app: mmmopp
k8s-app: mmmopenapi
spec:
ports:
- name: "http"
port: 80
targetPort: 8080
selector:
k8s-app: mmmopp
k8s-app: mmmopenapi
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: mmmopp
name: mmmopenapi
namespace: mmm-suplus-dev
labels:
k8s-app: mmmopp
k8s-app: mmmopenapi
spec:
replicas: 1
template:
metadata:
labels:
k8s-app: mmmopp
k8s-app: mmmopenapi
spec:
affinity:
nodeAffinity:
... ... @@ -43,8 +43,8 @@ spec:
- cn-hangzhou.i-bp1euf5u1ph9kbhtndhb
- cn-hangzhou.i-bp1hyp5oips9cdwxxgxy
containers:
- name: mmmopp
image: 192.168.0.243:5000/mmm/mmmopp:dev
- name: mmmopenapi
image: 192.168.0.243:5000/mmm/mmmopenapi:dev
imagePullPolicy: Always
volumeMounts:
- mountPath: /opt/logs
... ...
... ... @@ -5,6 +5,7 @@ type CreateUploadImageRequest struct {
}
type CreateUploadImageResponse struct {
FileName string `json:"fileName"` //客户端带上来的/可用于关联
RequestId string `json:"requestId"`
ImageId string `json:"imageId" `
ImageURL string `json:"imageURL"`
... ...
... ... @@ -61,7 +61,7 @@ func CreateUploadVideo(client *vod.Client, r *CreateUploadVideoRequest) (respons
if up, e := ParseUploadAddress(rsp.UploadAddress); e != nil {
log.Error(e)
} else {
response.FileURL = up.GetFileUrl("")
response.FileURL = up.GetFileUrl(beego.AppConfig.String("cname"))
}
return
}
... ... @@ -82,7 +82,7 @@ func RefreshUploadVideo(client *vod.Client, r *RefreshUploadVideoRequest) (respo
if up, e := ParseUploadAddress(rsp.UploadAddress); e != nil {
log.Error(e)
} else {
response.FileURL = up.GetFileUrl("")
response.FileURL = up.GetFileUrl(beego.AppConfig.String("cname"))
}
return
}
... ...
... ... @@ -9,8 +9,8 @@ import (
var nsV1 *beego.Namespace
func init() {
nsV1 := beego.NewNamespace("v1",
beego.NSNamespace("vod", beego.NSBefore(controllers.FilterComm), beego.NSBefore(controllers.AllowOption), beego.NSInclude(&v1.VodController{})),
)
beego.AddNamespace(nsV1)
nsVod := beego.NewNamespace("vod", beego.NSBefore(controllers.LogRequestData), beego.NSBefore(controllers.AllowOption), beego.NSInclude(&v1.VodController{}))
beego.SetStaticPath("/log", beego.AppConfig.String("aliyun_logs_access"))
beego.AddNamespace(nsVod)
}
... ...
... ... @@ -51,6 +51,7 @@ func CreateUploadImage(header *protocol.RequestHeader, request *aliyun.CreateUpl
request.FileName = aliyun.DefaultImageFileName
}
rsp, err = aliyun.CreateUploadImage(client, request)
rsp.FileURL = rsp.ImageURL
if err != nil {
log.Error(err)
}
... ...