This commit is contained in:
병준 박 2025-04-12 13:28:24 +00:00
parent 2dbe116301
commit d9064d1343

View File

@ -40,16 +40,19 @@ spec:
steps:
- name: build-and-push
image: bash:5
image: alpine:3.21.3
workingDir: /workspace/source
env:
- name: DOCKER_CONFIG
value: /tekton/home/.docker
script: |
#!/usr/bin/env bash
set -euo pipefail
#!/bin/sh
set -e
if [[ -n "$(params.subdirectory)" ]]; then
echo "📦 Installing curl and tar..."
apk add --no-cache curl tar
if [ -n "$(params.subdirectory)" ]; then
cd "$(params.subdirectory)"
fi
@ -59,7 +62,7 @@ spec:
USERNAME=$(cat /workspace/docker-auth/username)
PASSWORD=$(cat /workspace/docker-auth/password)
REGISTRY=$(cut -d/ -f1 <<< "$IMAGE")
REGISTRY=$(echo "$IMAGE" | cut -d/ -f1)
echo "🔐 Writing Docker config for $REGISTRY..."
mkdir -p "$DOCKER_CONFIG"