From 5edb9b5cfe0c182a3a3e870fd5c014ec478d2eaf Mon Sep 17 00:00:00 2001 From: Martin Kiragu Date: Thu, 2 Mar 2023 08:58:23 +0300 Subject: [PATCH] add node and gulp builds --- .gitlab-ci.yml | 78 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 53 insertions(+), 25 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 459f667c..5b9c4abc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,39 +1,67 @@ image: php:7.4 stages: - - build - - test + - service_build + - front_end_build + - database + - unit_testing + - code_format_test + +# Variables +variables: + MYSQL_ROOT_PASSWORD: root + MYSQL_USER: mysql_user + MYSQL_PASSWORD: mysql_password + MYSQL_DATABASE: mysql_db + DB_HOST: mysql + before_script: -- apt-get update -yqq -- apt-get install -yqq -- apt-get install -y libonig-dev -- apt-get install -y libxml2-dev -- apt-get install -y libzip-dev -- apt-get install -y libgd-dev + - apt-get update -yqq + - apt-get install -yqq + - apt-get install -y libonig-dev + - apt-get install -y libxml2-dev + - apt-get install -y libzip-dev + - apt-get install -y libgd-dev + - apt-get install -y libgd-dev + - apt-get install -y libpdo-dev + - apt-get install -y libpdo_mysql-dev -#install php depandancies -- docker-php-ext-install mbstring xml zip gd + #install php depandancies + - docker-php-ext-install mbstring xml zip gd pdo pdo_mysql + + # Install composer package manager + - curl --location --output /usr/local/bin/composer https://getcomposer.org/download/latest-stable/composer.phar + - chmod +x /usr/local/bin/composer + + # Install MySQL client + - apt-get install -y default-mysql-client + + #install node js + - apt-get update && apt-get install -y nodejs npm + + #install gulp Js + + - npm install -g gulp-cli -# Install composer package manager -- curl --location --output /usr/local/bin/composer https://getcomposer.org/download/latest-stable/composer.phar -- chmod +x /usr/local/bin/composer #jobs -build_job: - stage: build - script: - - composer install - rules: - - if: '$CI_COMMIT_BRANCH =~ /.*/' - -test_job: - stage: test +#buld the backend +composer_php: + stage: service_build script: - composer install - cp .env.example .env - php artisan key:generate - - php artisan migrate - - php artisan db:seed - # - php artisan test rules: - if: '$CI_COMMIT_BRANCH =~ /.*/' + +#build the UI +node_gulp: + stage: front_end_build + script: + - npm install # Install npm dependencies + - gulp build # Build assets + rules: + - if: '$CI_COMMIT_BRANCH =~ /.*/' + +