This is just to provide a bit of background to Dmitri's elegant answer.
You can do this by induction by recognising that $\mathbb{C}P^n$ is the $n^{th}$ projective plane of the $H$-space $S^1$, and in particular may be constructed using the Hopf construction. This iteratively produces quasi-fibrations $\gamma_n:\ast^nS^1\rightarrow \mathbb{C}P^{n-1}$, starting with $n=1$, where $\ast^nS^1$ is the $n$-fold join of $S^1$, and defines $\mathbb{C}P^n$ as the cofiber
$$\ast^nS^1\xrightarrow{\gamma_n} \mathbb{C}P^{n-1}\rightarrow\mathbb{C}P^n.$$
Note that the degree $d$ self map $d:S^1\rightarrow S^1$ is homotopic to the $d$-fold power map (defined with the $H$-productLie product), and since $S^1$ is abelian this map is an $H$$A_{\infty}$-map. It follows that there is an induced map $\underline d_n:\mathbb{C}P^n\rightarrow \mathbb{C}P^n$ between the Hopf constructions at each stage.
In particular, at the $(n+1)^{th}$ stage we have $\ast^{(n+1)}S^1\cong \Sigma^n\bigwedge^{n+1}S^1\cong S^{2n+1}$ and $\ast^{n+1}d\cong \Sigma^n\bigwedge^{n+1}d\simeq d^{n+1}$ sitting in a diagram of cofibrations $\require{AMScd}$ \begin{CD} S^{2n+1}@>\gamma_{n+1}>> \mathbb{C}P^n@>>>\mathbb{C}P^{n+1}\\ @Vd^{n+1} V V @VV \underline d_n V@VV \underline d_{n+1} V\\ S^{2n+1} @>\gamma_{n+1}>> \mathbb{C}P^n@>>>\mathbb{C}P^{n+1}. \end{CD} Technically, it now remains to confirm that $\underline d_n$ is indeed the map you describe, but its Friday and the pub's open, so I'm going to stop typing here.