Skip to content

Instantly share code, notes, and snippets.

View ahmedfaragmostafa's full-sized avatar
🎯
Focusing

Ahmad Farag ahmedfaragmostafa

🎯
Focusing
View GitHub Profile
.DEFAULT_GOAL := help
# Show this help.
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
prepare: ## task to prepare whatever
@echo "prepare task triggered"
install: ## task to install whatever
@ahmedfaragmostafa
ahmedfaragmostafa / makeFile
Last active February 25, 2019 06:04
makeFile
.DEFAULT_GOAL := help
help:
@echo ""
@echo "Available tasks:"
@echo " prepare desc of the command prepare"
@echo " install desc of the command install"
@echo ""
prepare:
# mongotail [server_name]:[mongo_port]/[db_name] -f
# example
mongotail localhost:27017/logging_demo -f
#mongotail [server_name]:[mongo_port]/[db_name] --level=2
## Example
mongotail localhost:27017/logging_demo --level=2
# connect to your instance via ssh then run
ssh-keygen
sudo chmod -R 644 .ssh/id_rsa
cat .ssh/id_rsa.pub
# add the output string to your git account
# github settings=> SSH keys => Add new Key
# bitbucket settings=> ssh-keys => Add new Key
APP_ENV={{app_env}}
APP_DEBUG={{app_debug}}
APP_KEY={{app_key}}
APP_URL={{app_url}}
APP_NAME={{app_name}}
DB_HOST={{mysql_host}}
DB_DATABASE={{mysql_db}}
DB_USERNAME={{mysql_user}}
DB_PASSWORD={{mysql_pass}}
---
- name: Copy lara env file
become: true
template:
src: templates/env.conf
dest: "{{app_work_dir}}/.env"
tags:
- env-file
- mysql_user:
name: "{{mysql_user}}"
password: "{{mysql_pass}}"
priv: '*.*:ALL'
state: present
tags:
- mysql-db
##
- name: Create APP DB database
- name: Install Nginx web server
apt:
name: nginx
state: latest
notify: Restart Nginx
tags:
- nginx
###
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name {{ server_name }};
root {{ app_work_dir }}public;
location / {
try_files $uri $uri/ /index.php?$args;
index index.php index.html index.htm;
}