always clone the fleet repository
ci/woodpecker/pr/woodpecker Pipeline failed
Details
ci/woodpecker/pr/woodpecker Pipeline failed
Details
It is small and not worth the trouble of dealing with fetch/pull Signed-off-by: Loïc Dachary <loic@dachary.org>
parent
b4183c1790
commit
663e43ca8a
|
@ -116,10 +116,11 @@ class Infra:
|
||||||
|
|
||||||
ssh_cmd = f"/usr/bin/ssh -oStrictHostKeyChecking=no -i {conf['SSH_KEY']}"
|
ssh_cmd = f"/usr/bin/ssh -oStrictHostKeyChecking=no -i {conf['SSH_KEY']}"
|
||||||
self.env = {"GIT_SSH_COMMAND": ssh_cmd}
|
self.env = {"GIT_SSH_COMMAND": ssh_cmd}
|
||||||
try:
|
self._clone()
|
||||||
self.repo = Repo(path=self.repo_path)
|
|
||||||
except InvalidGitRepositoryError:
|
def _clone(self):
|
||||||
self.repo = Repo.clone_from(conf["REMOTE"], self.repo_path, env=self.env)
|
shutil.rmtree(self.repo_path)
|
||||||
|
self.repo = Repo.clone_from(conf["REMOTE"], self.repo_path, env=self.env)
|
||||||
|
|
||||||
def _host_vars_dir(self, subdomain: str) -> Path:
|
def _host_vars_dir(self, subdomain: str) -> Path:
|
||||||
"""
|
"""
|
||||||
|
@ -227,11 +228,6 @@ class Infra:
|
||||||
author="Dashboard Bot <bot@dashboard.hostea.org>",
|
author="Dashboard Bot <bot@dashboard.hostea.org>",
|
||||||
)
|
)
|
||||||
|
|
||||||
def _pull(self):
|
|
||||||
self.repo.git.fetch(env=self.env)
|
|
||||||
|
|
||||||
# TODO: switch to using Git cmd
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def translate_size(instance: Instance) -> str:
|
def translate_size(instance: Instance) -> str:
|
||||||
"""
|
"""
|
||||||
|
@ -252,7 +248,7 @@ class Infra:
|
||||||
|
|
||||||
The gitea user password is returned
|
The gitea user password is returned
|
||||||
"""
|
"""
|
||||||
self._pull()
|
self._clone()
|
||||||
|
|
||||||
subdomain = instance.name
|
subdomain = instance.name
|
||||||
host_vars_dir = self._host_vars_dir(subdomain)
|
host_vars_dir = self._host_vars_dir(subdomain)
|
||||||
|
@ -331,7 +327,7 @@ class Infra:
|
||||||
"""
|
"""
|
||||||
Remove a VM from infrastructure repository
|
Remove a VM from infrastructure repository
|
||||||
"""
|
"""
|
||||||
self._pull()
|
self._clone()
|
||||||
subdomain = instance.name
|
subdomain = instance.name
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue