fix(CI): 测试添加docker登入方式
continuous-integration/drone/push Build is passing Details

develop
Yosheng 2023-10-06 15:52:11 +08:00
parent cddaa86ff2
commit 974c4e42f7
1 changed files with 27 additions and 23 deletions

View File

@ -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