forked from sh-edraft.de/sh_discord_bot
		
	Added post-build project #70-1
This commit is contained in:
		| @@ -12,9 +12,11 @@ | ||||
|       "database": "src/modules/database/database.json", | ||||
|       "moderator": "src/modules/moderator/moderator.json", | ||||
|       "permission": "src/modules/permission/permission.json", | ||||
|       "bot-api": "src/bot_api/bot-api.json" | ||||
|       "bot-api": "src/bot_api/bot-api.json", | ||||
|       "post-build": "tools/post_build/post-build.json" | ||||
|     }, | ||||
|     "Scripts": { | ||||
|       "post-build": "cpl run post-build", | ||||
|       "prod": "export KDB_ENVIRONMENT=production; export KDB_NAME=KDB-Prod; cpl start;", | ||||
|       "stage": "export KDB_ENVIRONMENT=staging; export KDB_NAME=KDB-Stage; cpl start;", | ||||
|       "dev": "export KDB_ENVIRONMENT=development; export KDB_NAME=KDB-Dev; cpl start;", | ||||
|   | ||||
							
								
								
									
										1
									
								
								kdb-bot/tools/post_build/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								kdb-bot/tools/post_build/__init__.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| # imports:  | ||||
							
								
								
									
										16
									
								
								kdb-bot/tools/post_build/application.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								kdb-bot/tools/post_build/application.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | ||||
| from cpl_core.application import ApplicationABC | ||||
| from cpl_core.configuration import ConfigurationABC | ||||
| from cpl_core.console import Console | ||||
| from cpl_core.dependency_injection import ServiceProviderABC | ||||
|  | ||||
|  | ||||
| class Application(ApplicationABC): | ||||
|  | ||||
|     def __init__(self, config: ConfigurationABC, services: ServiceProviderABC): | ||||
|         ApplicationABC.__init__(self, config, services) | ||||
|  | ||||
|     def configure(self): | ||||
|         pass | ||||
|  | ||||
|     def main(self): | ||||
|         Console.write_line('Hello World') | ||||
							
								
								
									
										15
									
								
								kdb-bot/tools/post_build/appsettings.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								kdb-bot/tools/post_build/appsettings.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| { | ||||
|   "TimeFormatSettings": { | ||||
|     "DateFormat": "%Y-%m-%d", | ||||
|     "TimeFormat": "%H:%M:%S", | ||||
|     "DateTimeFormat": "%Y-%m-%d %H:%M:%S.%f", | ||||
|     "DateTimeLogFormat": "%Y-%m-%d_%H-%M-%S" | ||||
|   }, | ||||
|  | ||||
|   "LoggingSettings": { | ||||
|     "Path": "logs/", | ||||
|     "Filename": "log_$start_time.log", | ||||
|     "ConsoleLogLevel": "ERROR", | ||||
|     "FileLogLevel": "WARN" | ||||
|   } | ||||
| } | ||||
							
								
								
									
										14
									
								
								kdb-bot/tools/post_build/main.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								kdb-bot/tools/post_build/main.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| from cpl_core.application import ApplicationBuilder | ||||
|  | ||||
| from post_build.application import Application | ||||
| from post_build.startup import Startup | ||||
|  | ||||
|  | ||||
| def main(): | ||||
|     app_builder = ApplicationBuilder(Application) | ||||
|     app_builder.use_startup(Startup) | ||||
|     app_builder.build().run() | ||||
|  | ||||
|  | ||||
| if __name__ == '__main__': | ||||
|     main() | ||||
							
								
								
									
										44
									
								
								kdb-bot/tools/post_build/post-build.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								kdb-bot/tools/post_build/post-build.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,44 @@ | ||||
| { | ||||
|   "ProjectSettings": { | ||||
|     "Name": "post-build", | ||||
|     "Version": { | ||||
|       "Major": "0", | ||||
|       "Minor": "0", | ||||
|       "Micro": "0" | ||||
|     }, | ||||
|     "Author": "", | ||||
|     "AuthorEmail": "", | ||||
|     "Description": "", | ||||
|     "LongDescription": "", | ||||
|     "URL": "", | ||||
|     "CopyrightDate": "", | ||||
|     "CopyrightName": "", | ||||
|     "LicenseName": "", | ||||
|     "LicenseDescription": "", | ||||
|     "Dependencies": [ | ||||
|       "cpl-core>=2022.10.0.post7" | ||||
|     ], | ||||
|     "DevDependencies": [ | ||||
|       "cpl-cli>=2022.10.0" | ||||
|     ], | ||||
|     "PythonVersion": ">=3.10.4", | ||||
|     "PythonPath": {}, | ||||
|     "Classifiers": [] | ||||
|   }, | ||||
|   "BuildSettings": { | ||||
|     "ProjectType": "console", | ||||
|     "SourcePath": "", | ||||
|     "OutputPath": "../../dist", | ||||
|     "Main": "post_build.main", | ||||
|     "EntryPoint": "post-build", | ||||
|     "IncludePackageData": false, | ||||
|     "Included": [], | ||||
|     "Excluded": [ | ||||
|       "*/__pycache__", | ||||
|       "*/logs", | ||||
|       "*/tests" | ||||
|     ], | ||||
|     "PackageData": {}, | ||||
|     "ProjectReferences": [] | ||||
|   } | ||||
| } | ||||
							
								
								
									
										16
									
								
								kdb-bot/tools/post_build/startup.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								kdb-bot/tools/post_build/startup.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | ||||
| from cpl_core.application import StartupABC | ||||
| from cpl_core.configuration import ConfigurationABC | ||||
| from cpl_core.dependency_injection import ServiceProviderABC, ServiceCollectionABC | ||||
| from cpl_core.environment import ApplicationEnvironment | ||||
|  | ||||
|  | ||||
| class Startup(StartupABC): | ||||
|  | ||||
|     def __init__(self): | ||||
|         StartupABC.__init__(self) | ||||
|  | ||||
|     def configure_configuration(self, configuration: ConfigurationABC, environment: ApplicationEnvironment) -> ConfigurationABC: | ||||
|         return configuration | ||||
|  | ||||
|     def configure_services(self, services: ServiceCollectionABC, environment: ApplicationEnvironment) -> ServiceProviderABC: | ||||
|         return services.build_service_provider() | ||||
		Reference in New Issue
	
	Block a user