The RAI on this one is a little uncertain, from what I can tell.
In this October 2015 tweet, rules designer Jeremy Crawford responded to a question about using the Green-Flame Blade cantrip for an opportunity attack:
Without a feature like the War Caster feat, a spell can never be cast in place of an opportunity attack.
He doesn't make it incredibly clear, but the implication here seems to be that with the feat, this would be possible.
However, this is contradicted by a later tweet in November 2015, in which he stated:
Twinned Spell doesn't work with a spell that targets more than 1 creature. Green-flame blade targets 2.
This explicitly states that the spell targets multiple creatures (and therefore wouldn't qualify for the War Caster benefit), but again in a different context.
My instinct here is to agree with explicit disqualification, rather than implied exception, so I would say the RAI is that you can't use Green-Flame Blade with an opportunity attack.
No, it's not an opportunity attack
The relevant phrasing in the Sentinel feat (PHB, p. 169-170) is:
When you hit a creature with an opportunity attack, the creature's speed becomes 0 for the rest of the turn.
So the prerequisite for this feature is that you must hit a creature with an opportunity attack.
The relevant phrasing in the War Caster feat (PHB, p. 170) is:
When a hostile creature's movement provokes an opportunity attack from you, you can use your reaction to cast a spell at the creature, rather than making an opportunity attack. The spell must have a casting time of 1 action and must target only that creature.
While the trigger is a situation that provides an opportunity attack, it specifically states that no opportunity attack is made, and you instead us a reaction for the spell casting. Thus, the Sentinel feat is not triggered.
Best Answer
No, you can't. To be cast as an opportunity attack with War Caster:
However, Lightning Bolt is an area of effect spell. The Spellcasting chapter, under Targets, says:
So the target of Lightning Bolt is its point of origin. Ok, so what's Lightning Bolt's point of origin? Well, its Range is given as Self (100-foot line). The Range section has this to say:
That being the case, the point of origin (and therefore the target) of Lightning Bolt is you. As such, you cannot use it with War Caster.