From 974c4e42f7579881bb5d6b7b6e17a71a2423293b Mon Sep 17 00:00:00 2001 From: Yosheng Date: Fri, 6 Oct 2023 15:52:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(CI):=20=E6=B5=8B=E8=AF=95=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?docker=E7=99=BB=E5=85=A5=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 50 +++++++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/.drone.yml b/.drone.yml index 33cd7df..2de3456 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,34 +3,38 @@ type: docker name: deployment steps: - - name: check - image: alpine - commands: - - ls -la - - ls -la Dockerfile # 查看当前文件夹是否包含了Dockerfile - - name: publish - image: plugins/docker - settings: - username: - from_secret: nexus_username - password: - from_secret: nexus_password - pull: if-not-exists # 如果镜像不存在则拉取,免去每次都要重新下载 - dockerfile: Dockerfile - tags: latest - # you need insecure: true since we don't have a TLS certificate - insecure: true - registry: 192.168.31.104:8082 - repo: 192.168.31.104:8082/tiamo/user-point-management - volumes: # 将容器内目录挂载到宿主机,仓库需要开启Trusted设置 - - name: dockersock - path: /var/run/docker.sock +# - name: check +# image: alpine +# commands: +# - ls -la +# - ls -la Dockerfile # 查看当前文件夹是否包含了Dockerfile +# - name: publish +# image: plugins/docker +# settings: +# username: +# from_secret: nexus_username +# password: +# from_secret: nexus_password +# pull: if-not-exists # 如果镜像不存在则拉取,免去每次都要重新下载 +# dockerfile: Dockerfile +# tags: latest +# # you need insecure: true since we don't have a TLS certificate +# insecure: true +# registry: 192.168.31.104:8082 +# repo: 192.168.31.104:8082/tiamo/user-point-management +# volumes: # 将容器内目录挂载到宿主机,仓库需要开启Trusted设置 +# - name: dockersock +# path: /var/run/docker.sock - name: deploy pull: if-not-exists image: appleboy/drone-ssh environment: Connection: from_secret: connection + username: + from_secret: nexus_username + password: + from_secret: nexus_password settings: host: 192.168.31.225 port: 22 @@ -38,7 +42,7 @@ steps: password: dronepw command_timeout: 2m script: - - echo $${Connection} + - docker login -u $username -p $password 192.168.31.104:8082 - docker pull 192.168.31.104:8082/tiamo/user-point-management - docker image prune -f - docker stop user-point-management