mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-21 15:10:22 +00:00
core
This commit is contained in:
parent
65500eb06e
commit
ba4142e7fe
7 changed files with 30 additions and 21 deletions
Binary file not shown.
Binary file not shown.
|
@ -15,12 +15,28 @@ class Print:
|
|||
model.FileOp.printJson(path_repo)
|
||||
|
||||
|
||||
class Github:
|
||||
class Create:
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
def __init__(self, app_name: str, project_name: str):
|
||||
|
||||
self.folder = None
|
||||
self.app_name = app_name
|
||||
self.project_name = project_name
|
||||
|
||||
if self.project_name != None:
|
||||
self.folder = self.project_name
|
||||
else:
|
||||
self.folder = self.app_name
|
||||
|
||||
def gitClone(name: str):
|
||||
cmd = "git clone --depth=1 " + model.SmoothUrl.res(github_url) + "/websoft9/docker-" + name + " repo/docker-"+name
|
||||
def downRepo(self):
|
||||
cmd = "git clone --depth=1 " + model.SmoothUrl.res(github_url) + "/websoft9/docker-" + self.app_name + " " + self.folder
|
||||
if os.path.exists("./"+self.folder):
|
||||
print(os.path.abspath(self.folder)+" folder already exists")
|
||||
else:
|
||||
os.system(cmd)
|
||||
|
||||
def upRepo(self):
|
||||
cmd = "docker-compose -f docker-compose-production.yml --env-file .env_all up -d"
|
||||
print(cmd)
|
||||
os.chdir(self.folder)
|
||||
os.system(cmd)
|
1
cli/drupal2
Submodule
1
cli/drupal2
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 8531fd12cacfb9881de3c270f2b81e17b20f5a99
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
import os, io, sys, platform, shutil, urllib3, json, time, subprocess
|
||||
import os, io, sys, platform, shutil, urllib3, json, time, subprocess, pprint
|
||||
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Type, Union
|
||||
|
||||
import urllib.parse
|
||||
|
|
1
cli/repo/docker-drupal2
Submodule
1
cli/repo/docker-drupal2
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 8531fd12cacfb9881de3c270f2b81e17b20f5a99
|
|
@ -1,9 +1,9 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Type, Union
|
||||
import os, io, sys, platform, shutil, urllib3, json, time, subprocess
|
||||
import model, controller
|
||||
|
||||
|
||||
import typer
|
||||
|
||||
app = typer.Typer()
|
||||
|
@ -14,9 +14,11 @@ def list():
|
|||
controller.Print.printRepo()
|
||||
|
||||
@app.command()
|
||||
def gitclone(name: str):
|
||||
'''git clone'''
|
||||
controller.Github.gitClone(name)
|
||||
def create(app_name: str, project_name: Optional[str] = None):
|
||||
'''create one application'''
|
||||
create = controller.Create(app_name, project_name)
|
||||
create.downRepo()
|
||||
create.upRepo()
|
||||
|
||||
@app.command()
|
||||
def update(name: str):
|
||||
|
@ -48,16 +50,5 @@ def package(name: str):
|
|||
typer.echo(f"Hello {name}")
|
||||
|
||||
|
||||
@app.command()
|
||||
def install(name: str, formal: bool = False, type: str = None):
|
||||
'''install one application'''
|
||||
if formal:
|
||||
typer.echo(f"Goodbye Ms. {name}. Have a good day.")
|
||||
else:
|
||||
typer.echo(f"Bye {name}!")
|
||||
|
||||
os.system("gh repo list websoft9 --public --no-archived")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app()
|
Loading…
Reference in a new issue