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