Skip to content

Tutorial 1: Your first commit

Adam Hope edited this page Nov 20, 2019 · 5 revisions

Everyone on the team should complete this exercise as soon as they have access to the team repo.

Prerequisites

  1. Set up the project: Installation Instructions

Instructions

  1. Git pull to get the latest code git pull --rebaseread this if you're not sure what --rebase does
  2. In the client/src/js/pages/teamPage folder, there will be a file called teamPage.spec.js.
  3. Add a test that checks for your name in the describe template tests. (The code should look similar to this)
  describe('#render', () => {
    it('should render my team page', () => {
      const page = new TeamPage();
      expect(page.render()).toContain("<h1>Made by:</h1>");
    });

    it('should contain team members names', () => {
      const page = new TeamPage();
      expect(page.render()).toContain("Sheila");
      expect(page.render()).toContain("Bruce");
    });
  });
  1. Run
    ./go pre-commit (OS X)
    npm -s run test (Windows)
    This will run the pre-commit checks - something should fail.
  2. Fix the failing test by adding your name and your pairs name to the team page in client/src/pages/teamPage/teamPage.hbs
  3. Run the tests again ./go test – everything should pass.

Before you push

  1. Check the CI build (see below), do not pull unless it's green!
  2. Run git pull --rebase
  3. Fix any merge conflicts
  4. Run ./go pre-commit (OS X) npm -s run test (Windows)
  5. Repeat steps 2-5 until all tests have passed and all conflicts have been resolved

Push your code

  1. Run git add -p to add your changes.
  2. Run git commit -m "[COMMIT MESSAGE] your commit message in the following format
  • git commit -m "[name 1/name 2][#0] {verb here} {what your commit does here}"

e.g.

  • git commit -m "[Bruce/Sheila][#0] Add names Bruce and Sheila to team page"
  1. Git pull to get the latest changes git pull --rebase
  2. ./go pre-commit
  3. Push your changes git push origin master

Check the build status

To view the build status and get notifications about the build status:

Add the following XML config to CCTray or CCMenu on your dev machine

https://circleci.com/gh/twlevelup/watch_edition.cc.xml

You can also access the CI server and view the status of the build here Circle CI