  We show that if $G$ is a second countable locally compact Hausdorff \'etale
groupoid carrying a suitable cocycle $c:G\to\mathbb{Z}$, then the reduced
$C^*$-algebra of $G$ can be realised naturally as the Cuntz-Pimsner algebra of
a correspondence over the reduced $C^*$-algebra of the kernel $G_0$ of $c$. If
the full and reduced $C^*$-algebras of $G_0$ coincide, we deduce that the full
and reduced $C^*$-algebras of $G$ coincide. We obtain a six-term exact sequence
describing the $K$-theory of $C^*_r(G)$ in terms of that of $C^*_r(G_0)$.
