Test pushes into gitea over ssh

Gerrit replicates to gitea via ssh, but our current testing only checks
that we can push over https. Test that pushing over ssh works properly
as this is what we actually need to work in production.

Change-Id: I0f7764a6d07e7d413a5b07a7f3ba8a9be7b4f0e3
This commit is contained in:
Clark Boylan 2022-02-07 17:04:33 -08:00
parent 0197aa43e1
commit f3b767cf60

View File

@ -20,11 +20,34 @@
fail:
msg: Zuul description was not updated
when: '"Zuuls new description" not in zuul_content.content'
- name: Configure ssh for pushing into test gitea
shell: |
ssh-keyscan -t rsa -p 222 localhost >> .ssh/known_hosts
ssh-keygen -t ed25519 -f /home/zuul/.ssh/id_ed25519 -C giteagerrittest -P ''
- name: Register new gitea gerrit pubkey value
slurp:
src: /home/zuul/.ssh/id_ed25519.pub
register: slurped_gitea_gerrit_pubkey
- name: Set testing key on gerrit account in gitea
no_log: true
uri:
user: root
password: "{{ gitea_root_password }}"
force_basic_auth: true
url: "https://localhost:3000/api/v1/admin/users/gerrit/keys"
validate_certs: false
method: POST
status_code: 201
body_format: json
body:
key: "{{ slurped_gitea_gerrit_pubkey['content'] | b64decode }}"
read_only: false
title: "Gerrit testing key"
- name: Push system-config into our test gitea for testing
shell: |
cd /home/zuul/src/opendev.org/opendev/system-config
git remote add test-gitea https://gerrit:{{ gitea_gerrit_password }}@localhost:3000/opendev/system-config
GIT_SSL_NO_VERIFY=1 git push -f test-gitea master
git remote add test-gitea ssh://git@localhost:222/opendev/system-config
GIT_SSH_COMMAND='ssh -i /home/zuul/.ssh/id_ed25519' git push -f test-gitea master
- name: Run rename playbook
import_playbook: rename_repos.yaml