Make sure you have NodeJS and NPM installed. See (Test specification)[https://github.com/sk222sw/dotons/wiki/Teknisk-dokumentation] for more info
-
npm install
to install dependencies -
npm install -g supervisor
to install supervisor globally -
npm start
to start expressjs backend. node supervisor will auto-restart on save -
npm run watch
in a new terminal and webpack will bundle client side code and update on save
-
npm install
to install dependencies -
npm install -g supervisor
to install supervisor globally -
webpack -p
to make webpack bundle and minify client side code -
npm run deploy
for unix systems ornpm run deploy-windows
on 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-branch
create a new local branch that you will work against -
git pull origin develop
make sure you have the latest changes from develop -
Make changes, code and stuf. Drink some coffee, eat a burger.
-
git add .
orgit add filename
to 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 develop
to get the latest changes if someone else has been working. -
Solve possible conflicts
-
git checkout develop
to switch branch -
git merge --no-ff new-branch
to merge your changes with develop -
git push origin develop
finally push your changes to github -
git branch -d new-branch
if 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 develop
to get the latest changes -
git checkout master
-
git merge --no-ff develop
merge develop into master -
git push origin master
- update remote master branch -
git push live master
- push to the live branch (DigitalOcean droplet)