作者 Administrator
提交者 yangfu

ci: 配置修改

... ... @@ -8,7 +8,7 @@ COPY ./go.mod go.mod
COPY ./main.go main.go
RUN ["ln","-sf","/usr/share/zoneinfo/Asia/Shanghai","/etc/localtime"]
ENV GO111MODULE on
ENV GOPROXY https://goproxy.io
ENV GOPROXY https://goproxy.cn
RUN ["go","mod","tidy"]
RUN ["ls"]
RUN ["go","build"]
... ...
... ... @@ -9,3 +9,10 @@ HTTP_PORT = 8081
ENABLE_KAFKA_LOG11 = true
HTTPS_PORT = 8143
ALLIED_CREATION_USER_HOST = http://allied-creation-user-dev.fjmaimaimai.com
BYTE_CORE_HOST = http://220.250.41.79:8303
STARROCKS_DB_NAME = character_library
STARROCKS_USER = root
STARROCKS_PASSWORD = eagle1010
STARROCKS_HOST = 220.250.41.79
STARROCKS_PORT = 9030
... ...
... ... @@ -104,9 +104,9 @@ spec:
- name: METADATA_BASTION_HOST
value: "http://character-library-metadata-bastion-dev.fjmaimaimai.com"
- name: BYTE_CORE_HOST
value: "http://192.168.100.34:8303"
value: "http://47.97.5.102:8303"
- name: STARROCKS_HOST
value: "118.178.239.45"
value: "220.250.41.79"
- name: STARROCKS_PORT
value: "9030"
- name: STARROCKS_DB_NAME
... ...
apiVersion: v1
kind: Service
metadata:
name: character-library-metadata-bastion
namespace: mmm-suplus-test
labels:
k8s-app: character-library-metadata-bastion
spec:
ports:
- name: "http"
port: 80
targetPort: 8082
selector:
k8s-app: character-library-metadata-bastion
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: character-library-metadata-bastion
namespace: mmm-suplus-test
labels:
k8s-app: character-library-metadata-bastion
spec:
replicas: 1
template:
metadata:
labels:
k8s-app: character-library-metadata-bastion
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- preference: {}
weight: 100
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- cn-hangzhou.i-bp1djh1xn7taumbue1ze
- cn-hangzhou.i-bp1djh1xn7taumbue1zd
- cn-hangzhou.i-bp1euf5u1ph9kbhtndhb
- cn-hangzhou.i-bp1hyp5oips9cdwxxgxy
containers:
- name: character-library-metadata-bastion
image: 192.168.0.243:5000/mmm/character-library-metadata-bastion:dev
imagePullPolicy: Always
ports:
- containerPort: 8082
volumeMounts:
- mountPath: /opt/logs
name: accesslogs
env:
- name: POSTGRESQL_DB_NAME
valueFrom:
configMapKeyRef:
name: suplus-config
key: postgresqlalliedcreation.dbname
- name: POSTGRESQL_USER
valueFrom:
configMapKeyRef:
name: suplus-config
key: postgresql.user
- name: POSTGRESQL_PASSWORD
valueFrom:
configMapKeyRef:
name: suplus-config
key: postgresql.password
- name: POSTGRESQL_HOST
valueFrom:
configMapKeyRef:
name: suplus-config
key: postgresql.host
- name: POSTGRESQL_PORT
valueFrom:
configMapKeyRef:
name: suplus-config
key: postgresql.port
- name: REDIS_HOST
valueFrom:
configMapKeyRef:
name: suplus-config
key: redis.ip
- name: REDIS_PORT
valueFrom:
configMapKeyRef:
name: suplus-config
key: redis.port
- name: REDIS_AUTH
value: ""
- name: LOG_LEVEL
value: "debug"
- name: ERROR_BASE_CODE
value: "1"
- name: ERROR_BASE_CODE_MULTIPLE
value: "2000"
- name: ENABLE_KAFKA_LOG
value: "true"
- name: HTTP_PORT
value: "8082"
- name: SERVICE_ENV
value: "test"
- name: METADATA_BASTION_HOST
value: "http://character-library-metadata-bastion-test.fjmaimaimai.com"
- name: BYTE_CORE_HOST
value: "http://47.97.5.102:8303"
- name: STARROCKS_HOST
value: "220.250.41.79"
- name: STARROCKS_PORT
value: "9030"
- name: STARROCKS_DB_NAME
value: "character_library"
- name: STARROCKS_USER
value: "root"
- name: STARROCKS_PASSWORD
value: "eagle1010"
volumes:
- name: accesslogs
emptyDir: {}
\ No newline at end of file
... ...
#!/bin/bash
export PATH=/root/local/bin:$PATH
kubectl -n mmm-suplus-test get pods | grep -q character-library-metadata-bastion
if [ "$?" == "1" ];then
kubectl create -f /tmp/test/character-library-metadata-bastion/character-library-metadata-bastion.yaml --record
kubectl -n mmm-suplus-test get svc | grep -q character-library-metadata-bastion
if [ "$?" == "0" ];then
echo "character-library-metadata-bastion service install success!"
else
echo "character-library-metadata-bastion service install fail!"
fi
kubectl -n mmm-suplus-test get pods | grep -q character-library-metadata-bastion
if [ "$?" == "0" ];then
echo "character-library-metadata-bastion deployment install success!"
else
echo "character-library-metadata-bastion deployment install fail!"
fi
else
kubectl delete -f /tmp/test/character-library-metadata-bastion/character-library-metadata-bastion.yaml
kubectl -n mmm-suplus-test get svc | grep -q character-library-metadata-bastion
while [ "$?" == "0" ]
do
kubectl -n mmm-suplus-test get svc | grep -q character-library-metadata-bastion
done
kubectl -n mmm-suplus-test get pods | grep -q character-library-metadata-bastion
while [ "$?" == "0" ]
do
kubectl -n mmm-suplus-test get pods | grep -q character-library-metadata-bastion
done
kubectl create -f /tmp/test/character-library-metadata-bastion/character-library-metadata-bastion.yaml --record
kubectl -n mmm-suplus-test get svc | grep -q character-library-metadata-bastion
if [ "$?" == "0" ];then
echo "character-library-metadata-bastion service update success!"
else
echo "character-library-metadata-bastion service update fail!"
fi
kubectl -n mmm-suplus-test get pods | grep -q character-library-metadata-bastion
if [ "$?" == "0" ];then
echo "character-library-metadata-bastion deployment update success!"
else
echo "character-library-metadata-bastion deployment update fail!"
fi
fi
\ No newline at end of file
... ...
... ... @@ -14,6 +14,8 @@ type FileDto struct {
Url string `json:"url"`
// 文件类型
FileType string `json:"fileType"`
// 后缀扩展
Ext string `json:"ext"`
// 创建时间
Time string `json:"time"`
}
... ... @@ -23,5 +25,6 @@ func (d *FileDto) Load(f *domain.File) {
d.Name = f.FileInfo.Name
d.Url = f.FileInfo.Url
d.FileType = f.FileType
d.Ext = f.FileInfo.Ext
d.Time = xtime.New(f.CreatedAt).Local().Format("2006-01-02 15:04:05")
}
... ...
... ... @@ -181,7 +181,7 @@ func (fileService *FileService) SearchFile(listFileQuery *query.SearchFileQuery)
}
// 移除文件服务
func (fileService *FileService) RemoveFile(removeFileCommand *command.RemoveFileCommand) (interface{}, error) {
func (fileService *FileService) RemoveFile(ctx *domain.Context, removeFileCommand *command.RemoveFileCommand) (interface{}, error) {
if err := removeFileCommand.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
... ... @@ -211,7 +211,7 @@ func (fileService *FileService) RemoveFile(removeFileCommand *command.RemoveFile
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(removeFileCommand.FileId)))
}
deleteFileService, _ := factory.CreateDeleteFileService(transactionContext)
err = deleteFileService.DeleteFiles(nil, file)
err = deleteFileService.DeleteFiles(ctx, file)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
... ...
... ... @@ -39,6 +39,7 @@ func init() {
//ALLIED_CREATION_BASIC_HOST = Configurator.DefaultString("ALLIED_CREATION_BASIC_HOST", ALLIED_CREATION_BASIC_HOST)
ALLIED_CREATION_USER_HOST = Configurator.DefaultString("ALLIED_CREATION_USER_HOST", ALLIED_CREATION_USER_HOST)
MMM_BYTE_BANK_HOST = Configurator.DefaultString("MMM_BYTE_BANK_HOST", MMM_BYTE_BANK_HOST)
METADATA_BASTION_HOST = Configurator.DefaultString("METADATA_BASTION_HOST", METADATA_BASTION_HOST)
BYTE_CORE_HOST = Configurator.DefaultString("BYTE_CORE_HOST", BYTE_CORE_HOST)
SERVICE_ENV = Configurator.DefaultString("SERVICE_ENV", SERVICE_ENV)
HTTP_PORT = Configurator.DefaultInt("HTTP_PORT", HTTP_PORT)
... ...
... ... @@ -10,7 +10,7 @@ type FileInfo struct {
FileSize int `json:"fileSize"`
// 文件编号,以固定字符“F”+4位年+2位月+2位日+三位流水,每天编号从001开始
// FileCode string `json:"fileCode"`
//
// 后缀扩展
Ext string `json:"ext"`
// 记录数
RowCount int `json:"rowCount"`
... ...
... ... @@ -46,7 +46,7 @@ func (controller *FileController) RemoveFile() {
controller.Unmarshal(removeFileCommand)
fileId, _ := controller.GetInt(":fileId")
removeFileCommand.FileId = fileId
data, err := fileService.RemoveFile(removeFileCommand)
data, err := fileService.RemoveFile(ParseContext(controller.BaseController), removeFileCommand)
controller.Response(data, err)
}
... ...