fix & rm: create/rm hostscripts, rm HOSTEA_DOMAIN
ci/woodpecker/push/woodpecker Pipeline failed Details
ci/woodpecker/pr/woodpecker Pipeline failed Details

pull/1/head
Aravinth Manivannan 2022-06-25 18:24:52 +05:30
parent 871a05ddd3
commit 26b7ea3ef2
Signed by: realaravinth
GPG Key ID: AD9F0F08E855ED88
7 changed files with 16 additions and 19 deletions

View File

@ -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

View File

@ -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"
},
```

View File

@ -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"
),
),
]

View File

@ -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

View File

@ -1 +1 @@
enough --domain d.{{ hostea_domain }} host delete hostea001-host
enough --domain $domain host delete hostea001-host

View File

@ -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)

View File

@ -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)