-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevops.json
40 lines (40 loc) · 1.2 KB
/
devops.json
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
{
"push": [
{
"name": "add",
"command": "git add ."
},
{
"name": "commit",
"command": "git commit -m \"Update from $(whoami) on $(date +\"%Y-%m-%d %T\")\""
},
{
"name": "push",
"command": "git push"
}
],
"pull": [
{
"name": "pull",
"command": "git pull"
},
{
"name": "build",
"command": "cd ./web && npm run build"
},
{
"name": "pm2 restart",
"command": "pm2 restart all"
}
],
"backups": [
{
"name": "create",
"command": "bash -c 'source .env && docker exec my_mysql mysqldump -u $MYSQL_USERNAME -p\"$MYSQL_PASSWORD\" --databases $MYSQL_DATABASE --routines --triggers --events > /root/backups/databases_backup.sql'"
},
{
"name": "sent",
"command": "bash -c 'source .env && curl -s -F \"caption=Backup of database: $MYSQL_DATABASE\" -F \"chat_id=$BACKUP_CHAT_ID\" -F document=@\"/root/backups/databases_backup.sql\" https://api.telegram.org/bot$BACKUP_BOT_TOKEN/sendDocument'"
}
]
}