====== VFOSS.ORG Administration ====== vfoss.org admin 1..2.. ===== Site ID ===== goto admin and change sitename, first it may still show the old name (example.com). ===== Django-filer image ===== Write access for 'media' folder: chmod -R 777 vfoss_org/media Image support yum install tcl-devel libpng-devel libjpeg-devel ghostscript-devel bzip2-devel freetype-devel libtiff-devel ===== Production upgrade steps ===== - Ordered List ItemSync production with local and Create backup branch / commit point. - Create copy of candidate release branch year_month_cr1. - Backup data base year_month_db_dump_x - Merge production with cr1 (See merge instruction following). git merge no-ff no-commit - Fiels will be merged / git add but not committed. How to reverse?, see git reset.. - check settings.py - use production wsgi: git checkout production -- wsgi.py / git rm if not commited - http://stackoverflow.com/questions/6919121/why-are-there-2-ways-to-unstage-a-file-in-git - git reset --hard HEAD~1 file .. is **not** the way ** git checkout production -- file** - test.env.json / env.json??? - Cleanup prodction and push - Sync ====== Merge Production Branch With Master Branch ====== After making changes to master branch, we want to merge those changes with production branch. However, some files must not be merged with those from master branch, e.g., wsgi, env files, settings.py. The solution is selective merge. Merge with master branch without commits: git merge --no-ff --no-commit master git status To select the version in the current branch, run: git checkout HEAD wsgi.py If you want the version in master (and not a true merge), run: git checkout master file_name ref: http://stackoverflow.com/questions/449541/how-do-you-merge-selective-files-with-git-merge ====== Update Website ====== * pull production branch from bitbucket * create env.json { "FILENAME": "env.json", "SECRET_KEY": "j@rxzf_*!7#f@i69g3sj0ca_zj8hnhu#ka^iw=cs+u$wuq$@z2", "DB_HOST": "127.0.0.1", "DB_PORT": "5432", "DB_NAME": "vfossdb", "DB_USER": "vfossdbuser", "DB_PASSWORD": "vfossdbuser", "SOCIAL_AUTH_FACEBOOK_KEY": "718938904791933", "SOCIAL_AUTH_FACEBOOK_SECRET": "af333859c023d7cdbb454b30c918003c" } ====== Django Nginx Static file ====== * 2017/01/14 02:54:32 [error] 5229#0: send() failed (111: Connection refused) while resolving, resolver: 127.0.0.1:53 * http://stackoverflow.com/a/40082920/707704 ====== - Docker Deployment Admin ====== ===== - Workflow ===== Workflow: http://localhost/~dang/wiki/doku.php?id=devops:docker:docker_dev_workflow#test_production_image Hosting with docker: http://localhost/~dang/wiki/doku.php?id=devops:docker:web_hosting ===== - Data Backup ===== * https://docs.docker.com/engine/tutorials/dockervolumes/#backup-restore-or-migrate-data-volumes Backup your databases docker exec -t your-db-container pg_dumpall -c -U postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql Restore your databases cat your_dump.sql | docker exec -i your-db-container psql -U postgres ====== - Minikube ====== * Minikube installation: http://localhost/~dang/wiki/doku.php?id=programming:kubenetes_for_dev:0_minikube#install_minikube ===== - Minikube deployment ===== minikube start --vm-driver=kvm2 -p visrc.kube --memory=4096