From 3427140c0f4afae2a59e527e6e6ee58d6f3d3c72 Mon Sep 17 00:00:00 2001 From: cat_shark <1716967236@qq.com> Date: Thu, 17 Jul 2025 17:15:57 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A1.=20=E5=A2=9E=E5=8A=A0dev?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E6=97=B6=E4=BD=BF=E7=94=A8=E7=9A=84=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6=202.=20=E4=BD=BF=E5=BE=97=E5=AE=B9?= =?UTF-8?q?=E5=99=A8=E9=83=A8=E7=BD=B2=E5=88=B0=E5=92=8Cmysql=E5=90=8C?= =?UTF-8?q?=E4=B8=80=E4=B8=AAdocker=E7=BD=91=E7=BB=9C=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 6 +++++- src/main/resources/application-dev.yml | 9 +++++++++ src/main/resources/application-local.yml | 9 +++++++++ src/main/resources/application.yml | 8 -------- 4 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 src/main/resources/application-dev.yml create mode 100644 src/main/resources/application-local.yml diff --git a/Jenkinsfile b/Jenkinsfile index ca959aa..03cd2ee 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,7 +31,11 @@ pipeline { steps { sh ''' docker rm -f $CONTAINER_NAME || true - docker run -d --name $CONTAINER_NAME -p $HOST_PORT:$CONTAINER_PORT $IMAGE_NAME + docker run -d + --name $CONTAINER_NAME + --network mysql_default + -p $HOST_PORT:$CONTAINER_PORT $IMAGE_NAME + -e SPRING_PROFILES_ACTIVE=dev ''' } } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml new file mode 100644 index 0000000..60abdd8 --- /dev/null +++ b/src/main/resources/application-dev.yml @@ -0,0 +1,9 @@ +spring: + # 配置数据库 + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://mysql8:3306/learning_progress_tracker?characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8 + username: root + password: GUOxy5157 +server: + port: 5157 diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml new file mode 100644 index 0000000..c0201f0 --- /dev/null +++ b/src/main/resources/application-local.yml @@ -0,0 +1,9 @@ +spring: + # 配置数据库 + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://localhost:3306/learning_progress_tracker?characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8 + username: root + password: +server: + port: 5157 \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 5124a70..e21eff8 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,12 +1,6 @@ spring: application: name: LearningProgressTracker - # 配置数据库 - datasource: - driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://localhost:3306/learning_progress_tracker?characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8 - username: root - password: flyway: # 是否启动 flyway enabled: true @@ -27,8 +21,6 @@ spring: jackson: time-zone: UTC date-format: yyyy-MM-dd'T'HH:mm:ss'Z' -server: - port: 8081 mybatis-plus: configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl