I am getting error at following line
List<Group> groupMembers = [SELECT Id, RelatedId, Type FROM Group WHERE RelatedId IN: sRoleIds AND Type =: 'Role'];
I am getting error at following line
List<Group> groupMembers = [SELECT Id, RelatedId, Type FROM Group WHERE RelatedId IN: sRoleIds AND Type =: 'Role'];
There are only two (out of 100) SQOL queries in your code, so we can exclude a governor limits problem with it.
Most simple solution would be to look at the relative debug log (if your code runs only with partner users you can set up one of them to generate a debug log for you in setup > debug logs). Look at the end of the log and you should see a list of all governor limits, along with your usage. You should be able to notice that the 100 limit on SOQL queries has been reached.
Look in the log file to spot which other Apex classes/methods are running besides the one you posted, either one of them has a SOQL query in a loop (most likely) or you are recursively calling this - or another SOQL containing - class.
In both cases you have to refactor the offending class/method, there's no avoidance of a Too many SOQL error just by editing shareEndCustomersWithPartnerCommunity.
You're building a collection and then inserting it - are there any triggers on the inserted object that may be firing SOQL calls?