fix(CI): 测试删除上次镜像
continuous-integration/drone/push Build is passing Details

develop
Yosheng 2023-10-06 18:14:08 +08:00
parent 752702f32e
commit 91e6fea106
1 changed files with 23 additions and 23 deletions

View File

@ -3,28 +3,28 @@ type: docker
name: deployment name: deployment
steps: steps:
# - name: check - name: check
# image: alpine image: alpine
# commands: commands:
# - ls -la - ls -la
# - ls -la Dockerfile # 查看当前文件夹是否包含了Dockerfile - ls -la Dockerfile # 查看当前文件夹是否包含了Dockerfile
# - name: publish - name: publish
# image: plugins/docker image: plugins/docker
# settings: settings:
# username: username:
# from_secret: nexus_username from_secret: nexus_username
# password: password:
# from_secret: nexus_password from_secret: nexus_password
# pull: if-not-exists # 如果镜像不存在则拉取,免去每次都要重新下载 pull: if-not-exists # 如果镜像不存在则拉取,免去每次都要重新下载
# dockerfile: Dockerfile dockerfile: Dockerfile
# tags: latest tags: latest
# # you need insecure: true since we don't have a TLS certificate # you need insecure: true since we don't have a TLS certificate
# insecure: true insecure: true
# registry: 192.168.31.104:8082 registry: 192.168.31.104:8082
# repo: 192.168.31.104:8082/tiamo/user-point-management repo: 192.168.31.104:8082/tiamo/user-point-management
# volumes: # 将容器内目录挂载到宿主机仓库需要开启Trusted设置 volumes: # 将容器内目录挂载到宿主机仓库需要开启Trusted设置
# - name: dockersock - name: dockersock
# path: /var/run/docker.sock path: /var/run/docker.sock
- name: deploy - name: deploy
pull: if-not-exists pull: if-not-exists
image: appleboy/drone-ssh image: appleboy/drone-ssh
@ -51,7 +51,7 @@ steps:
- docker container prune -f - docker container prune -f
- echo 开始清除镜像 - echo 开始清除镜像
- docker rmi tiamo/user-point-management:latest - docker rmi tiamo/user-point-management:latest
- echo 开始标签镜像 - echo 开始重新标签镜像
- docker tag 192.168.31.104:8082/tiamo/user-point-management tiamo/user-point-management:latest - docker tag 192.168.31.104:8082/tiamo/user-point-management tiamo/user-point-management:latest
- echo 开始运行容器 - echo 开始运行容器
- docker run --name user-point-management -d -p 29029:5000 - docker run --name user-point-management -d -p 29029:5000