mirror of
https://github.com/xHyroM/gimi.git
synced 2024-11-23 08:01: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:
|
sources:
|
||||||
- "https://git.sr.ht/~hyro/gimi"
|
- "https://git.sr.ht/~hyro/gimi"
|
||||||
secrets:
|
secrets:
|
||||||
- 55691174-b52f-477c-81ea-dd32deff19b8
|
- 55691174-b52f-477c-81ea-dd32deff19b8 # github
|
||||||
- 3eaa5e52-e929-4822-842b-e817e0be7e39
|
- 3eaa5e52-e929-4822-842b-e817e0be7e39 # codeberg
|
||||||
tasks:
|
tasks:
|
||||||
- sync: |
|
- sync: |
|
||||||
cd gimi
|
cd gimi
|
||||||
|
@ -13,10 +13,14 @@ tasks:
|
||||||
|
|
||||||
git remote add gimi-github git@github.com:xhyrom/gimi.git
|
git remote add gimi-github git@github.com:xhyrom/gimi.git
|
||||||
ssh-keyscan github.com >> ~/.ssh/known_hosts
|
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
|
git remote add gimi-codeberg git@codeberg.org:xHyroM/gimi.git
|
||||||
ssh-keyscan codeberg.org >> ~/.ssh/known_hosts
|
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
|
set -x
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
"sources:\n" \
|
"sources:\n" \
|
||||||
" - \"https://%s/%s/%s\"\n" \
|
" - \"https://%s/%s/%s\"\n" \
|
||||||
"secrets:\n" \
|
"secrets:\n" \
|
||||||
" - <add>\n" \
|
" - <secret>\n" \
|
||||||
"tasks:\n" \
|
"tasks:\n" \
|
||||||
" - sync: |\n" \
|
" - sync: |\n" \
|
||||||
" cd %s\n" \
|
" cd %s\n" \
|
||||||
|
@ -74,15 +74,17 @@ char *generate_sourcehut(struct gimi_config *cfg,
|
||||||
|
|
||||||
struct repository *repo = translate_ssh_to_repository(provider->ssh);
|
struct repository *repo = translate_ssh_to_repository(provider->ssh);
|
||||||
|
|
||||||
char buf[256];
|
char buf[1024];
|
||||||
snprintf(buf, sizeof(buf),
|
snprintf(buf, sizeof(buf),
|
||||||
"\n"
|
"\n"
|
||||||
"\n git remote add gimi-%s %s "
|
"\n git remote add gimi-%s %s "
|
||||||
"\n ssh-keyscan %s >> ~/.ssh/known_hosts"
|
"\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 --all gimi-%s"
|
||||||
"\n git push -f --tags gimi-%s",
|
"\n git push -f --tags gimi-%s",
|
||||||
provider->name, provider->ssh, repo->domain, provider->name,
|
provider->name, provider->ssh, repo->domain, repo->domain,
|
||||||
provider->name);
|
provider->name, provider->name);
|
||||||
|
|
||||||
strcat(remotes, buf);
|
strcat(remotes, buf);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue