fix & rm: create/rm hostscripts, rm HOSTEA_DOMAIN
parent
871a05ddd3
commit
26b7ea3ef2
|
@ -186,9 +186,7 @@ HOSTEA = {
|
|||
"REMOTE": "git@localhost:Hostea/enough.git",
|
||||
# SSH key that can push to the Git repository remote mentioned above
|
||||
"SSH_KEY": "/srv/hostea/deploy",
|
||||
},
|
||||
# domain where new VMs will be created
|
||||
"HOSTEA_DOMAIN": "hostea.org",
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -198,6 +196,7 @@ vars().update(EMAIL_CONFIG)
|
|||
|
||||
try:
|
||||
import dashboard.local_settings
|
||||
|
||||
print("Found local_settings")
|
||||
except ModuleNotFoundError:
|
||||
pass
|
||||
|
|
|
@ -87,9 +87,6 @@ HOSTEA = {
|
|||
# SSH key that can push to the Git repository remote mentioned above
|
||||
"SSH_KEY": "/srv/hostea/deploy",
|
||||
},
|
||||
# domain where new VMs will be created
|
||||
"HOSTEA_DOMAIN": "hostea.org"
|
||||
|
||||
},
|
||||
```
|
||||
|
||||
|
|
|
@ -6,13 +6,15 @@ from django.db import migrations, models
|
|||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('infrastructure', '0001_initial'),
|
||||
("infrastructure", "0001_initial"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='instancecreated',
|
||||
name='gitea_password',
|
||||
field=models.CharField(default=None, max_length=32, verbose_name='Name of this configuration'),
|
||||
model_name="instancecreated",
|
||||
name="gitea_password",
|
||||
field=models.CharField(
|
||||
default=None, max_length=32, verbose_name="Name of this configuration"
|
||||
),
|
||||
),
|
||||
]
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
enough --domain d.{{ hostea_domain }} host create {{subdomain}}-host
|
||||
enough --domain d.{{ hostea_domain }} service create --host {{subdomain}}-host gitea
|
||||
enough --domain $domain host create {{subdomain}}-host
|
||||
enough --domain $domain service create --host {{subdomain}}-host gitea
|
||||
|
|
|
@ -1 +1 @@
|
|||
enough --domain d.{{ hostea_domain }} host delete hostea001-host
|
||||
enough --domain $domain host delete hostea001-host
|
||||
|
|
|
@ -42,7 +42,6 @@ class InfraUtilTest(TestCase):
|
|||
"REMOTE": "git@git.batsense.net:realaravinth/dummy-hostea-dash-test",
|
||||
"SSH_KEY": "/src/atm/.ssh/aravinth",
|
||||
},
|
||||
"HOSTEA_DOMAIN": "hostea.org",
|
||||
}
|
||||
}
|
||||
)
|
||||
|
@ -84,7 +83,6 @@ class InfraUtilTest(TestCase):
|
|||
"REMOTE": "git@git.batsense.net:realaravinth/dummy-hostea-dash-test",
|
||||
"SSH_KEY": "/src/atm/.ssh/aravinth",
|
||||
},
|
||||
"HOSTEA_DOMAIN": "hostea.org",
|
||||
}
|
||||
}
|
||||
)
|
||||
|
@ -102,3 +100,5 @@ class InfraUtilTest(TestCase):
|
|||
|
||||
instance = Instance.objects.get(name=subdomain)
|
||||
woodpecker_agent_secret = infra.add_vm(instance=instance)
|
||||
|
||||
# infra.remove_vm(instance=instance)
|
||||
|
|
|
@ -32,7 +32,6 @@ class Infra:
|
|||
|
||||
def __init__(self):
|
||||
conf = settings.HOSTEA["INFRA"]["HOSTEA_REPO"]
|
||||
self.hostea_domain = settings.HOSTEA["INFRA"]["HOSTEA_DOMAIN"]
|
||||
self.repo_path = Path(conf["PATH"])
|
||||
if not self.repo_path.exists():
|
||||
os.makedirs(self.repo_path)
|
||||
|
@ -189,7 +188,7 @@ class Infra:
|
|||
subdomain=subdomain,
|
||||
content=render_to_string(
|
||||
"infrastructure/sh/hostscripts/create.sh",
|
||||
context={"subdomain": subdomain, "hostea_domain": self.hostea_domain},
|
||||
context={"subdomain": subdomain},
|
||||
),
|
||||
)
|
||||
|
||||
|
@ -213,8 +212,8 @@ class Infra:
|
|||
self.write_hostscript(
|
||||
subdomain=subdomain,
|
||||
content=render_to_string(
|
||||
"infrastructure/sh/hostscripts/create.sh",
|
||||
context={"subdomain": subdomain, "hostea_domain": self.hostea_domain},
|
||||
"infrastructure/sh/hostscripts/rm.sh",
|
||||
context={"subdomain": subdomain},
|
||||
),
|
||||
)
|
||||
self._commit(action="rm", subdomain=subdomain)
|
||||
|
|
Loading…
Reference in New Issue