# 容器化运维
# jekins配置
git仓库:http://gitlab.gosp.glkyun.com/jinan/stms_parent.git
分支:glink-docker
# 配置镜像
stms/pom.xml
-DskipTests=true -Ddocker.skip=false clean deploy -Ddocker.registry.name.prefix=registry.cn-beijing.aliyuncs.com/crcc_yth
# 执行shell
BUILD_ID=nepoch_builder_product_test_service
## build platform
cd ${WORKSPACE}
1
2
3
4
2
3
4
# 服务器脚本配置
启动脚本start-stms.sh
#!/bin/bash
if [ $1 ]
then
echo "timestamp is $1"
timestamp=$1
else
timestamp=$(date +%Y%m%d)
echo "timestamp is $timestamp"
fi
export timestamp
docker stack deploy -c docker-compose-stms.yml godzilla
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
配置文件docker-compose-stms.yml
version: "3.8"
networks:
godzilla:
driver: overlay
volumes:
mongo_data:
driver: local
es_data:
driver: local
graylog_journal:
driver: local
# Volumes for persisting data, see https://docs.docker.com/engine/admin/volumes/volumes/
services:
stms:
image: registry.cn-beijing.aliyuncs.com/crcc_yth/stms:1.4-SNAPSHOT_$timestamp
container_name: nepoch
networks:
- godzilla
environment:
- SPRING_PROFILES_ACTIVE=prod
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20