This commit is contained in:
samsep101
2026-01-05 16:29:58 +05:00
parent dc0124a3cf
commit 8b7b90f0c2

View File

@@ -40,17 +40,11 @@ jobs:
git clone https://${{ secrets.USER }}:${{ secrets.GITEA }}@gitea.apps.kopikopi.com.ru/examples/nginx-intrasture.git
cd nginx-intrasture/apps/static-site
# Устанавливаем Kustomize
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
# Обновляем тег образа через Kustomize (самый надежный способ)
./kustomize edit set image drone/test=harbor.apps.kopikopi.com.ru/drone/test:${{ steps.vars.outputs.sha_short }}
cat ./*
# Альтернатива: используем yq для точного редактирования
# wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O yq
# chmod +x yq
# ./yq eval -i '.images[0].newTag = "${{ steps.vars.outputs.sha_short }}"' kustomization.yaml
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O yq
chmod +x yq
# Обновляем ТЕГ образа в deployment.yaml (не только в kustomization.yaml)
./yq eval -i '.spec.template.spec.containers[0].image = "harbor.apps.kopikopi.com.ru/drone/test:'${{ steps.vars.outputs.sha_short }}'"' deployment.yaml
# Коммитим и пушим
git config user.name "CI/CD Bot"
git config user.email "ci-cd@kopikopi.com.ru"