Skip to content

Instantly share code, notes, and snippets.

@azharuddinkhan3005
Last active July 31, 2018 06:49
Show Gist options
  • Save azharuddinkhan3005/b6de00ec60939e83b7caed378bd5733f to your computer and use it in GitHub Desktop.
Save azharuddinkhan3005/b6de00ec60939e83b7caed378bd5733f to your computer and use it in GitHub Desktop.
Curemint Workflow.

Before we start any of the operations after you do vagrant ssh(after going inside the guest system) please run these two steps

git config --global user.email "<your github email ID>"
git config --global user.name "<your github username>"
  1. We have our local repository in place where the master branch refers to Pantheon's Dev env.

  2. We need to have the workflow in conjunction with GitHub.(https://github.com/fawadafr/curemint)

  3. When we go to our local repository and run git remote -v then we get this

origin	ssh://codeserver.dev.e7c1f0be-57f1-4a87-81a6-ee8dbf055d10@codeserver.dev.e7c1f0be-57f1-4a87-81a6-ee8dbf055d10.drush.in:2222/~/repository.git (fetch)
origin	ssh://codeserver.dev.e7c1f0be-57f1-4a87-81a6-ee8dbf055d10@codeserver.dev.e7c1f0be-57f1-4a87-81a6-ee8dbf055d10.drush.in:2222/~/repository.git (push)

So this means we have only one remote added which is the Pantheon's one.

  1. Here we need to add another remote(GitHub one) which we can do it by running this command git remote add github [email protected]:fawadafr/curemint.git

  2. Now when we run git remote -v then we will be able to see two remote, i.e Pantheon's one (pointed out in the earlier step) and the new GitHub one

github	[email protected]:fawadafr/curemint.git (fetch)
github	[email protected]:fawadafr/curemint.git (push)
origin	ssh://codeserver.dev.e7c1f0be-57f1-4a87-81a6-ee8dbf055d10@codeserver.dev.e7c1f0be-57f1-4a87-81a6-ee8dbf055d10.drush.in:2222/~/repository.git (fetch)
origin	ssh://codeserver.dev.e7c1f0be-57f1-4a87-81a6-ee8dbf055d10@codeserver.dev.e7c1f0be-57f1-4a87-81a6-ee8dbf055d10.drush.in:2222/~/repository.git (push)
  1. Now we need to sync the two of the remotes master branches. So for that we need to do the following
git pull github master
  1. Need to pull in the srijan-dev and srijan-stg branches from pantheon remote.(This is will be a step ahead before moving the code to Pantheon's Dev)
git fetch origin
git checkout srijan-dev
git checkout master
git checkout srijan-stg

This ensures we have Pantheon remote's srijan-dev branch on our local so now switch back to the master branch (git checkout master).

  1. 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 CUR-89 then create a new branch with the name CUR-89 by

git checkout master
git checkout -b cur-89
  1. 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 github cur-89

Please follow this commit commenting pattern.

Ticket #<Ticket number> <Your comment.>

Example:

Ticket #CUR-89 This is my test comment.

  1. Then go to your GitHub repo on browser (https://github.com/fawadafr/curemint) 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.

  2. Then in order to unit test our changes on pantheon we need to merge github's ticket (in this case it is cur-89) branch into pantheon's srijan-dev branch.

git checkout srijan-dev
git pull origin master
git pull github cur-89
git push origin srijan-dev

Then goto http://srijan-dev-curemint.pantheonsite.io to test your changes.

  1. Then in order to QA our changes on pantheon we need to checkout to the branch srijan-stg and pull all the changes made in your ticket(CUR 89) into this branch and push it to Pantheon
git checkout srijan-stg
git pull origin master
git pull github cur-89
git push origin srijan-stg

Then goto http://srijan-stg-curemint.pantheonsite.io to test your changes.

  1. Once the QA approves it your ticket will be merged into GitHub master and consequently to Pantheon's master.

NOTE!!!

Before committing your code if you have added/edited any custom files(ignore the configuration and auto generated files) then we need to check for standards!
If we have added/edited any custom SASS files then to check the standards of that file run
scss-lint <path/to/your/file>
If we have added/edited any custom files(PHP/Drupal related) then to check the standards of that file run
drupalcs <path/to/your/file>

drupalcsp <path/to/your/file>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment