Skip to content

Instantly share code, notes, and snippets.

@azharuddinkhan3005
Last active March 26, 2019 16:55
Show Gist options
  • Save azharuddinkhan3005/f833a792c58edc940b052563373a3af4 to your computer and use it in GitHub Desktop.
Save azharuddinkhan3005/f833a792c58edc940b052563373a3af4 to your computer and use it in GitHub Desktop.
TMT FE

Before we start any of the operations (on your host system) please run these two steps

git config --global user.email "<your github email ID>"
git config --global user.name "<your github username>"

If done earlier then leave it!

  1. We need to have the workflow for TMT FE in conjunction with GitHub.(https://github.com/srijanaravali/tmtfe)

  2. Clone the repository https://github.com/srijanaravali/tmtfe into web > tmtweb.

    • Here the web folder resides within the folder which contains all tmt related docker files. For example your root folder is tmt then the tmtweb folder should be present at tmt>web>tmtweb
  3. After cloning the above repository navigate to the tmtweb folder, then from within that directory run

    • git config core.fileMode false.
  4. When we run the docker-compose up command the node_modules will be installed and the build will be made from within the container and the node_modules and the build folder will be available in the tmtweb folder . There might arise certain scenarios like:

    • Updating package.json and installing node_modules:
      • Update the package.json file
      • run docker exec -it <node_container_name> bash
      • navigate to /usr/src/app/ and run npm install
      • to come out of container run exit
    • Creating a build:
      • navigate to tmtweb folder and run npm run build
  5. Note: this step should be done after we have created all the docker containers(docker-compose up has been done)

    • Navigate to http://localhost:8089/, it will present the React's homepage
  6. When we go to our local repository and run git remote -v then we get this

    • origin	[email protected]:srijanaravali/tmtfe.git (fetch)
      origin	[email protected]:srijanaravali/tmtfe.git (push)
      
    • So this means we have only one remote added which is the GitHubs's srijanaravali one.
  7. Need to pull in the develop and npn branches from github's remote.

    • git fetch origin
      git checkout develop
      git checkout master
      git checkout npn
      
    • This ensures we have github remote's develop and npn branch on our local so now switch back to the master branch (git checkout master).
  8. Now for developing your ticket firstly create a new branch while being on master.

    • (All new branches should be made from master)

    • Suppose the ticket that you are working on is TMT-89 then create a new branch with the name TMT-89 by
    • git checkout master
      git checkout -b tmt-89
      
  9. After you have done all your development on this ticket add all the files to be commited, commit all the files to be commited and lastly push this ticket to GitHub

    • git add <your files>
      git commit -m "<give a proper comment>"
      git push origin tmt-89
      
    • Please follow this commit commenting pattern.
    • Ticket #<Ticket number> <Your comment.>
    • Example:
      • Ticket #TMT-89 This is my test comment.
  10. Then go to your GitHub repo on browser (https://github.com/srijanaravali/tmtfe) and there you will be prompted to create a pull request (PR) (click on the Compare & Pull request). After clicking on the Compare & Pull request button we will be taken to another page where we will be given a button to Create pull request. Click on it and your pull request will be created. Then assign it to a Reviewer.

  11. Then in order to unit test our changes on dev env we need to merge github's ticket (in this case it is tmt-89) branch into develop branch.

    • git checkout develop
      git pull origin tmt-89
      git push origin develop
      
    • Then goto https://TBD(to be decided) to test your changes.
  12. Then in order to QA our changes on npn env we need to checkout to the branch stage and pull all the changes made in your ticket(TMT 89) into this branch and push it to GitHub

    • git checkout stage
      git pull github tmt-89
      git push origin stage
      
    • Then goto https://TBD(to be decided) to test your changes.
  13. Once the QA approves it your ticket will be merged into GitHub master and consequently to prod env.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment