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?
- echo “ready”
- curl localhost:15050
You should take a look at services. http://docs.drone.io/services/
I think your backend step should be a service then you can access it in the postman step like this http://backend:15050
Hi rayitopy, thank for your reply.
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:
- sleep 15 # gives docker enough time to initialize
- curl backend:15050