This commit is contained in:
王思川 2021-05-08 15:59:20 +08:00
parent 2382f81b53
commit 43e65023c1
3 changed files with 2 additions and 7 deletions

View File

@ -7,7 +7,7 @@ job:
- docker stop server_mail
- docker rm server_mail
- docker build -t server_mail .
- docker run -d --network apps_network --ip 172.20.50.1 -p 30001:30001 --name server_mail server_mail
- docker run -d --network=host --name server_mail server_mail
only:
- master
tags:

View File

@ -1,5 +1,2 @@
PROJECT_NAME = 'server_mail'
PROJECT_ID = '50.1'
PROJECT_NETWORK = 'apps_network'
PROJECT_INNER_IP = '172.20.{}'.format(PROJECT_ID)
PROJECT_PORT = '30001'

View File

@ -1,4 +1,4 @@
from config.project_config import PROJECT_NAME, PROJECT_NETWORK, PROJECT_PORT, PROJECT_INNER_IP
from config.project_config import PROJECT_NAME, PROJECT_PORT
# 重写gitlab配置文件
@ -7,8 +7,6 @@ def write_gitlab_config():
content = f.read()
content = content.replace('PROJECT_NAME', PROJECT_NAME)
content = content.replace('PROJECT_PORT', PROJECT_PORT)
content = content.replace('PROJECT_NETWORK', PROJECT_NETWORK)
content = content.replace('PROJECT_INNER_IP', PROJECT_INNER_IP)
f.close()
with open('.gitlab-ci.yml', 'w') as f:
f.write(content)