Hi,
I want to incorporate the following into my pipeline:
When a bunch of testing has been completed and accepted, I want to merge the contents of that testing branch into another branch, and push it to my remote repo. This is my latest attempt, but I keep either getting the following when I introduce manual commands to the image (1)
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
or this when I try to use the built-in attributes found in the docs (2)
+ git push deploy HEAD:master
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
exit status 128
It looks like setting the remote, branch etc doesn’t change the default value (deploy HEAD:master
), and despite the user where the ssh key is registered at being a collaborator with write access to the repo, I keep getting permission denied. Has anyone done anything similar and knows what could be up?
(1)
- name: merge
image: docker:git
commands:
- git fetch origin branch1:branch1 branch2:branch2
- git checkout branch2
- git merge branch1
- name: push
depends_on:
- merge
image: appleboy/drone-git-push
remote_name: origin
branch: branch2
local_branch: branch2
remote: git@gitea-host:owner/repo.git
key:
from_secret: ssh_key
commands:
- git remote set-url origin git@gitea-host:owner/repo.git
- git push origin branch2
(2)
- name: merge
image: docker:git
commands:
- git config user.email "foo@bar"
- git config user.name "Foo Bar"
- git fetch origin branch1:branch1 branch2:branch2
- git checkout branch2
- git merge branch1
- name: push
depends_on:
- merge
image: appleboy/drone-git-push
remote_name: origin
branch: branch2
local_branch: branch2
remote: git@gitea-host:owner/repo.git
key:
from_secret: ssh_key