Skip to content

Instantly share code, notes, and snippets.

@saboyutaka
Last active July 10, 2017 07:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save saboyutaka/010f52f460973a6dca2e1901c45fb9fd to your computer and use it in GitHub Desktop.
Save saboyutaka/010f52f460973a6dca2e1901c45fb9fd to your computer and use it in GitHub Desktop.
.DEFAULT_GOAL := help
config: ## copy configs from repository to conf
@sudo cp ~/private_isu/webapp/conf/systemd/isu-ruby.service /etc/systemd/system/
@sudo cp ~/private_isu/webapp/conf/nginx/nginx.conf /etc/nginx/
@sudo cp ~/private_isu/webapp/conf/nginx/isucon.conf /etc/nginx/conf.d/
@sudo cp ~/private_isu/webapp/conf/mysql/my.cnf /etc/mysql/
@make -s nginx-restart
@make -s mysql-restart
@make -s ruby-restart
ruby-start: ## Run Server
@sudo systemctl start isu-ruby
ruby-stop: ## Stop Server
@sudo systemctl stop isu-ruby
ruby-log: ## log Server
@sudo journalctl -u isu-ruby
ruby-restart: ## Restart Server
@sudo systemctl daemon-reload
@cd webapp/ruby; bundle 1> /dev/null
@sudo systemctl restart isu-ruby
@echo 'Restart isu-ruby'
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 service nginx restart
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-z0-9A-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