Try to push using ssh
This commit is contained in:
parent
5eae807615
commit
51d36c5a92
@ -3,9 +3,9 @@ steps:
|
||||
name: Build & Push Frontend
|
||||
image: woodpeckerci/plugin-kaniko
|
||||
when:
|
||||
event: [ push, pull_request, tag, manual ]
|
||||
event: [ push, pull_request, tag, manual ] # 👈 allow manual run
|
||||
path:
|
||||
include: [ frontend/** ]
|
||||
include: [ frontend/** ] # 👈 filter for auto-trigger
|
||||
settings:
|
||||
registry: harbor.dvirlabs.com
|
||||
repo: my-apps/labmap-frontend
|
||||
@ -13,7 +13,7 @@ steps:
|
||||
context: frontend
|
||||
tags:
|
||||
- latest
|
||||
- ${CI_COMMIT_BRANCH}-${CI_COMMIT_SHA:0:7}
|
||||
- ${CI_COMMIT_SHA:0:7}
|
||||
username:
|
||||
from_secret: DOCKER_USERNAME
|
||||
password:
|
||||
@ -33,31 +33,33 @@ steps:
|
||||
context: backend
|
||||
tags:
|
||||
- latest
|
||||
- ${CI_COMMIT_BRANCH}-${CI_COMMIT_SHA:0:7}
|
||||
- ${CI_COMMIT_SHA:0:7}
|
||||
username:
|
||||
from_secret: DOCKER_USERNAME
|
||||
password:
|
||||
from_secret: DOCKER_PASSWORD
|
||||
|
||||
patch-my-apps:
|
||||
name: Patch Helm Values
|
||||
image: alpine:3.19
|
||||
update-helm-values:
|
||||
name: Update Helm values.yaml in my-apps
|
||||
image: alpine
|
||||
when:
|
||||
event: [ push ]
|
||||
branch: master
|
||||
event: push
|
||||
environment:
|
||||
GIT_USERNAME:
|
||||
from_secret: GIT_USERNAME
|
||||
GIT_TOKEN:
|
||||
from_secret: GIT_TOKEN
|
||||
IMAGE_TAG: ${CI_COMMIT_BRANCH}-${CI_COMMIT_SHA:0:7}
|
||||
GIT_SSH_COMMAND: 'ssh -i /root/.ssh/id_rsa -o StrictHostKeyChecking=no'
|
||||
GIT_DEPLOY_KEY:
|
||||
from_secret: GIT_DEPLOY_KEY
|
||||
commands:
|
||||
- apk add --no-cache git curl yq
|
||||
- apk add git openssh yq
|
||||
- mkdir -p ~/.ssh
|
||||
- echo "$GIT_DEPLOY_KEY" > ~/.ssh/id_rsa
|
||||
- chmod 600 ~/.ssh/id_rsa
|
||||
- git config --global user.name "Woodpecker Bot"
|
||||
- git config --global user.email "ci@dvirlabs.com"
|
||||
- echo "${GIT_USERNAME:0:3}***"
|
||||
- git clone https://${GIT_USERNAME}:${GIT_TOKEN}@git.dvirlabs.com/dvirlabs/my-apps.git
|
||||
- git clone git@git.dvirlabs.com:dvirlabs/my-apps.git
|
||||
- cd my-apps/manifests/labmap
|
||||
- yq -i ".image.tag = \"${IMAGE_TAG}\"" values.yaml
|
||||
- yq e '.image.frontend.tag = "${CI_COMMIT_SHA:0:7}"' -i values.yaml
|
||||
- yq e '.image.backend.tag = "${CI_COMMIT_SHA:0:7}"' -i values.yaml
|
||||
- git add values.yaml
|
||||
- git commit -m "Update labmap image tag to ${IMAGE_TAG}" || echo "Nothing to commit"
|
||||
- git push origin master
|
||||
- git commit -m "Update labmap image tags to ${CI_COMMIT_SHA:0:7}" || echo "No changes to commit"
|
||||
- git push origin master
|
||||
Loading…
x
Reference in New Issue
Block a user