A father-of-three who attacked police at two outbreaks of widespread disorder over the summer has been jailed for six years.