-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (33 loc) · 1.8 KB
/
Copy pathMakefile
File metadata and controls
40 lines (33 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
SHELL := /bin/bash
setup:
@echo -e "\e[34m####### Setup for InstAgent #######\e[0m"
@[ -d "app/config" ] || mkdir -p "app/config" || exit 1
@echo -n "{}" > app/config/settings.json
@read -p "Instagram Username: " uservar; \
read -sp "Instagram Password: " passvar; \
echo -en "[Credentials]\nusername = $$uservar\npassword = $$passvar" > app/config/credentials.ini || exit 1
@echo ""
@echo -e "\e[32mSetup Successful - app/config/credentials.ini created\e[0m"
run:
@echo -e "\e[34m######## Building and Running InstAgent with Docker-compose ########\e[0m"
@[ -d "app/config" ] || { echo -e "\e[31mConfig folder not found! Please run 'make setup' before running this command.\e[0m"; exit 1; }
@echo -e "\e[34m[#] Killing old docker processes\e[0m"
@docker-compose rm -fs || exit 1
@echo -e "\e[34m[#] Building docker container\e[0m"
@docker-compose build || exit 1
@read -p "Target Username: " username; \
docker-compose run --rm instagent $$username
build-run-testing:
@echo -e "\e[34m######## Building and Running InstAgent with Docker-compose for Testing/Debugging ########\e[0m"
@[ -d "app/config" ] || { echo -e "\e[31mConfig folder not found! Please run 'make setup' before running this command.\e[0m"; exit 1; }
@echo -e "\e[34m[#] Killing old docker processes\e[0m"
@docker-compose rm -fs || exit 1
@echo -e "\e[34m[#] Building docker container\e[0m"
@docker-compose build || exit 1
@echo -e "\e[34m[#] Running docker container in detached mode\e[0m"
@docker-compose run --name instagent-testing -d --rm --entrypoint "sleep infinity" instagent || exit 1
@echo -e "\e[32m[#] instagent-test container is now Running!\e[0m"
cleanup-testing:
@echo -e "\e[34m######## Cleanup Build-run-testing Container ########\e[0m"
@docker-compose down
@echo -e "\e[32m[#] instagent-test container has been removed\e[0m"