完善jenkins

This commit is contained in:
2023-08-04 15:14:12 +08:00
parent 4aa08dd3f2
commit f60c16fa6c
6 changed files with 4671 additions and 6 deletions

23
Jenkinsfile vendored
View File

@@ -26,6 +26,29 @@ pipeline{
}
stage("关闭 docker-compose"){
steps{
sh "docker-compose --project-directory docker/${env.BRANCH_NAME} down || true"
}
}
stage("启动 docker-compose"){
steps{
sh "docker-compose --project-name ${currentBuild.projectName}/${env.BRANCH_NAME} --project-directory docker/${env.BRANCH_NAME} -d up"
}
}
}

View File

@@ -0,0 +1,39 @@
services:
pg:
image: postgres
ports:
- "5432:5432"
environment:
POSTGRES_PASSWORD: 'abc@123'
POSTGRES_USER: "postgres"
POSTGRES_DB: "coal"
networks:
- dn
volumes:
- pg_data:/var/lib/postgresql/data
redis:
image: redis:7
ports:
- "6379:6379"
volumes:
- ./redis.conf:/etc/redis/redis.conf
- redis_data:/data
networks:
- dn
command:
- redis-server
- /etc/redis/redis.conf
networks:
dn:
driver: bridge
volumes:
pg_data:
redis_data:

2276
docker/localdev/redis.conf Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,51 @@
services:
pg:
image: postgres
ports:
- "5432:5432"
environment:
POSTGRES_PASSWORD: 'abc@123'
POSTGRES_USER: "postgres"
POSTGRES_DB: "coal"
networks:
- dn
volumes:
- pg_data:/var/lib/postgresql/data
redis:
image: redis:7
ports:
- "6379:6379"
volumes:
- ./redis.conf:/etc/redis/redis.conf
- redis_data:/data
networks:
- dn
command:
- redis-server
- /etc/redis/redis.conf
coal:
image: coal:master
networks:
- dn
environment:
PG_HOST: pg
REDIS_HOST: redis
volumes:
- spring_data:/data
ports:
- "7456:7456"
networks:
dn:
driver: bridge
volumes:
pg_data:
redis_data:
spring_data:

2276
docker/master/redis.conf Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -16,9 +16,9 @@ spring:
druid:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://localhost:5432/coal
username: postgres
password: 'abc@123'
url: jdbc:postgresql://${PG_HOST:localhost}:${PG_PORT:5432}/coal
username: ${PG_USER:postgres}
password: ${PG_PASSWORD:abc@123}
initial-size: 10
max-active: 200
min-idle: 10
@@ -39,9 +39,9 @@ spring:
redis:
repositories:
enabled: false
host: localhost
port: 6379
password: 'abc@123'
host: ${REDIS_HOST:localhost}
port: ${REDIS_PORT:6379}
password: ${REDIS_PASSWORD:abc@123}
cache: