The Chief of Police becomes the head of the army. He crosses a sea to do "battle", but when he gets there they all call the war off. Which book is that?
You are probably thinking of Sir Samuel Vimes, Commander of the Ankh-Morpork City Watch. in Jingo, the 21st Discworld book.
With the opening of the novel, the island of Leshp, which had been submerged under the Circle Sea for centuries, rises to the surface. Its position, exactly halfway between Ankh-Morpork and Al Khali (the capital of Klatch), makes the island a powerful strategical point for whoever lays claim to it, which both cities do.
In Ankh-Morpork, a Klatchian Prince named Khufurah is parading through Ankh-Morpork, where he will be presented with a Degree in Sweet Fanny Adams (Doctorum Adamus cum Flabello Dulci), but an assassination attempt occurs, and the Prince is wounded. Sir Samuel Vimes, Commander of the Ankh-Morpork City Watch, begins investigating the crime, originally suspecting both a Klatchian named 71-Hour Ahmed and a senior Morporkian peer, Lord Rust, of being involved.
The attempted assassination breaks off relations between Ankh-Morpork and Klatch as Prince Khufurah's brother, Prince Cadram, effectively declares war on the city of Ankh-Morpork. At this point, Havelock Vetinari, Patrician of Ankh-Morpork, resigns—apparently of his own free will—and Lord Rust takes command of the city. Vetinari has refused to become involved in the war with Klatch, due to the fact Ankh-Morpork does not have an army to stand against any opposing forces (the reason given being that killing enemy soldiers makes it difficult to sell them things afterwards), but Rust declares Martial law and orders the city's noble families to revive their old private regiments.
Vimes, refusing to follow Rust (whom he considers to be a pillock) stands down as Commander of the Watch. Captain Carrot resigns as well, as do Sergeant Colon, Sergeant Detritus and Corporal Angua. The idea of putting the watch under the command of Corporal Nobbs is rejected by the ruling Council of Guild leaders and the Watch is disbanded. Vimes then recruits the Watch into his own private army regiment, reasoning that, as an official noble, he is entitled to do so by law and by Lord Rust's command, with the group remaining independent as knights legally fall under command of the king or his duly appointed representatives, neither of which exist in Ankh-Morpork.
Arriving at Gebra they discover that Carrot has convinced the two armies to get together and play a game of football (he has an inflatable football in his backpack for just such an emergency), Vimes is preparing to arrest both Klatchian Prince Cadram and Lord Rust for various breaches of the peace (such as being prepared for war) and 71-hour Ahmed is supporting him. Vetinari prevents an international incident by ostensibly declaring the surrender of Ankh-Morpork and offering war reparations. To be ratified on Leshp in one week.