51 lines
1.3 KiB
YAML
51 lines
1.3 KiB
YAML
kind: pipeline
|
|
type: docker
|
|
name: build
|
|
|
|
node:
|
|
name: pve
|
|
|
|
steps:
|
|
- name: Debug Harbor Login
|
|
image: alpine
|
|
commands:
|
|
- apk add --no-cache docker-cli # 安装 Docker CLI
|
|
- echo "Testing login"
|
|
- docker login harbor.seahi.me -u $$HARBOR_USERNAME -p $$HARBOR_PASSWORD
|
|
- echo "Testing push"
|
|
- docker build -f Dockerfile.normal -t harbor.seahi.me/stu/normal-exit:latest .
|
|
- docker push harbor.seahi.me/stu/normal-exit:latest
|
|
environment:
|
|
HARBOR_USERNAME:
|
|
from_secret: harbor_username
|
|
HARBOR_PASSWORD:
|
|
from_secret: harbor_password
|
|
failure: ignore # 继续执行,即使失败
|
|
|
|
- name: Build normal exit image
|
|
pull: always
|
|
image: plugins/docker
|
|
privileged: false
|
|
settings:
|
|
dockerfile: Dockerfile.normal
|
|
auto-tag: true
|
|
registry: harhor.seahi.me
|
|
repo: harbor.seahi.me/stu/normal-exit
|
|
username:
|
|
from_secret: harbor_username
|
|
passowrd:
|
|
from_secret: harbor_password
|
|
- name: Build abnormal exit image
|
|
pull: if-not-exists
|
|
image: plugins/docker
|
|
privileged: false
|
|
settings:
|
|
dockerfile: Dockerfile.abnormal
|
|
auto-tag: true
|
|
registry: harbor.seahi.me
|
|
repo: harbor.seahi.me/stu/abnormal-exit
|
|
username:
|
|
from_secret: harbor_username
|
|
passowrd:
|
|
from_secret: harbor_password
|