Add new infra architecture 4
This commit is contained in:
@@ -34,14 +34,28 @@ spec:
|
||||
env:
|
||||
- name: DOCKER_CONFIG
|
||||
value: /tekton/home/.docker
|
||||
command:
|
||||
- /kaniko/executor
|
||||
args:
|
||||
- --dockerfile=$(workspaces.source.path)/Dockerfile
|
||||
- --destination=$(params.registry)/$(params.service):$(params.git-revision)
|
||||
- --context=$(workspaces.source.path)
|
||||
- --cache=true
|
||||
- --cache-repo=$(params.registry)/cache
|
||||
script: |
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Split services parameter by comma
|
||||
IFS=',' read -ra SERVICES <<< "$(params.services)"
|
||||
|
||||
# Build each service
|
||||
for service in "${SERVICES[@]}"; do
|
||||
service=$(echo "$service" | xargs) # Trim whitespace
|
||||
if [ -n "$service" ] && [ "$service" != "none" ]; then
|
||||
echo "Building service: $service"
|
||||
/kaniko/executor \
|
||||
--dockerfile="$(workspaces.source.path)/services/$service/Dockerfile" \
|
||||
--destination="$(params.registry)/$service:$(params.git-revision)" \
|
||||
--context="$(workspaces.source.path)" \
|
||||
--cache=true \
|
||||
--cache-repo="$(params.registry)/cache"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "success" > $(results.build-status.path)
|
||||
resources:
|
||||
limits:
|
||||
cpu: 2000m
|
||||
|
||||
Reference in New Issue
Block a user