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>"
-
We have our local repository in place where the
master
branch refers toPantheon's Dev
env. -
We need to have the workflow in conjunction with GitHub.(https://github.com/fawadafr/curemint)
-
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.
-
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
-
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)
- 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
- Need to pull in the
srijan-dev
andsrijan-stg
branches from pantheon remote.(This is will be a step ahead before moving the code toPantheon'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
).
- Now for developing your ticket firstly create a new branch while being on
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
- 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.
-
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.
-
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.
- 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.
- Once the QA approves it your ticket will be merged into GitHub
master
and consequently toPantheon's
master
.
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!
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>