Explain how you would architect a CI/CD pipeline for a legacy monolithic application moving toward microservices.