Add emitter and missing mongo-init.sh
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				continuous-integration/drone Build is passing
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	continuous-integration/drone Build is passing
				
			This commit is contained in:
		| @@ -1,6 +1,7 @@ | ||||
| FROM python | ||||
| WORKDIR /emitter | ||||
| RUN pip install pymongo | ||||
|  | ||||
| COPY ./emitter.py ./ | ||||
| ENTRYPOINT emitter.py | ||||
| CMD ["python", "./emitter.py"] | ||||
|  | ||||
| LABEL name="emitter" | ||||
|   | ||||
| @@ -2,12 +2,11 @@ from pymongo import MongoClient | ||||
| from bson.objectid import ObjectId | ||||
| from time import sleep | ||||
|  | ||||
| MONGO_URI="mongodb://127.0.0.1:27017" | ||||
| MONGO_URI="mongodb://127.0.0.1:27017/default" | ||||
|  | ||||
| client = MongoClient(MONGO_URI) | ||||
| db = client['default'] | ||||
| col = db['eventlog'] | ||||
| db = MongoClient(MONGO_URI).get_default_database()  | ||||
|  | ||||
| while True: | ||||
|     col.insertOne({"foo": "bar"}) | ||||
|     db.eventlog.insert_one({ "timestamp": "...", "event": "motion-detected", "started": "...", "finished": "...", "component": "motion-detect", "camera": "Server room", "action": "event", | ||||
|                     }) | ||||
|     sleep(1) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user