From 1ce9ac58641b0e2c6995fc554ee69cbd25149d30 Mon Sep 17 00:00:00 2001 From: Moctar Date: Thu, 2 Aug 2018 19:00:48 +0200 Subject: [PATCH] updating circleci to version 2 on master --- .circleci/config.yml | 100 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000000..200d087543 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,100 @@ +version: 2 +jobs: + build: + working_directory: ~/alchemy-fr/Phraseanet + parallelism: 2 + shell: /bin/bash --login + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + docker: + - image: circleci/build-image:ubuntu-14.04-XXL-upstart-1189-5614f37 + command: /sbin/init + steps: + - checkout + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS + - run: + working_directory: ~/alchemy-fr/Phraseanet + command: nvm install stable && nvm alias default stable + - run: + working_directory: ~/alchemy-fr/Phraseanet + command: 'sudo service memcached status || sudo service memcached start; sudo + redis-cli ping >/dev/null 2>&1 || sudo service redis-server start; sudo + service mysql status || sudo service mysql start; sudo service rabbitmq-server + status || sudo service rabbitmq-server start; ' + # Dependencies + # This would typically go in either a build or a build-and-test job when using workflows + # Restore the dependency cache + - restore_cache: + keys: + # This branch if available + - v1-dep-{{ .Branch }}- + # Default branch if not + - v1-dep-master- + # Any branch if there are none on the default branch - this should be unnecessary if you have your default branch configured correctly + - v1-dep- + # This is based on your 1.0 configuration file or project settings + - run: git clone https://github.com/alanxz/rabbitmq-c + - run: cd rabbitmq-c && git checkout 2ca1774489328cde71195f5fa95e17cf3a80cb8a + - run: cd rabbitmq-c && git submodule init && git submodule update && autoreconf -i && ./configure && make && sudo make install + - run: pecl channel-update pear.php.net + - run: yes '' | pecl install amqp-1.9.3 + - run: yes '' | pecl install imagick + - run: sudo apt-get install libzmq-dev + - run: yes '' | pecl install zmq-beta + - run: echo "extension = amqp.so" > /opt/circleci/php/$(phpenv global)/etc/conf.d/amqp.ini + - run: echo "extension = zmq.so" > /opt/circleci/php/$(phpenv global)/etc/conf.d/zmq.ini + - run: echo "date.timezone = UTC" > /opt/circleci/php/$(phpenv global)/etc/conf.d/timezone.ini + - run: sed -i 's/^\(session.cache_limiter = \).*/\1""/' /opt/circleci/php/$(phpenv global)/etc/php.ini + - run: npm rebuild node-sass + # This is based on your 1.0 configuration file or project settings + - run: composer install --no-progress --no-interaction --optimize-autoloader + # This is based on your 1.0 configuration file or project settings + - run: node -v + - run: npm -v + - run: npm install + - run: if [[ ! -e elasticsearch-2.3.3 ]]; then wget --no-check-certificate https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-2.3.3.tar.gz && tar -xvf elasticsearch-2.3.3.tar.gz && elasticsearch-2.3.3/bin/plugin install analysis-icu; fi + - run: + command: elasticsearch-2.3.3/bin/elasticsearch + background: true + # Save dependency cache + - save_cache: + key: v1-dep-{{ .Branch }}-{{ epoch }} + paths: + # This is a broad list of cache paths to include many possible development environments + # You can probably delete some of these entries + - vendor/bundle + - ~/virtualenvs + - ~/.m2 + - ~/.ivy2 + - ~/.bundle + - ~/.go_workspace + - ~/.gradle + - ~/.cache/bower + # These cache paths were specified in the 1.0 config + - elasticsearch-2.3.3 + - node_modules + - ~/.composer + # This is based on your 1.0 configuration file or project settings + - run: mysql -u ubuntu -e 'CREATE DATABASE update39_test;CREATE DATABASE ab_test;CREATE DATABASE db_test;SET @@global.sql_mode=STRICT_ALL_TABLES;SET @@global.max_allowed_packet=33554432;SET @@global.wait_timeout=999999;'; + # This is based on your 1.0 configuration file or project settings + - run: ./bin/developer system:uninstall -v + - run: ./bin/setup system:install -v --email=test@phraseanet.com --password=test --db-host=127.0.0.1 --db-user=ubuntu --db-template=fr-simple --db-password= --databox=db_test --appbox=ab_test --server-name=http://127.0.0.1 -y; + - run: ./bin/developer ini:setup-tests-dbs -v + - run: ./bin/console searchengine:index:create -v + - run: ./bin/developer phraseanet:regenerate-sqlite -v + - run: ./bin/developer phraseanet:generate-js-fixtures -v + # Test + # This would typically be a build job when using workflows, possibly combined with build + # This is based on your 1.0 configuration file or project settings + - run: case $CIRCLE_NODE_INDEX in 0) EXIT=0; php -d memory_limit=-1 bin/phpunit --log-junit $CIRCLE_TEST_REPORTS/phpunit/junit-unit.xml --exclude-group legacy || EXIT=$?; php -d memory_limit=-1 bin/phpunit --log-junit $CIRCLE_TEST_REPORTS/phpunit/junit-legacy-no-web.xml --group legacy --exclude-group web || EXIT=$?; exit $EXIT;; 1) php -d memory_limit=-1 bin/phpunit --log-junit $CIRCLE_TEST_REPORTS/phpunit/junit-legacy-web.xml --group web ;; esac + # Teardown + # If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each + # Save test results + - store_test_results: + path: /tmp/circleci-test-results + # Save artifacts + - store_artifacts: + path: /tmp/circleci-artifacts + - store_artifacts: + path: /tmp/circleci-test-results \ No newline at end of file