Skip to content
Snippets Groups Projects
Commit bb2adbbc authored by Rajab Natshah's avatar Rajab Natshah
Browse files

Issue #3194401: Switch to CircleCI as the default automated testing platform

parent 827ce21d
No related branches found
No related tags found
No related merge requests found
...@@ -18,148 +18,143 @@ defaults: &defaults ...@@ -18,148 +18,143 @@ defaults: &defaults
MYSQL_USER: user MYSQL_USER: user
MYSQL_PASSWORD: passw0rd MYSQL_PASSWORD: passw0rd
working_directory: /var/www/html/varbase/docroot 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: ## Install Usefull must have utils for debugging with SSH into this box.
varbase-setup: - run:
resource_class: small name: Install Usefull must have utils for debugging with SSH into this box
<<: *defaults command: |
steps: sudo apt -qq update && sudo apt -qqy upgrade
- checkout: 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
path: /var/www/html/varbase ## Install PHP extra.
## Setup Apache to point varbase.test at /var/www/html/varbase/docroot - run:
- run: name: Install PHP extra
name: Setup Apache to point varbase.test at /var/www/html/varbase/docroot command: |
command: | sudo apt update
sudo cp /var/www/html/varbase/.circleci/env/varbase.test.conf /etc/apache2/sites-available/varbase.test.conf sudo apt install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev
sudo a2ensite varbase.test sudo -E docker-php-ext-install zip
sudo service apache2 restart sudo -E docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd
echo 127.0.0.1 varbase.test | sudo tee -a /etc/hosts 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. ## Change PHP Configurations.
- run: - run:
name: Install Usefull must have utils for debugging with SSH into this box name: PHP Configurations
command: | command: |
sudo apt -qq update && sudo apt -qqy upgrade echo -e "memory_limit = -1" | sudo tee /usr/local/etc/php/php.ini > /dev/null
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 sudo rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
## Install PHP extra. sudo service apache2 restart
- run: - restore_cache:
name: Install PHP extra keys:
command: | - v4-composer-cache
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. ## Waiting for MySQL to be ready.
- run: - run:
name: PHP Configurations name: Waiting for MySQL to be ready
command: | command: |
echo -e "memory_limit = -1" | sudo tee /usr/local/etc/php/php.ini > /dev/null for i in `seq 1 10`;
sudo rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini do
sudo service apache2 restart nc -z 127.0.0.1 3306 && echo Success && exit 0
- restore_cache: echo -n .
keys: sleep 1
- v4-composer-cache done
echo Failed waiting for MySQL && exit 1
## Waiting for MySQL to be ready. ## Install browser tools
- run: - browser-tools/install-browser-tools
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 ## List tool version.
- browser-tools/install-browser-tools - run:
name: List tool version
command: |
php --version
node --version
java --version
google-chrome --version
chromedriver --version
mysql --version
## List tool version. ## Configure and run the virtual display.
- run: - run:
name: List tool version name: Configure and run the virtual display
command: | command: |
php --version export DISPLAY=:99
node --version xvfb :99 -ac -screen 0 1366x768x24 &>/dev/null &
java --version sleep 3
google-chrome --version
chromedriver --version
mysql --version
## Configure and run the virtual display. ## Run selenium standalone server.
- run: - run:
name: Configure and run the virtual display name: Run selenium standalone server
command: | command: |
export DISPLAY=:99 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
xvfb :99 -ac -screen 0 1366x768x24 &>/dev/null & cd /home/circleci/
sleep 3 java -jar selenium-server-standalone-2.53.1.jar -port 4445 > /home/circleci/selenium.log
background: true
## Run selenium standalone server. ## Update the composer
- run: - run:
name: Run selenium standalone server name: Update the composer
command: | 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 sudo composer self-update --2
cd /home/circleci/ composer --version
java -jar selenium-server-standalone-2.53.1.jar -port 4445 > /home/circleci/selenium.log
background: true
## Update the composer ## Build Varbase with the composer.
- run: - run:
name: Update the composer name: Build Varbase with the composer
command: | command: |
sudo composer self-update --2 cd /var/www/html/varbase
composer --version 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. ## Update PATH to point at the composer bin in the project.
- run: - run:
name: Build Varbase with the composer name: Update PATH to point at the composer bin in the project
command: | command: |
cd /var/www/html/varbase echo 'export PATH=/var/www/html/varbase/bin:$PATH' >> $BASH_ENV
composer install --no-interaction -vvv source $BASH_ENV
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. ## Create test Varbase MySQL database and drop old one if exists.
- run: - run:
name: Update PATH to point at the composer bin in the project name: Create test Varbase MySQL database and drop old one if exists
command: | command: |
echo 'export PATH=/var/www/html/varbase/bin:$PATH' >> $BASH_ENV mysql -h 127.0.0.1 -uuser -ppassw0rd -e "DROP DATABASE IF EXISTS test_varbase;CREATE DATABASE test_varbase;"
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;"
## Install Varbase with drush. ## Install Varbase with drush.
- run: - run:
name: Install Varbase with drush name: Install Varbase with drush
no_output_timeout: 30m no_output_timeout: 30m
command: | command: |
cd /var/www/html/varbase/docroot/ 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 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_development --yes
drush pm-enable varbase_styleguide --yes drush pm-enable varbase_styleguide --yes
drush pm-enable varbase_landing --yes drush pm-enable varbase_landing --yes
drush pm-enable varbase_media_instagram --yes drush pm-enable varbase_media_instagram --yes
drush pm-enable varbase_media_twitter --yes drush pm-enable varbase_media_twitter --yes
drush pm-enable varbase_api --yes drush pm-enable varbase_api --yes
drush pm-enable social_auth_google --yes drush pm-enable social_auth_google --yes
drush pm-enable social_auth_facebook --yes drush pm-enable social_auth_facebook --yes
drush pm-enable social_auth_linkedin --yes drush pm-enable social_auth_linkedin --yes
drush pm-enable varbase_content_planner --yes drush pm-enable varbase_content_planner --yes
drush config-set system.performance css.preprocess 0 --yes drush config-set system.performance css.preprocess 0 --yes
drush config-set system.performance js.preprocess 0 --yes drush config-set system.performance js.preprocess 0 --yes
drush config-set system.logging error_level all --yes drush config-set system.logging error_level all --yes
drush cr drush cr
varbase-testing: varbase-testing:
resource_class: small resource_class: small
<<: *defaults <<: *defaults
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment