数据库脚本修复,添加私服

This commit is contained in:
2019-11-27 11:30:27 +08:00
parent 4226fdcdfb
commit 27b6034046
7 changed files with 12590 additions and 0 deletions

View File

@@ -64,6 +64,7 @@ deploy_live:
- kubectl get pods -n hmdt
- cd manifests/
- sed -i "s/__IMAGE_VERSION_SLUG__/${IMAGE_VERSION}/" deployment.yaml
- sed -i "s/__IMAGE_SLUG__/${CI_REGISTRY_IMAGE}/" deployment.yaml
- kubectl apply -f deployment.yaml
# - kubectl rollout status -f deployment.yaml
- kubectl get pods -n hmdt

83
.m2/settings.xml Normal file
View File

@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<pluginGroups>
<pluginGroup>org.sonarsource.scanner.maven</pluginGroup>
</pluginGroups>
<mirrors>
<mirror>
<id>fjy-nexus</id>
<!--*指的是访问任何仓库都使用我们的私服-->
<mirrorOf>central</mirrorOf>
<name>Nexus myself</name>
<url>http://192.168.1.30:8081/repository/maven-public/</url>
</mirror>
</mirrors>
<servers>
<server>
<id>maven-central</id>
<username>${env.MAVEN_USER}</username>
<password>${env.MAVEN_PASSWORD}</password>
</server>
<server>
<id>maven-public</id>
<username>${env.MAVEN_USER}</username>
<password>${env.MAVEN_PASSWORD}</password>
</server>
<server>
<id>maven-snapshots</id>
<username>${env.MAVEN_USER}</username>
<password>${env.MAVEN_PASSWORD}</password>
</server>
</servers>
<profiles>
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<sonar.host.url>
http://192.168.1.27:19000
</sonar.host.url>
</properties>
</profile>
<profile>
<id>fjy-nexus</id>
<!-- 远程仓库列表 -->
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>maven-public</id>
<name>maven-public</name>
<url>http://192.168.1.30:8081/repository/maven-public/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<!--插件库地址-->
<pluginRepository>
<id>maven-public</id>
<url>http://192.168.1.30:8081/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>

12393
db_imis2.bak.sql Normal file

File diff suppressed because it is too large Load Diff

75
manifests/deployment.yaml Normal file
View File

@@ -0,0 +1,75 @@
apiVersion: v1
kind: Namespace
metadata:
name: cms
---
apiVersion: v1
kind: Secret
metadata:
name: harbor-login
namespace: cms
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: ewoJImF1dGhzIjogewoJCSJoYXJib3IuZmp5ODAxOC50b3A6ODg4MyI6IHsKCQkJImF1dGgiOiAiYXpoek9rczRjMmhoY21KdmNnPT0iCgkJfQoJfQp9
---
#deploy
apiVersion: apps/v1
kind: Deployment
metadata:
name: cms
namespace: cms
labels:
app: cms
spec:
selector:
matchLabels:
app: cms
replicas: 2
template:
metadata:
labels:
app: cms
spec:
imagePullSecrets:
- name: harbor-login
containers:
- name: cms
image: __IMAGE_SLUG__:__IMAGE_VERSION_SLUG__
ports:
- containerPort: 8080
---
#service
apiVersion: v1
kind: Service
metadata:
name: cms
namespace: cms
spec:
ports:
- port: 80
protocol: TCP
targetPort: 8080
selector:
app: cms
type: ClusterIP
---
#ingress
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: cms
namespace: cms
spec:
rules:
- host: cotton.fjy8018.xin
http:
paths:
- path: /
backend:
serviceName: cms
servicePort: 80

21
manifests/gitlab-sa.yaml Normal file
View File

@@ -0,0 +1,21 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: cms-gitlab-ci
namespace: cms
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
name: cms-gitlab-role
namespace: cms
subjects:
- kind: ServiceAccount
name: cms-gitlab-ci
namespace: cms
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: admin

13
pom.xml
View File

@@ -81,6 +81,19 @@
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>maven-public</id>
<name>Release Deploy</name>
<url>http://192.168.1.30:8081/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>maven-snapshots</id>
<name>Snapshot Deploy</name>
<url>http://192.168.1.30:8081/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>

View File

@@ -1,6 +1,10 @@
DROP DATABASE IF EXISTS db_imis2;
CREATE DATABASE db_imis2;
use db_imis2;
GRANT ALL ON db_imis2.* TO imis2@'%' IDENTIFIED BY '2015imis2';
FLUSH PRIVILEGES;
CREATE TABLE tb_user
(
coluserid INT(10) PRIMARY KEY NOT NULL AUTO_INCREMENT,