Newer
Older

Rajab Natshah
committed
version: 2.1
orbs:
browser-tools: circleci/browser-tools@1.1

Rajab Natshah
committed
aliases:
- &composer-cache
v4-composer-cache

Rajab Natshah
committed
jobs:
build:
docker:
- image: circleci/php:7.3-apache-stretch-node-browsers
auth:
username: mydockerhub-user
password: $DOCKERHUB_PASSWORD
- image: circleci/mysql:8.0.4
auth:
username: mydockerhub-user
password: $DOCKERHUB_PASSWORD
entrypoint: ['docker-entrypoint.sh', '--default-authentication-plugin=mysql_native_password']
environment:
MYSQL_ROOT_PASSWORD: rootpw
MYSQL_DATABASE: test_varbase900xxc
MYSQL_USER: user
MYSQL_PASSWORD: passw0rd

Rajab Natshah
committed
working_directory: /var/www/html/varbase/docroot

Rajab Natshah
committed
steps:

Rajab Natshah
committed
- checkout:

Rajab Natshah
committed
path: /var/www/html/varbase

Rajab Natshah
committed
## Setup Apache to point varbase.test at /var/www/html/varbase/docroot

Rajab Natshah
committed
- run:
name: Setup Apache to point varbase.test at /var/www/html/varbase/docroot
command: |

Rajab Natshah
committed
sudo cp /var/www/html/varbase/.circleci/env/varbase.test.conf /etc/apache2/sites-available/varbase.test.conf

Rajab Natshah
committed
sudo a2ensite varbase.test
sudo service apache2 restart
echo 127.0.0.1 varbase.test | sudo tee -a /etc/hosts

Rajab Natshah
committed
## 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

Rajab Natshah
committed
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

Rajab Natshah
committed
## Install PHP extra.
- run:
name: Install PHP extra
command: |

Rajab Natshah
committed
sudo apt update
sudo apt install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev

Rajab Natshah
committed
sudo -E docker-php-ext-install zip

Rajab Natshah
committed
sudo -E docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd

Rajab Natshah
committed
sudo -E docker-php-ext-install mbstring bcmath pdo_mysql

Rajab Natshah
committed
sudo -E docker-php-ext-install gd

Rajab Natshah
committed
sudo -E docker-php-ext-install xml common curl imap intl json xmlrpc xsl

Rajab Natshah
committed
sudo service apache2 restart

Rajab Natshah
committed
## Change PHP Configurations.
- run:
name: PHP Configurations
command: |
echo -e "memory_limit = -1" | sudo tee /usr/local/etc/php/php.ini > /dev/null

Rajab Natshah
committed
sudo rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
sudo service apache2 restart

Rajab Natshah
committed
- restore_cache:
keys:
- *composer-cache

Rajab Natshah
committed
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
## 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
## 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: |
sudo apt install mysql-client
mysql -h 127.0.0.1 -uuser -ppassw0rd -e "DROP DATABASE IF EXISTS test_varbase900xxc;CREATE DATABASE test_varbase900xxc;"
- 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
## 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: Download Selenium

Rajab Natshah
committed
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

Rajab Natshah
committed
- run:
name: Start Selenium at the 4445 port

Rajab Natshah
committed
command: |
cd /home/circleci/
java -jar selenium-server-standalone-2.53.1.jar -port 4445 > /dev/null 2>&1 &

Rajab Natshah
committed
background: true
## Update the composer
- run:
name: Update the composer
command: |
sudo composer self-update --2
composer --version
## Build Varbase 9.0.x with the composer.
- run:
name: Build Varbase 9.0.x with the composer
command: |

Rajab Natshah
committed
cd /var/www/html/varbase

Rajab Natshah
committed
composer install --no-interaction -vvv

Rajab Natshah
committed
git clone --branch 9.0.x https://github.com/vardot/varbase.git /var/www/html/varbase/docroot/profiles/varbase

Rajab Natshah
committed
- save_cache:
key: *composer-cache
paths:
- ~/.composer/cache

Rajab Natshah
committed
## 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: |

Rajab Natshah
committed
echo 'export PATH=/var/www/html/varbase/bin:$PATH' >> $BASH_ENV

Rajab Natshah
committed
source $BASH_ENV
## Install Varbase 9.0.x with drush.
- run:
name: Install Varbase with drush
no_output_timeout: 30m
command: |

Rajab Natshah
committed
cd /var/www/html/varbase/docroot/

Rajab Natshah
committed
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_varbase900xxc" 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

Rajab Natshah
committed
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
## Automated Functional Acceptance Testing.
- run:
name: Automated Functional Acceptance Testing
no_output_timeout: 30m
command: |

Rajab Natshah
committed
cd /var/www/html/varbase/docroot/profiles/varbase

Rajab Natshah
committed
behat --strict --no-snippets -f pretty -o std tests/features/varbase/step1-init-tests
behat --strict --no-snippets -f pretty -o std tests/features/varbase/step2-apply-tests