持续集成CI入门篇(二)
WAR 包
一丶修改.gitlab-ci.yml
stages: - test test: stage: test script: - echo 执行打包命令 - /usr/local/maven/apache-maven-3.6.3/bin/mvn package - echo 复制到docker目录 - cp target/TestCICD-1.0-SNAPSHOT.war docker/TestCICD.war - echo 停止服务 - docker-compose down - echo 启动服务 - docker-compose up -d --build
二丶创建docker 目录 写好Dockerfile
FROM daocloud.io/library/tomcat:8.5-jdk14 COPY TestCICD.war /usr/local/tomcat/webapps
三丶写好docker-compose.yml
version: '3.1' services: testcicd: build: docker restart: always container_name: testci ports: - 8080:8080
四丶目录结构