Use manual clone with alpine instead of drone/git (pull-through cache issue)

This commit is contained in:
Viktor Barzin 2026-02-22 18:05:53 +00:00
parent 8df72b545c
commit 45f4459dbc
2 changed files with 16 additions and 4 deletions

View file

@ -3,6 +3,8 @@ type: kubernetes
name: default name: default
concurrency: concurrency:
limit: 1 limit: 1
clone:
disable: true
trigger: trigger:
event: event:
- push - push
@ -12,6 +14,8 @@ steps:
image: alpine image: alpine
commands: commands:
- "apk update && apk add jq curl git git-crypt" - "apk update && apk add jq curl git git-crypt"
- "git clone https://github.com/ViktorBarzin/infra.git ."
- "git checkout $DRONE_COMMIT"
- | - |
curl -k https://10.0.20.100:6443/api/v1/namespaces/drone/configmaps/git-crypt-key -H "Authorization:Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" | jq -r .data.key | base64 -d > /tmp/key curl -k https://10.0.20.100:6443/api/v1/namespaces/drone/configmaps/git-crypt-key -H "Authorization:Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" | jq -r .data.key | base64 -d > /tmp/key
- "git-crypt unlock /tmp/key" - "git-crypt unlock /tmp/key"
@ -53,12 +57,20 @@ type: kubernetes
name: build-cli name: build-cli
concurrency: concurrency:
limit: 1 limit: 1
clone:
disable: true
trigger: trigger:
event: event:
include: include:
- push - push
steps: steps:
- name: Clone
image: alpine
commands:
- "apk update && apk add git"
- "git clone https://github.com/ViktorBarzin/infra.git ."
- "git checkout $DRONE_COMMIT"
- name: Build image - name: Build image
image: plugins/docker image: plugins/docker
settings: settings:
@ -74,6 +86,8 @@ steps:
kind: pipeline kind: pipeline
type: kubernetes type: kubernetes
name: renew-tls-certificate name: renew-tls-certificate
clone:
disable: true
trigger: trigger:
event: event:
- cron - cron
@ -85,6 +99,8 @@ steps:
image: alpine image: alpine
commands: commands:
- "apk update && apk add jq curl git git-crypt" - "apk update && apk add jq curl git git-crypt"
- "git clone https://github.com/ViktorBarzin/infra.git ."
- "git checkout $DRONE_COMMIT"
- | - |
curl -k https://10.0.20.100:6443/api/v1/namespaces/drone/configmaps/git-crypt-key -H "Authorization:Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" | jq -r .data.key | base64 -d > /tmp/key curl -k https://10.0.20.100:6443/api/v1/namespaces/drone/configmaps/git-crypt-key -H "Authorization:Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" | jq -r .data.key | base64 -d > /tmp/key
- "git-crypt unlock /tmp/key" - "git-crypt unlock /tmp/key"

View file

@ -321,10 +321,6 @@ resource "kubernetes_deployment" "drone_runner" {
name = "DRONE_DEBUG" name = "DRONE_DEBUG"
value = "true" value = "true"
} }
env {
name = "DRONE_IMAGE_CLONE"
value = "alpine/git:latest"
}
} }
} }
} }