Pipe with round caps (ends)?
You can do this with an array modifier and a curve modifier (see this post):


Add a slightly extruded circle/cylinder with no caps:


Add an array modifier:


Add a curve modifier:



For the array to deform as expected the object origins must be in the same place.
Add two half spheres as start and end caps:


the length can be animated with the Count value of the array modifier.