0% found this document useful (0 votes)
16 views2 pages

CIcircle CINotes

Uploaded by

akilesbailoyo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views2 pages

CIcircle CINotes

Uploaded by

akilesbailoyo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Continuous integrations

https://www.youtube.com/watch?v=ymPOI4gWQFY

CI is mostly for huge teams, where multiple monster merges per day are done, CI is
an automated way to do tests and other tasks

circleCI
https://akrabat.com/using-circleci-for-a-php-project/
https://www.youtube.com/watch?v=7VxBn_ZgOek

we can use circleCI to run the tests remotely

https://github.com/xperius123/circleci-demo-php-laravel.git
github account to test with: xperius123 / a7xAgdwg

- create a web app


- push it to github
- add project (from sidebar option) in circleCI dashboard
- setup project, start building
- lean back, watch circleCI build and merges our project on each merge
- go to pipelines to check work done

there has to be a config file, .circleci/config.yml containing the following:

-----------------------------------------------------------------------------------
-------
version: 2
jobs:
build:
working_directory: /var/www/html
docker:
- image: php:7.1-apache
#- image: circleci/php:7.3-stretch-node-browsers
environment:
APP_ENV: test
# build steps
steps:
# cloning the github repo
- checkout
- run:
name: Install system packages
command: apt-get update && apt-get -y install git
- run:
name: Install PHP extensions
command: docker-php-ext-install pdo
- checkout
- run:
name: Install Composer
command: |
php -r "copy('https://getcomposer.org/installer', 'composer-
setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') ===
trim(file_get_contents('https://composer.github.io/installer.sig'))) { echo
'Installer verified'; } else { echo 'Installer invalid'; unlink('composer-
setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
- run:
name: Display PHP information
command: |
php -v
php composer.phar --version
- run:
name: Install project dependencies
command: php composer.phar install
- run:
name: Run CS tests
command: vendor/bin/phpcs
- run:
name: Run Unit tests
command: vendor/bin/phpunit

-----------------------------------------------------------------------------------
-------

Running the build

To actually get builds to run, you log into CircleCI – usefully you authenticate
via GitHub – and select the project to build. From now on, pushing to GitHub or a
branch will result in the build running

You might also like