|
@@ -20,23 +20,6 @@ def help() -> None:
|
|
|
print(h)
|
|
print(h)
|
|
|
|
|
|
|
|
|
|
|
|
|
-class Pwa:
|
|
|
|
|
- """Класс сборки PWA
|
|
|
|
|
- """
|
|
|
|
|
-
|
|
|
|
|
- def __init__(self) -> None:
|
|
|
|
|
- pass
|
|
|
|
|
-
|
|
|
|
|
- def run(self) -> None:
|
|
|
|
|
- print('build PWA')
|
|
|
|
|
- os.chdir("../app_pwa")
|
|
|
|
|
- cmd: str = 'GOARCH=wasm ' +\
|
|
|
|
|
- 'GOOS=js ' +\
|
|
|
|
|
- 'go build -o ' +\
|
|
|
|
|
- '../app_work/bin/web/static/wasm/app.wasm ./cmd/client/main.go'
|
|
|
|
|
- os.system(cmd)
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
class Build:
|
|
class Build:
|
|
|
"""Класс сборки
|
|
"""Класс сборки
|
|
|
"""
|
|
"""
|
|
@@ -90,8 +73,7 @@ class Build:
|
|
|
except FileExistsError:
|
|
except FileExistsError:
|
|
|
pass
|
|
pass
|
|
|
print("copying")
|
|
print("copying")
|
|
|
- os.system('cp -r ../app_serv/web ./bin')
|
|
|
|
|
- os.chdir("../app_serv")
|
|
|
|
|
|
|
+ os.system('cp -r ../web ./bin')
|
|
|
print("format")
|
|
print("format")
|
|
|
os.system("go fmt ./...")
|
|
os.system("go fmt ./...")
|
|
|
print("build")
|
|
print("build")
|
|
@@ -99,10 +81,9 @@ class Build:
|
|
|
f"""main.GoVersion={self.go_version} -X """ +\
|
|
f"""main.GoVersion={self.go_version} -X """ +\
|
|
|
"""main.Version=$TAG -X """ +\
|
|
"""main.Version=$TAG -X """ +\
|
|
|
"""main.Date=$BUILD_DATE" -o """ +\
|
|
"""main.Date=$BUILD_DATE" -o """ +\
|
|
|
- '../app_work/bin/server.exe ./cmd/server/main.go'
|
|
|
|
|
|
|
+ '../bin/server.exe ./cmd/server/main.go'
|
|
|
print(cmd)
|
|
print(cmd)
|
|
|
os.system(cmd)
|
|
os.system(cmd)
|
|
|
- os.chdir("../app_work")
|
|
|
|
|
print('stripping')
|
|
print('stripping')
|
|
|
os.system('strip -s ./bin/server.exe')
|
|
os.system('strip -s ./bin/server.exe')
|
|
|
print('packing exe')
|
|
print('packing exe')
|
|
@@ -141,18 +122,15 @@ class Dev:
|
|
|
except FileExistsError:
|
|
except FileExistsError:
|
|
|
pass
|
|
pass
|
|
|
print("copying")
|
|
print("copying")
|
|
|
- os.system('cp -r ../app_serv/web ./bin')
|
|
|
|
|
- os.chdir("../app_serv")
|
|
|
|
|
|
|
+ os.system('cp -r ../web ./bin')
|
|
|
print("format")
|
|
print("format")
|
|
|
os.system("go fmt ./...")
|
|
os.system("go fmt ./...")
|
|
|
print("build")
|
|
print("build")
|
|
|
cmd: str = """go build """ +\
|
|
cmd: str = """go build """ +\
|
|
|
- '-o ../app_work/bin/server.exe ./cmd/server/main.go'
|
|
|
|
|
|
|
+ '-o ../bin/server.exe ./cmd/server/main.go'
|
|
|
print(cmd)
|
|
print(cmd)
|
|
|
os.system(cmd)
|
|
os.system(cmd)
|
|
|
- pwa: Pwa = Pwa()
|
|
|
|
|
- pwa.run()
|
|
|
|
|
- os.chdir("../app_work/bin")
|
|
|
|
|
|
|
+ os.chdir("../bin")
|
|
|
os.unsetenv('STAGE')
|
|
os.unsetenv('STAGE')
|
|
|
os.putenv('STAGE', 'local')
|
|
os.putenv('STAGE', 'local')
|
|
|
os.system('./server.exe')
|
|
os.system('./server.exe')
|