A man who drove to a riot in a pick-up truck filled with debris which was used to attack police has been jailed for two years and three months.