bun init
This commit is contained in:
@@ -34,20 +34,25 @@ jobs:
|
|||||||
--label "org.label-schema.vcs-ref=${{ steps.vars.outputs.sha_full }}"
|
--label "org.label-schema.vcs-ref=${{ steps.vars.outputs.sha_full }}"
|
||||||
--label "org.label-schema.build-date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
|
--label "org.label-schema.build-date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
|
||||||
|
|
||||||
- name: Update infrastructure with Kustomize
|
- name: Update infrastructure repository
|
||||||
run: |
|
run: |
|
||||||
# Клонируем инфра-репозиторий
|
# Клонируем инфра-репозиторий
|
||||||
git clone https://${{ secrets.USER }}:${{ secrets.GITEA }}@gitea.apps.kopikopi.com.ru/examples/nginx-intrasture.git
|
git clone https://${{ secrets.USER }}:${{ secrets.GITEA }}@gitea.apps.kopikopi.com.ru/examples/nginx-intrasture.git
|
||||||
cd nginx-intrasture/apps/static-site
|
cd nginx-intrasture/apps/static-site
|
||||||
|
|
||||||
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O yq
|
# Простое решение: используем sed для изменения deployment.yaml
|
||||||
chmod +x yq
|
NEW_IMAGE="harbor.apps.kopikopi.com.ru/drone/test:${{ steps.vars.outputs.sha_short }}"
|
||||||
|
|
||||||
# Обновляем ТЕГ образа в deployment.yaml (не только в kustomization.yaml)
|
# Обновляем deployment.yaml
|
||||||
./yq eval -i '.spec.template.spec.containers[0].image = "harbor.apps.kopikopi.com.ru/drone/test:'${{ steps.vars.outputs.sha_short }}'"' deployment.yaml
|
sed -i "s|image:.*drone/test:.*|image: $NEW_IMAGE|g" deployment.yaml
|
||||||
# Коммитим и пушим
|
|
||||||
|
# Проверяем изменение
|
||||||
|
echo "Updated deployment.yaml:"
|
||||||
|
grep image deployment.yaml
|
||||||
|
|
||||||
|
# Коммитим изменения
|
||||||
git config user.name "CI/CD Bot"
|
git config user.name "CI/CD Bot"
|
||||||
git config user.email "ci-cd@kopikopi.com.ru"
|
git config user.email "ci-cd@kopikopi.com.ru"
|
||||||
git add kustomization.yaml
|
git add deployment.yaml
|
||||||
git commit -m "Update image to ${{ steps.vars.outputs.sha_short }}"
|
git commit -m "Update image to ${{ steps.vars.outputs.sha_short }}"
|
||||||
git push
|
git push
|
||||||
Reference in New Issue
Block a user