diff --git a/playbooks/test-gitea.yaml b/playbooks/test-gitea.yaml index 990794d16d..323594a89f 100644 --- a/playbooks/test-gitea.yaml +++ b/playbooks/test-gitea.yaml @@ -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