Crude oil posted the largest weekly gains since October, as the buildup of US forces near Iran raised concerns that military strikes could occur, potentially disrupting global crude supply.