mirror of
https://github.com/xHyroM/gimi.git
synced 2024-11-09 18:28:06 +01:00
fix: add ssh keys to ~/.ssh/config
This commit is contained in:
parent
91479c8f94
commit
e0e29bfd28
2 changed files with 14 additions and 8 deletions
|
@ -4,8 +4,8 @@ packages:
|
|||
sources:
|
||||
- "https://git.sr.ht/~hyro/gimi"
|
||||
secrets:
|
||||
- 55691174-b52f-477c-81ea-dd32deff19b8
|
||||
- 3eaa5e52-e929-4822-842b-e817e0be7e39
|
||||
- 55691174-b52f-477c-81ea-dd32deff19b8 # github
|
||||
- 3eaa5e52-e929-4822-842b-e817e0be7e39 # codeberg
|
||||
tasks:
|
||||
- sync: |
|
||||
cd gimi
|
||||
|
@ -13,10 +13,14 @@ tasks:
|
|||
|
||||
git remote add gimi-github git@github.com:xhyrom/gimi.git
|
||||
ssh-keyscan github.com >> ~/.ssh/known_hosts
|
||||
git push -f --all --tags gimi-github
|
||||
echo -e "Host github.com\nUser git\nIdentityFile ${HOME}/.ssh/55691174-b52f-477c-81ea-dd32deff19b8" >> ~/.ssh/config
|
||||
git push -f --all gimi-github
|
||||
git push -f --tags gimi-github
|
||||
|
||||
git remote add gimi-codeberg git@codeberg.org:xHyroM/gimi.git
|
||||
ssh-keyscan codeberg.org >> ~/.ssh/known_hosts
|
||||
git push -f --all --tags gimi-codeberg
|
||||
echo -e "Host codeberg.org\nUser git\nIdentityFile ${HOME}/.ssh/3eaa5e52-e929-4822-842b-e817e0be7e39" >> ~/.ssh/config
|
||||
git push -f --all gimi-codeberg
|
||||
git push -f --tags gimi-codeberg
|
||||
|
||||
set -x
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"sources:\n" \
|
||||
" - \"https://%s/%s/%s\"\n" \
|
||||
"secrets:\n" \
|
||||
" - <add>\n" \
|
||||
" - <secret>\n" \
|
||||
"tasks:\n" \
|
||||
" - sync: |\n" \
|
||||
" cd %s\n" \
|
||||
|
@ -74,15 +74,17 @@ char *generate_sourcehut(struct gimi_config *cfg,
|
|||
|
||||
struct repository *repo = translate_ssh_to_repository(provider->ssh);
|
||||
|
||||
char buf[256];
|
||||
char buf[1024];
|
||||
snprintf(buf, sizeof(buf),
|
||||
"\n"
|
||||
"\n git remote add gimi-%s %s "
|
||||
"\n ssh-keyscan %s >> ~/.ssh/known_hosts"
|
||||
"\n echo -e \"Host %s\\nUser git\\nIdentityFile "
|
||||
"${HOME}/.ssh/<secret>\" >> ~/.ssh/config"
|
||||
"\n git push -f --all gimi-%s"
|
||||
"\n git push -f --tags gimi-%s",
|
||||
provider->name, provider->ssh, repo->domain, provider->name,
|
||||
provider->name);
|
||||
provider->name, provider->ssh, repo->domain, repo->domain,
|
||||
provider->name, provider->name);
|
||||
|
||||
strcat(remotes, buf);
|
||||
|
||||
|
|
Loading…
Reference in a new issue