This commit is contained in:
+11
-7
@@ -31,21 +31,25 @@ steps:
|
||||
path: /run/podman/podman.sock
|
||||
- name: containers-config
|
||||
path: /etc/containers
|
||||
environment:
|
||||
REGISTRY_USER:
|
||||
from_secret: swr_username
|
||||
REGISTRY_PASSWORD:
|
||||
from_secret: swr_password
|
||||
secrets:
|
||||
- source: swr_username
|
||||
target: swr_username
|
||||
- source: swr_password
|
||||
target: swr_password
|
||||
commands:
|
||||
- |
|
||||
REGISTRY_USER=$(cat /run/secrets/swr_username)
|
||||
REGISTRY_PASSWORD=$(cat /run/secrets/swr_password)
|
||||
REGISTRY_SERVER="swr.cn-north-4.myhuaweicloud.com"
|
||||
|
||||
echo "Logging into registry..."
|
||||
# 调试:打印所有关键变量
|
||||
echo "=== Debug Variables ==="
|
||||
echo "REGISTRY_SERVER: swr.cn-north-4.myhuaweicloud.com"
|
||||
echo "REGISTRY_SERVER: $REGISTRY_SERVER"
|
||||
echo "REGISTRY_USER: ${REGISTRY_USER:-empty}"
|
||||
echo "REGISTRY_PASSWORD: ${REGISTRY_PASSWORD:-empty}"
|
||||
echo "========================"
|
||||
podman login "swr.cn-north-4.myhuaweicloud.com" -u "$REGISTRY_USER" -p "$REGISTRY_PASSWORD" || {
|
||||
podman login "$REGISTRY_SERVER" -u "$REGISTRY_USER" -p "$REGISTRY_PASSWORD" || {
|
||||
echo "Registry login failed!"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user