How to do do build once deploy anywhere with jenkins pipeline and jfrog promotion

I would like to have a pipeline of build once and depploy anywhere with jenkisnfile pipelines.
we have dev,qa,uat,stage,prod environments. The pipeline should be able to buidl once and deploy to artifactory and then from qa it should do the promotion and deploy to teh respective environment.

How is this possible with jenkins and artifactory?