Skip to content

Instantly share code, notes, and snippets.

@Code-Hex
Forked from saboyutaka/Makefile
Last active June 27, 2017 00:34
Show Gist options
  • Save Code-Hex/000550def0c3c3f7c00e100840c427c0 to your computer and use it in GitHub Desktop.
Save Code-Hex/000550def0c3c3f7c00e100840c427c0 to your computer and use it in GitHub Desktop.
.DEFAULT_GOAL := help
config: ## copy configs from repository to conf
@sudo cp ~/$HOME/webapp/conf/nginx/nginx.conf /etc/nginx/
@sudo cp ~/$HOME/webapp/conf/nginx/isucon.conf /etc/nginx/conf.d/
@sudo cp ~/$HOME/webapp/conf/mysql/my.cnf /etc/mysql/
@make -s nginx-restart
@make -s mysql-restart
@make -s go-restart
go-start: ## Run Server
@sudo systemctl start isu-go
go-stop: ## Stop Server
@sudo systemctl stop isu-go
go-log: ## log Server
@sudo journalctl -u isu-go
go-restart: ## Restart Server
@sudo systemctl restart isu-go
@echo 'Restart isu-go'
nginx-restart: ## Restart nginx
@sudo systemctl restart nginx
@echo 'Restart nginx'
nginx-reset-log: ## reest log and restart nginx
@sudo rm /var/log/nginx/access.log;sudo systemctl restart nginx
nginx-log: ## tail nginx access.log
@sudo tail -f /var/log/nginx/access.log
nginx-error-log: ## tail nginx error.log
@sudo tail -f /var/log/nginx/error.log
mysql-restart: ## Restart mysql
@sudo systemctl restart mysql
@echo 'Restart mysql'
myprofiler: ## Run myprofiler
@myprofiler -user=root
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment