A frantic Scottish Cup semi-final ended with Rangers beating their Old Firm rivals Celtic after a penalty shoot-out, the match having ended 2-2 after extra-time.