Improve config (json) file creation
This commit is contained in:
		
							parent
							
								
									1d4e9efa15
								
							
						
					
					
						commit
						525eb21649
					
				
					 6 changed files with 91 additions and 84 deletions
				
			
		
							
								
								
									
										1
									
								
								.env
									
										
									
									
									
								
							
							
						
						
									
										1
									
								
								.env
									
										
									
									
									
								
							| 
						 | 
					@ -1 +0,0 @@
 | 
				
			||||||
DATABASE_URL="sqlite://emgauwa-dev.sqlite"
 | 
					 | 
				
			||||||
							
								
								
									
										19
									
								
								.gitignore
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										19
									
								
								.gitignore
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -1,15 +1,8 @@
 | 
				
			||||||
/target/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/tests/testing/
 | 
					 | 
				
			||||||
/tests/testing_bak/
 | 
					 | 
				
			||||||
/tests/testing_latest/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
emgauwa-*.sqlite
 | 
					 | 
				
			||||||
emgauwa-*.sqlite-*
 | 
					 | 
				
			||||||
emgauwa-*.json
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Added by cargo
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/target
 | 
					/target
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/.env
 | 
				
			||||||
/api.http
 | 
					/api.http
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/emgauwa-*.sqlite
 | 
				
			||||||
 | 
					/emgauwa-*.sqlite-*
 | 
				
			||||||
 | 
					/emgauwa-*.json
 | 
				
			||||||
							
								
								
									
										19
									
								
								Makefile
									
										
									
									
									
								
							
							
						
						
									
										19
									
								
								Makefile
									
										
									
									
									
								
							| 
						 | 
					@ -1,5 +1,13 @@
 | 
				
			||||||
 | 
					ifneq (,$(wildcard ./.env))
 | 
				
			||||||
 | 
					    include .env
 | 
				
			||||||
 | 
					    export
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					DATABASE_URL ?= sqlite://emgauwa-dev.sqlite
 | 
				
			||||||
 | 
					export DATABASE_URL
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sqlx:
 | 
					sqlx:
 | 
				
			||||||
	cargo sqlx database drop
 | 
						cargo sqlx database drop -y
 | 
				
			||||||
	cargo sqlx database create
 | 
						cargo sqlx database create
 | 
				
			||||||
	cargo sqlx migrate run
 | 
						cargo sqlx migrate run
 | 
				
			||||||
	cargo sqlx prepare --workspace
 | 
						cargo sqlx prepare --workspace
 | 
				
			||||||
| 
						 | 
					@ -7,9 +15,16 @@ sqlx:
 | 
				
			||||||
build-rpi:
 | 
					build-rpi:
 | 
				
			||||||
	cross build --target arm-unknown-linux-gnueabihf
 | 
						cross build --target arm-unknown-linux-gnueabihf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
emgauwa-%.json: config/emgauwa-%.pkl config/lib/%.pkl config/lib/common.pkl
 | 
					emgauwa-%.json: config/emgauwa-%.pkl config/lib/%.pkl config/lib/common.pkl $(wildcard .env)
 | 
				
			||||||
	pkl eval -f json -o $@ $<
 | 
						pkl eval -f json -o $@ $<
 | 
				
			||||||
 | 
					
 | 
				
			||||||
configs:
 | 
					configs:
 | 
				
			||||||
	$(MAKE) emgauwa-core.json
 | 
						$(MAKE) emgauwa-core.json
 | 
				
			||||||
	$(MAKE) emgauwa-controller.json
 | 
						$(MAKE) emgauwa-controller.json
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					clean:
 | 
				
			||||||
 | 
						rm -f emgauwa-controller.json
 | 
				
			||||||
 | 
						rm -f emgauwa-controller.sqlite
 | 
				
			||||||
 | 
						rm -f emgauwa-core.json
 | 
				
			||||||
 | 
						rm -f emgauwa-core.sqlite
 | 
				
			||||||
 | 
						rm -f emgauwa-dev.sqlite
 | 
				
			||||||
| 
						 | 
					@ -13,7 +13,7 @@ permissions {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
logging {
 | 
					logging {
 | 
				
			||||||
	level = "DEBUG"
 | 
					  level = read?("env:LOGGING_LEVEL") ?? "DEBUG"
 | 
				
			||||||
  file = "stdout"
 | 
					  file = "stdout"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,6 +13,6 @@ permissions {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
logging {
 | 
					logging {
 | 
				
			||||||
	level = "DEBUG"
 | 
					  level = read?("env:LOGGING_LEVEL") ?? "DEBUG"
 | 
				
			||||||
  file = "stdout"
 | 
					  file = "stdout"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -10,6 +10,6 @@ class PermissionsConfig {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class LoggingConfig {
 | 
					class LoggingConfig {
 | 
				
			||||||
	level: String
 | 
					  level: "TRACE"|"DEBUG"|"INFO"|"WARN"|"ERROR"|"FATAL"
 | 
				
			||||||
  file: String
 | 
					  file: String
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue