From a5d909ff2958ea9a2ed9fbbd475bf12263e4c515 Mon Sep 17 00:00:00 2001 From: gaochengrui Date: Thu, 18 Jun 2020 18:50:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E8=87=AA=E5=8A=A8=E9=9B=86?= =?UTF-8?q?=E6=88=90=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 31 +++++++++++++++++++++++++++++++ 03-Variable/BifangApiVariable.txt | 10 +++++----- docker/api/docker-compose.yml | 14 ++++++++++++++ docker/cli/docker-compose.yml | 16 ++++++++++++++++ 4 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100644 docker/api/docker-compose.yml create mode 100644 docker/cli/docker-compose.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..2e533d3 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,31 @@ +stages: + - deploy #运行的类型,有 + + +api: #随意填写,起标示作用 + stage: deploy #和上述的类型对应 + + only: + - develop #指定触发分支 + + script: + - pwd + - docker stop auto-custom-clibrary-api || true && docker rm auto-custom-clibrary-api || true + - cd docker/api + - docker-compose build + - docker-compose up -d + + +cli: #随意填写,起标示作用 + stage: deploy #和上述的类型对应 + + only: + - develop #指定触发分支 + + script: + - pwd + - docker stop auto-custom-clibrary-cli || true && docker rm auto-custom-clibrary-cli || true + - cd docker/cli + - docker-compose build + - docker-compose up -d + \ No newline at end of file diff --git a/03-Variable/BifangApiVariable.txt b/03-Variable/BifangApiVariable.txt index 130824f..6ce57f9 100644 --- a/03-Variable/BifangApiVariable.txt +++ b/03-Variable/BifangApiVariable.txt @@ -1,8 +1,8 @@ *** Variables *** #登录类型:api | cli | ${None}(tsg mib) | 未指定,默认为ui -${loginType} api +${loginType} api #执行环境是否Widonws -${systemType} Windows +${systemType} Linux #API配置信息 ${host} 192.168.40.120 ${port} 8080 @@ -15,7 +15,7 @@ ${password} 111111 ${encodePassword} ${EMPTY} ${token} ${EMPTY} #[Documentation] 测试终端IP统一配置 -${testClentIP} 192.168.50.2 +${testClentIP} 192.168.41.68 ${testSubscriberID} $test2 #自动化标签 ${userTagIds} ${EMPTY} @@ -26,7 +26,7 @@ ${addTestClentIPFlag} 1 ${policyVerificationSleepSeconds} 20 #策略验证后到验证策略日志需等待时间 ${policyLogVerificationSleepSeconds} 60 -${path} E:/auto_git/eclipsegit/tsg_autotest/05-Other/ +${path} /usr/src/python/autotsg/05-Other ${curlbatpath} ${path}/curl/ ${mailpath} ${path}/mail/ ${responsePageFiles} ${path}/response_pages_files/ @@ -59,4 +59,4 @@ ${snmpCommunity} public # SNMP服务测试变量[end] #API配置信息 ${oamHost} 192.168.40.210 -${oamPort} 50080 +${oamPort} 50080 \ No newline at end of file diff --git a/docker/api/docker-compose.yml b/docker/api/docker-compose.yml new file mode 100644 index 0000000..71205e0 --- /dev/null +++ b/docker/api/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3.1' +services: + auto-custom-clibrary: + image: 192.168.41.68/robotframework/auto-custom-clibrary:3.0 + restart: always + container_name: auto-custom-clibrary-api + environment: + TZ: Asia/Shanghai + working_dir: /usr/src/python + command: robot -i tsg_bf_api -d 0618/ autotsg + privileged: true + volumes: + - /home/autotsg-gao:/usr/src/python + - /home/autotsg-gao/apilogs:/usr/src/python/0609 diff --git a/docker/cli/docker-compose.yml b/docker/cli/docker-compose.yml new file mode 100644 index 0000000..2314225 --- /dev/null +++ b/docker/cli/docker-compose.yml @@ -0,0 +1,16 @@ +version: '3.1' +services: + auto-custom-clibrary: + image: 192.168.41.68/robotframework/auto-custom-clibrary:3.0 + restart: always + container_name: auto-custom-clibrary-cli + environment: + TZ: Asia/Shanghai + working_dir: /usr/src/python + environment: + - loginType:cli + command: robot -i tsg_device -d 0618/ autotsg + privileged: true + volumes: + - /home/autotsg-gao:/usr/src/python + - /home/autotsg-gao/logs:/usr/src/python/0609