I'm trying to set GitLab CI process and found it very slooooow to start. Task can hang up in pending state for minutes. But main problem is very slow building. We have a custom PHP docker image (with some modules built-in) and app. Deployment to CI can take up to 5-10 minutes.
How is it possible:
- minimize pending time? Buy enterprise account?
- speed up image building and installation?
- cache docker image?
- join base image from the file and ours php7?
Though there're some unnecessary checks for version and time, they're not a problem - they are fast but they give iformation about precise version and run time.
.gitlab-ci.yml:
image: "registry.gitlab.com/project/debianphp7:latest"
services:
- mariadb:10.1
variables:
# CI_DEBUG_TRACE: "true" # hard Gitlab CI debug
MYSQL_HOST: mariadb
MYSQL_DATABASE: dbname
MYSQL_ROOT_PASSWORD: "password"
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
MYSQL_CMD: "mysql --user=root --password=$MYSQL_ROOT_PASSWORD --host=$MYSQL_HOST $MYSQL_DATABASE "
before_script:
- apt-get update && apt-get install mysql-client -y
- echo "Load database fixtures"
- mysql -V
- echo $MYSQL_CMD
- echo "SELECT 'OK', NOW(), VERSION();" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mariadb
- echo "SELECT 'OK', NOW(), VERSION();" | $MYSQL_CMD
- (find ./sql/*.sql -type f | while read f; do
echo "Loading " $f;
cat $f | $MYSQL_CMD;
done);
test:
script:
php -d short_open_tag=On src/execute_request_by_cron.php -- request=TestUnitTestRequest
Thx.