fix(cicd): fix pos-web root context + rebuild remaining 10 services
All checks were successful
Build & Deploy to K8s / build-and-deploy (push) Successful in 29m5s
All checks were successful
Build & Deploy to K8s / build-and-deploy (push) Successful in 29m5s
pos-web Dockerfile uses root context (COPY apps/web-client-tpos-net/...) so Kaniko needs --context=/workspace/repo --dockerfile=apps/.../Dockerfile Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -115,9 +115,29 @@ jobs:
|
||||
case "$1" in pos-web) echo "web-client-tpos-net" ;; *) echo "${1}-net" ;; esac
|
||||
}
|
||||
|
||||
get_kaniko_context() {
|
||||
# pos-web needs root context (Dockerfile references apps/web-client-tpos-net/...)
|
||||
# All other services use subdirectory context (Dockerfile references src/...)
|
||||
case "$1" in
|
||||
pos-web) echo "/workspace/repo" ;;
|
||||
*) echo "/workspace/repo/$(get_context $1)" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
get_kaniko_dockerfile() {
|
||||
# For root context (pos-web), use full path to Dockerfile
|
||||
# For subdirectory context, Dockerfile is in the context root
|
||||
case "$1" in
|
||||
pos-web) echo "apps/web-client-tpos-net/Dockerfile" ;;
|
||||
*) echo "Dockerfile" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
create_kaniko_job() {
|
||||
local svc="$1"
|
||||
local ctx=$(get_context "$svc")
|
||||
local kaniko_ctx=$(get_kaniko_context "$svc")
|
||||
local kaniko_dockerfile=$(get_kaniko_dockerfile "$svc")
|
||||
local img=$(get_image "$svc")
|
||||
local full="${HARBOR}/${PROJECT}/${img}"
|
||||
local job="kaniko-${svc}-${IMAGE_TAG}"
|
||||
@@ -150,8 +170,8 @@ jobs:
|
||||
- name: kaniko
|
||||
image: gcr.io/kaniko-project/executor:latest
|
||||
args:
|
||||
- "--dockerfile=Dockerfile"
|
||||
- "--context=/workspace/repo/${ctx}"
|
||||
- "--dockerfile=${kaniko_dockerfile}"
|
||||
- "--context=${kaniko_ctx}"
|
||||
- "--destination=${full}:${IMAGE_TAG}"
|
||||
- "--destination=${full}:latest"
|
||||
- "--cache=false"
|
||||
|
||||
Reference in New Issue
Block a user