ci_docker_install.sh 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/bash
  2. # Setup a php:8.2-fpm docker image
  3. # We need to install dependencies only for Docker
  4. [[ ! -e /.dockerenv ]] && exit 0
  5. # Quit on error
  6. set -xe
  7. # Install packages
  8. apt-get update
  9. apt-get install -yqq --fix-missing apt-utils gnupg git build-essential openssh-client zip
  10. apt-get update
  11. apt-get install -yqq --fix-missing --no-install-recommends unzip zlib1g-dev libicu-dev g++ \
  12. libzip-dev libpng-dev libtidy-dev libssl-dev \
  13. libxslt-dev libxrender-dev libxrender1 libxt6 libxtst6 openssh-server \
  14. xorg iputils-ping wget gdebi ca-certificates wget \
  15. fontconfig acl procps libmagickwand-dev imagemagick
  16. apt-get clean
  17. rm -r /var/lib/apt/lists/*
  18. # Configure docker
  19. #docker-php-ext-configure intl
  20. #docker-php-ext-install intl opcache pdo_mysql exif bcmath calendar gd tidy
  21. #docker-php-ext-enable libxslt-dev
  22. #docker-php-ext-enable intl
  23. #docker-php-ext-enable exif
  24. #docker-php-ext-enable tidy
  25. #docker-php-ext-install zip
  26. #docker-php-ext-install xsl
  27. #pecl install apcu-5.1.21
  28. pecl install imagick
  29. docker-php-ext-enable imagick
  30. # Install XDebug (required for coverage)
  31. pecl install xdebug
  32. docker-php-ext-enable xdebug
  33. # Run ssh-agent and add private key (/!\ Attention: la configuration du SSH est indispensable pour pouvoir cloner notre repo foselastica)
  34. eval $(ssh-agent -s)
  35. mkdir -p ~/.ssh
  36. chmod 700 ~/.ssh
  37. echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
  38. ssh-add <(echo "$SSH_PRIVATE_KEY")
  39. git config --global user.email "exploitation@opentalent.fr"
  40. git config --global user.name "git"
  41. # Install composer
  42. curl -sS https://composer.github.io/installer.sig > installer.sig
  43. php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
  44. php -r "if (hash_file('SHA384', 'composer-setup.php') === file_get_contents('installer.sig')) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
  45. php composer-setup.php
  46. php -r "unlink('composer-setup.php'); unlink('installer.sig');"
  47. # Config php
  48. echo "memory_limit=2096M" > /usr/local/etc/php/conf.d/memory-limit.ini
  49. # Install modules
  50. HOST=ci php composer.phar install --no-interaction --ignore-platform-reqs