In my project, I build a image, and I want to do a test.
If test is failed, will not deploy.
The backend step will run a server, and expose localhost:15050.
But postman step got error:[Failed to connect to localhost port 15050: Connection refused]
Or can I run a service after build step?
After I read documents, solved the problem.
I made some test.
If I add services, the postman step needs to add sleep command for backend container up.
If I use [detach: true] and move backend into pipeline, the postman step needs to add sleep command for backend container up.
Here is final code:
backend:
image: asia.gcr.io/…
detach: true
postman:
image: node:slim
commands:
- sleep 15 # gives docker enough time to initialize
- curl backend:15050