diff --git a/.circleci/config.yml b/.circleci/config.yml index 9c209a83fcabb02849bde1ea8a35ab0f8150d317..701e3f997d31fef3635c3f5bbd8cf3866c27e94e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,148 +18,143 @@ defaults: &defaults MYSQL_USER: user MYSQL_PASSWORD: passw0rd working_directory: /var/www/html/varbase/docroot + steps: + - checkout: + path: /var/www/html/varbase + ## Setup Apache to point varbase.test at /var/www/html/varbase/docroot + - run: + name: Setup Apache to point varbase.test at /var/www/html/varbase/docroot + command: | + sudo cp /var/www/html/varbase/.circleci/env/varbase.test.conf /etc/apache2/sites-available/varbase.test.conf + sudo a2ensite varbase.test + sudo service apache2 restart + echo 127.0.0.1 varbase.test | sudo tee -a /etc/hosts -jobs: - varbase-setup: - resource_class: small - <<: *defaults - steps: - - checkout: - path: /var/www/html/varbase - ## Setup Apache to point varbase.test at /var/www/html/varbase/docroot - - run: - name: Setup Apache to point varbase.test at /var/www/html/varbase/docroot - command: | - sudo cp /var/www/html/varbase/.circleci/env/varbase.test.conf /etc/apache2/sites-available/varbase.test.conf - sudo a2ensite varbase.test - sudo service apache2 restart - echo 127.0.0.1 varbase.test | sudo tee -a /etc/hosts + ## Install Usefull must have utils for debugging with SSH into this box. + - run: + name: Install Usefull must have utils for debugging with SSH into this box + command: | + sudo apt -qq update && sudo apt -qqy upgrade + sudo apt -yqq install vim links lynx git diffutils htop curl wget p7zip-full unzip zip sed gcc g++ make libfreetype6-dev libjpeg62-turbo-dev libpng-dev xvfb mysql-client + ## Install PHP extra. + - run: + name: Install PHP extra + command: | + sudo apt update + sudo apt install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev + sudo -E docker-php-ext-install zip + sudo -E docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd + sudo -E docker-php-ext-install mbstring bcmath pdo_mysql + sudo -E docker-php-ext-install gd + sudo service apache2 restart - ## Install Usefull must have utils for debugging with SSH into this box. - - run: - name: Install Usefull must have utils for debugging with SSH into this box - command: | - sudo apt -qq update && sudo apt -qqy upgrade - sudo apt -yqq install vim links lynx git diffutils htop curl wget p7zip-full unzip zip sed gcc g++ make libfreetype6-dev libjpeg62-turbo-dev libpng-dev xvfb mysql-client - ## Install PHP extra. - - run: - name: Install PHP extra - command: | - sudo apt update - sudo apt install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev - sudo -E docker-php-ext-install zip - sudo -E docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd - sudo -E docker-php-ext-install mbstring bcmath pdo_mysql - sudo -E docker-php-ext-install gd - sudo service apache2 restart + ## Change PHP Configurations. + - run: + name: PHP Configurations + command: | + echo -e "memory_limit = -1" | sudo tee /usr/local/etc/php/php.ini > /dev/null + sudo rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini + sudo service apache2 restart + - restore_cache: + keys: + - v4-composer-cache - ## Change PHP Configurations. - - run: - name: PHP Configurations - command: | - echo -e "memory_limit = -1" | sudo tee /usr/local/etc/php/php.ini > /dev/null - sudo rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini - sudo service apache2 restart - - restore_cache: - keys: - - v4-composer-cache + ## Waiting for MySQL to be ready. + - run: + name: Waiting for MySQL to be ready + command: | + for i in `seq 1 10`; + do + nc -z 127.0.0.1 3306 && echo Success && exit 0 + echo -n . + sleep 1 + done + echo Failed waiting for MySQL && exit 1 - ## Waiting for MySQL to be ready. - - run: - name: Waiting for MySQL to be ready - command: | - for i in `seq 1 10`; - do - nc -z 127.0.0.1 3306 && echo Success && exit 0 - echo -n . - sleep 1 - done - echo Failed waiting for MySQL && exit 1 + ## Install browser tools + - browser-tools/install-browser-tools - ## Install browser tools - - browser-tools/install-browser-tools + ## List tool version. + - run: + name: List tool version + command: | + php --version + node --version + java --version + google-chrome --version + chromedriver --version + mysql --version - ## List tool version. - - run: - name: List tool version - command: | - php --version - node --version - java --version - google-chrome --version - chromedriver --version - mysql --version + ## Configure and run the virtual display. + - run: + name: Configure and run the virtual display + command: | + export DISPLAY=:99 + xvfb :99 -ac -screen 0 1366x768x24 &>/dev/null & + sleep 3 - ## Configure and run the virtual display. - - run: - name: Configure and run the virtual display - command: | - export DISPLAY=:99 - xvfb :99 -ac -screen 0 1366x768x24 &>/dev/null & - sleep 3 + ## Run selenium standalone server. + - run: + name: Run selenium standalone server + command: | + if [[ ! -f /home/circleci/selenium-server-standalone-2.53.1.jar ]]; then wget -O /home/circleci/selenium-server-standalone-2.53.1.jar http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar; fi + cd /home/circleci/ + java -jar selenium-server-standalone-2.53.1.jar -port 4445 > /home/circleci/selenium.log + background: true - ## Run selenium standalone server. - - run: - name: Run selenium standalone server - command: | - if [[ ! -f /home/circleci/selenium-server-standalone-2.53.1.jar ]]; then wget -O /home/circleci/selenium-server-standalone-2.53.1.jar http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar; fi - cd /home/circleci/ - java -jar selenium-server-standalone-2.53.1.jar -port 4445 > /home/circleci/selenium.log - background: true + ## Update the composer + - run: + name: Update the composer + command: | + sudo composer self-update --2 + composer --version - ## Update the composer - - run: - name: Update the composer - command: | - sudo composer self-update --2 - composer --version + ## Build Varbase with the composer. + - run: + name: Build Varbase with the composer + command: | + cd /var/www/html/varbase + composer install --no-interaction -vvv + git clone --branch 9.0.x https://github.com/vardot/varbase.git /var/www/html/varbase/docroot/profiles/varbase + - save_cache: + key: v4-composer-cache + paths: + - ~/.composer/cache - ## Build Varbase with the composer. - - run: - name: Build Varbase with the composer - command: | - cd /var/www/html/varbase - composer install --no-interaction -vvv - git clone --branch 9.0.x https://github.com/vardot/varbase.git /var/www/html/varbase/docroot/profiles/varbase - - save_cache: - key: v4-composer-cache - paths: - - ~/.composer/cache + ## Update PATH to point at the composer bin in the project. + - run: + name: Update PATH to point at the composer bin in the project + command: | + echo 'export PATH=/var/www/html/varbase/bin:$PATH' >> $BASH_ENV + source $BASH_ENV - ## Update PATH to point at the composer bin in the project. - - run: - name: Update PATH to point at the composer bin in the project - command: | - echo 'export PATH=/var/www/html/varbase/bin:$PATH' >> $BASH_ENV - source $BASH_ENV - - ## Create test Varbase MySQL database and drop old one if exists. - - run: - name: Create test Varbase MySQL database and drop old one if exists - command: | - mysql -h 127.0.0.1 -uuser -ppassw0rd -e "DROP DATABASE IF EXISTS test_varbase;CREATE DATABASE test_varbase;" + ## Create test Varbase MySQL database and drop old one if exists. + - run: + name: Create test Varbase MySQL database and drop old one if exists + command: | + mysql -h 127.0.0.1 -uuser -ppassw0rd -e "DROP DATABASE IF EXISTS test_varbase;CREATE DATABASE test_varbase;" - ## Install Varbase with drush. - - run: - name: Install Varbase with drush - no_output_timeout: 30m - command: | - cd /var/www/html/varbase/docroot/ - drush site-install varbase --yes --site-name='Varbase Test' --account-name=webmaster --account-pass=dD.123123ddd --account-mail=webmaster@vardot.com --db-url="mysql://user:passw0rd@127.0.0.1/test_varbase" varbase_multilingual_configuration.enable_multilingual=true varbase_extra_components.vmi=true varbase_extra_components.varbase_heroslider_media=true varbase_extra_components.varbase_carousels=true varbase_extra_components.varbase_search=true varbase_extra_components.varbase_blog=true varbase_extra_components.varbase_landing=true varbase_extra_components.varbase_auth=true - drush pm-enable varbase_development --yes - drush pm-enable varbase_styleguide --yes - drush pm-enable varbase_landing --yes - drush pm-enable varbase_media_instagram --yes - drush pm-enable varbase_media_twitter --yes - drush pm-enable varbase_api --yes - drush pm-enable social_auth_google --yes - drush pm-enable social_auth_facebook --yes - drush pm-enable social_auth_linkedin --yes - drush pm-enable varbase_content_planner --yes - drush config-set system.performance css.preprocess 0 --yes - drush config-set system.performance js.preprocess 0 --yes - drush config-set system.logging error_level all --yes - drush cr + ## Install Varbase with drush. + - run: + name: Install Varbase with drush + no_output_timeout: 30m + command: | + cd /var/www/html/varbase/docroot/ + drush site-install varbase --yes --site-name='Varbase Test' --account-name=webmaster --account-pass=dD.123123ddd --account-mail=webmaster@vardot.com --db-url="mysql://user:passw0rd@127.0.0.1/test_varbase" varbase_multilingual_configuration.enable_multilingual=true varbase_extra_components.vmi=true varbase_extra_components.varbase_heroslider_media=true varbase_extra_components.varbase_carousels=true varbase_extra_components.varbase_search=true varbase_extra_components.varbase_blog=true varbase_extra_components.varbase_landing=true varbase_extra_components.varbase_auth=true + drush pm-enable varbase_development --yes + drush pm-enable varbase_styleguide --yes + drush pm-enable varbase_landing --yes + drush pm-enable varbase_media_instagram --yes + drush pm-enable varbase_media_twitter --yes + drush pm-enable varbase_api --yes + drush pm-enable social_auth_google --yes + drush pm-enable social_auth_facebook --yes + drush pm-enable social_auth_linkedin --yes + drush pm-enable varbase_content_planner --yes + drush config-set system.performance css.preprocess 0 --yes + drush config-set system.performance js.preprocess 0 --yes + drush config-set system.logging error_level all --yes + drush cr varbase-testing: resource_class: small <<: *defaults