This commit is contained in:
parent
cacd247fb4
commit
95ff97b3f4
31
.drone.yml
31
.drone.yml
@ -2,42 +2,42 @@ kind: pipeline
|
|||||||
type: docker
|
type: docker
|
||||||
name: build
|
name: build
|
||||||
|
|
||||||
node:
|
|
||||||
name: pve
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Debug Harbor Login
|
- name: Debug Harbor Login and Push
|
||||||
image: alpine
|
image: plugins/docker:20.10 # 使用与主步骤相同的镜像
|
||||||
|
pull: if-not-exists
|
||||||
|
privileged: false # 如果需要,保持与主步骤一致
|
||||||
commands:
|
commands:
|
||||||
- apk add --no-cache docker-cli # 安装 Docker CLI
|
- apk add --no-cache docker-cli # 如果需要安装额外的工具,但可能不需要
|
||||||
- echo "Testing login"
|
- echo "Testing login"
|
||||||
- docker login harbor.seahi.me -u $$HARBOR_USERNAME -p $$HARBOR_PASSWORD
|
- docker login harbor.seahi.me -u $$HARBOR_USERNAME -p $$HARBOR_PASSWORD
|
||||||
- echo "Testing push"
|
- echo "Testing build and push"
|
||||||
- docker build -f Dockerfile.normal -t harbor.seahi.me/stu/normal-exit:latest .
|
- docker build -f Dockerfile.normal -t harbor.seahi.me/stu/normal-exit:latest .
|
||||||
- docker push harbor.seahi.me/stu/normal-exit:latest
|
- docker push harbor.seahi.me/stu/normal-exit:latest # 现在应该能正常运行
|
||||||
environment:
|
environment:
|
||||||
HARBOR_USERNAME:
|
HARBOR_USERNAME:
|
||||||
from_secret: harbor_username
|
from_secret: harbor_username
|
||||||
HARBOR_PASSWORD:
|
HARBOR_PASSWORD:
|
||||||
from_secret: harbor_password
|
from_secret: harbor_password
|
||||||
failure: ignore # 继续执行,即使失败
|
failure: ignore # 继续执行后续步骤,即使失败
|
||||||
|
|
||||||
- name: Build normal exit image
|
- name: Build normal exit image
|
||||||
pull: always
|
pull: if-not-exists
|
||||||
image: plugins/docker
|
image: plugins/docker:20.10
|
||||||
privileged: false
|
privileged: false
|
||||||
settings:
|
settings:
|
||||||
dockerfile: Dockerfile.normal
|
dockerfile: Dockerfile.normal
|
||||||
auto-tag: true
|
auto-tag: true
|
||||||
registry: harhor.seahi.me
|
registry: harbor.seahi.me
|
||||||
repo: harbor.seahi.me/stu/normal-exit
|
repo: harbor.seahi.me/stu/normal-exit
|
||||||
username:
|
username:
|
||||||
from_secret: harbor_username
|
from_secret: harbor_username
|
||||||
passowrd:
|
password:
|
||||||
from_secret: harbor_password
|
from_secret: harbor_password
|
||||||
|
|
||||||
- name: Build abnormal exit image
|
- name: Build abnormal exit image
|
||||||
pull: if-not-exists
|
pull: if-not-exists
|
||||||
image: plugins/docker
|
image: plugins/docker:20.10
|
||||||
privileged: false
|
privileged: false
|
||||||
settings:
|
settings:
|
||||||
dockerfile: Dockerfile.abnormal
|
dockerfile: Dockerfile.abnormal
|
||||||
@ -46,5 +46,6 @@ steps:
|
|||||||
repo: harbor.seahi.me/stu/abnormal-exit
|
repo: harbor.seahi.me/stu/abnormal-exit
|
||||||
username:
|
username:
|
||||||
from_secret: harbor_username
|
from_secret: harbor_username
|
||||||
passowrd:
|
password:
|
||||||
from_secret: harbor_password
|
from_secret: harbor_password
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user