Context : High-resolution spectroscopy of pulsating stars is a powerful tool to study the dynamical structure of their atmosphere . Lines asymmetry is used to derive the center-of-mass velocity of the star , while a direct measurement of the atmospheric velocity gradient helps to determine the projection factor used in the Baade-Wesselink methods of distance determination . Aims : We aim at deriving the center-of-mass velocity and the projection factor of the \beta Cephei star \alpha Lup . Methods : We present HARPS ( High Accuracy Radial velocity Planetary Search ) high spectral resolution observations of \alpha Lup . We calculate the first-moment radial velocities and fit the spectral line profiles by a bi-Gaussian to derive line asymmetries . Correlations between the \gamma -velocity and the \gamma -asymmetry ( defined as the average values of the radial velocity and line asymmetry curves respectively ) are used to derive the center-of-mass velocity of the star . By combining our spectroscopic determination of the atmospheric velocity gradient with a hydrodynamical model of the photosphere of the star , we derive a semi-theoretical projection factor for \alpha  Lup . Results : We find a center-of-mass velocity of V _ { \mathrm { \gamma } } = 7.9 \pm 0.6  km s ^ { -1 } and that the velocity gradient in the atmosphere of \alpha  Lup is null . We apply to \alpha Lup the usual decomposition of the projection factor into three parts , p = p _ { \mathrm { 0 } } f _ { \mathrm { grad } } f _ { \mathrm { og } } ( originally developed for Cepheids ) , and derive a projection factor of p = 1.43 \pm 0.01 . By comparing our results with previous HARPS observations of classical Cepheids , we also point out a linear relation between the atmospheric velocity gradient and the amplitude of the radial velocity curve . Moreover , we observe a phase shift ( Van Hoof effect ) , whereas \alpha  Lup has no velocity gradient . New HARPS data of a short-period \beta Cephei star , \tau ^ { 1 }  Lup , are also presented in this paper . Conclusions : By comparing Cepheids and \beta Cephei stars , these results bring insight into the dynamical structure of pulsating star atmospheres , which helps to better understand the k-term problem and the Baade-Wesselink p-factor for Cepheids .