Make sure you have NodeJS and NPM installed. See (Test specification)[https://github.com/sk222sw/dotons/wiki/Teknisk-dokumentation] for more info
-
npm installto install dependencies -
npm install -g supervisorto install supervisor globally -
npm startto start expressjs backend. node supervisor will auto-restart on save -
npm run watchin a new terminal and webpack will bundle client side code and update on save
-
npm installto install dependencies -
npm install -g supervisorto install supervisor globally -
webpack -pto make webpack bundle and minify client side code -
npm run deployfor unix systems ornpm run deploy-windowson windows to run express in production mode
We have at least 2 branches at all times, Master and Develop.
- Master - only has production-ready code that works and is tested(heh) and is the branch that is pushed to deployment on Digital Ocean. NEVER work against this branch.
- Develop - the branch that contains code that works but may not be ready for production yet. AVOID working against this branch.
Daily workflow
-
git checkout -b new-branchcreate a new local branch that you will work against -
git pull origin developmake sure you have the latest changes from develop -
Make changes, code and stuf. Drink some coffee, eat a burger.
-
git add .orgit add filenameto stage the changes for a commit -
git commit -am "This is a meaningful commit message that explains what I've done -
git pull --rebase origin developto get the latest changes if someone else has been working. -
Solve possible conflicts
-
git checkout developto switch branch -
git merge --no-ff new-branchto merge your changes with develop -
git push origin developfinally push your changes to github -
git branch -d new-branchif you want to delete the local branch. Or keep it to work in it again.
Push to production
-
Make sure you are on the develop branch and no files are unstaged (else follow Daily Workflow first)
-
git pull origin developto get the latest changes -
git checkout master -
git merge --no-ff developmerge develop into master -
git push origin master- update remote master branch -
git push live master- push to the live branch (DigitalOcean droplet)