1
0
Fork 0
forked from infra/ansible

docstranslation: Use git token instead of ssh key

This commit is contained in:
Alix Andrieu 2026-06-15 22:15:34 +02:00
commit e0922f3d6c
Signed by: darknao
SSH key fingerprint: SHA256:q7483bAR4lkMVcMuIji2IBQ6aLmEEDSHpz5V3uN0pBE
3 changed files with 18 additions and 19 deletions

View file

@ -11,11 +11,11 @@ spec:
runPolicy: Serial
source:
git:
uri: "https://pagure.io/fedora-docs/translations-scripts.git"
uri: "https://forge.fedoraproject.org/docs/translations-scripts.git"
{% if env == 'staging' %}
ref: staging
{% else %}
ref: master
ref: main
{% endif %}
strategy:
type: Docker

View file

@ -4,11 +4,10 @@ kind: CronJob
metadata:
name: cron
spec:
suspend: true
suspend: false
concurrencyPolicy: Forbid
schedule: "0 21 * * *"
startingDeadlineSeconds: 600
suspend: true
jobTemplate:
spec:
template:
@ -26,20 +25,24 @@ spec:
{% if env == 'staging' %}
- "--nopush"
{% endif %}
env: []
env:
- name: UPDATE_DOCS_TRANS_SEC
valueFrom:
secretKeyRef:
name: git-token
key: token
- name: UPDATE_DOCS_TRANS_NAME
valueFrom:
secretKeyRef:
name: git-token
key: token_name
volumeMounts:
- name: ssh-config-volume
mountPath: /workspace/.ssh
readOnly: true
- name: mail-config-volume
mountPath: /workspace/config.ini
subPath: config.ini
readOnly: true
restartPolicy: Never
volumes:
- name: ssh-config-volume
secret:
secretName: ssh-config
- name: mail-config-volume
configMap:
name: mail-config

View file

@ -2,14 +2,10 @@
apiVersion: v1
kind: Secret
metadata:
name: ssh-config
name: git-token
labels:
app: docstranslation
stringData:
id_rsa_docs_trans: |-
{{ lookup('file', ssh_key_path) | indent(4) }}
config: |-
Host pagure.io
User git
IdentityFile /workspace/.ssh/id_rsa_docs_trans
StrictHostKeyChecking no
token: "{{docstranslation_git_token}}"
token_name: "weblatebot"