The US commitment to the military alliance has long been in doubt given Donald Trump’s sharp criticism of European allies and his apparent eagerness to foster ties with Vladimir Putin.