Hello Everyone,
I have been trying t fix the issues with cci 2.0 since last 7 - 10 days, but no luck. I have tried multiple ways. But failing with php commands under steps. It would be really great if somebody can help with writing 2.0 config.yml file. Appreciate your help.
circleci 1.0
version: 1
machine:
php:
version: 7.1.9
environment:
APP_ENV: testing
APP_KEY: asdsdasdfdfasdfadf
DB_HOST: 127.0.0.1
DB_DATABASE: db_name
DB_USERNAME: username
image: selenium/standalone-chrome:3.1.0
general:
artifacts:
- “reports”
dependencies:
pre:
- printf “\n” | pecl install -f imagick
- echo “extension = imagick.so” >> /opt/circleci/php/$(phpenv global)/etc/php.ini
override:
# Checks all php files within /app for syntax errors
- tests/scripts/phplint.sh
- composer install --prefer-dist --no-interaction --no-dev
- ‘php artisan migrate --no-interaction --seed’
# Run the CS fixer and error if it finds files to update
- tests/scripts/phpcs.sh
cache_directories:
- “~/.composer/cache”
- “reports/phplint/.cache”
- “vendor”
test:
override:
- vendor/bin/phpunit -d memory_limit=1024M --coverage-clover build/logs/clover.xml
- vendor/bin/behat
deployment:
production:
branch: production
commands:
- rsync -rl . ‘–usermap=*:www-data’ --exclude=’.env’ --exclude=‘build’ "xyz@123.primarydomain.com:/var/www/ici.primarydomain.com/"
staging:
branch: master
commands:
- rsync -rl . ‘–usermap=*:www-data’ --exclude=’.env’ --exclude=‘build’ ‘123@boethius.primarydomain.com:/var/www/mykw/’
circleci 2.0
version: 2
jobs:
build:
docker:
- image: php:7.1.9
environment:
APP_ENV: testing
APP_KEY: base64:ADFASDFADADFD
DB_HOST: 127.0.0.1
DB_DATABASE: db_name
DB_USERNAME: username
- image: selenium/standalone-chrome:3.1.0
working_directory: /var/www/mykw
steps:
- checkout
# Checks all php files within /app for syntax errors
- run: tests/scripts/phplint.sh
- run: php -derror_reporting=-1 -ddisplay_errors=1 -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- run: php -r "if (hash_file('sha384', 'composer-setup.php') === '48e3236262b34d30969dca3c37281b3b4bbe3221bda826ac6a9a62d6444cdb0dcd0615698a5cbe587c3f0fe57a54d8f5') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
- run: php composer-setup.php
- run: php -r "unlink('composer-setup.php');"
- run: php composer.phar self-update
# - run: sudo mv composer.phar /usr/local/bin/composer
# - run: composer install -n --prefer-dist --no-interaction --no-dev
# - run: php artisan migrate --no-interaction --seed
# Run the CS fixer and error if it finds files to update
- run: tests/scripts/phpcs.sh
- run: rsync -rl . '--usermap=\*:www-data' --exclude='.env' --exclude='build' 'deploy@boethius.threesolve.com:/var/www/mykw/'
general:
artifacts:
- “reports”
dependencies:
pre:
- printf “\n” | pecl install -f imagick
- echo “extension = imagick.so” >> /opt/circleci/php/$(phpenv global)/etc/php.ini
override:
# Checks all php files within /app for syntax errors
- tests/scripts/phplint.sh
- composer install --prefer-dist --no-interaction --no-dev
- ‘php artisan migrate --no-interaction --seed’
# Run the CS fixer and error if it finds files to update
- tests/scripts/phpcs.sh
cache_directories:
- “~/.composer/cache”
- “reports/phplint/.cache”
- “vendor”
test:
override:
- vendor/bin/phpunit -d memory_limit=1024M --coverage-clover build/logs/clover.xml
- vendor/bin/behat
deployment:
production:
branch: production
commands:
- rsync -rl . ‘–usermap=*:www-data’ --exclude=’.env’ --exclude=‘build’ "xyz@123.primarydomain.com:/var/www/ici.primarydomain.com/"
staging:
branch: master
commands:
- rsync -rl . ‘–usermap=*:www-data’ --exclude=’.env’ --exclude=‘build’ ‘123@boethius.primarydomain.com:/var/www/mykw/’