Hi folks, I'm using gitlab CI for testing my laravel application. The issue is before_scripts takes too many time. I'll be sharing my testing script. I want to ask that is there any all-in-one image for running tests. If not, how can I optimize my job?
Perhaps there's an image that suits your needs on the link below. It has various combinations for PHP and/or NODE versions, with both full and lightweight versions of the images.
@aknevrnky Build your own image using those steps in the before_script section, push it to Docker Hub, and then use that image is your image instead. It will cut your “set-up” times if the pipeline just pulls an already-built image and can just start running your tests in it straight away. I did this years ago when using Bitbucket Pipelines.
@martinbean Hi Martin. I've tried what you told. But custom image had some performance issues or bugs that I couldn't get. Running time was above 10min and I had to force quit the pipe. I probably broke something during image building.
But thanks to @thijs an appropriate image with some custom ENV config worked very well. Thanks to you all.
@aknEvrnky No. I mean you build a custom Docker image on your machine, and then upload it to Docker Hub so that you can use it as a base image in your GitLab pipeline:
test:
image: some-vendor-name/your-image-name:tag
Building an image inside the pipeline each and every time you run it isn’t really going to save any time, is it? That’s essentially what you were already doing.
It is the image that I used in my pipeline. Flow of the process was too slow such as installing composer depends, npm depends, running tests etc. It took more than 10 minutes. I had to cancel this image then.