diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..3ab24100 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,69 @@ + +version: 2 +jobs: + build: + + docker: + # The primary container is an instance of the first list image listed. Your build commands run in this container. + - image: circleci/ruby:2.4.1-node-browsers + environment: + RAILS_ENV: test + PULMAP_DB_HOST: localhost + PULMAP_DB_USERNAME: geoblacklight + # PULMAP_DB_PWD: '' + - image: postgres:10 + # environment: + # PG_USER: + # PG_DB: + # PG_PASSWORD: + working_directory: ~/pulmap + steps: + - checkout + # Only necessary if app uses webpacker or yarn in some other way + - restore_cache: + keys: + - pulmap-{{ checksum "package-lock.json" }} + - pulmap- + - run: + name: NPM Install + command: npm install + # Store yarn / webpacker cache + - save_cache: + key: pulmap-{{ checksum "package-lock.json" }} + paths: + - npm_modules + + - persist_to_workspace: + root: '~/pulmap' + paths: '*' + + # docker: + # - image: circleci/oraclejdk8 + + # Download and cache dependencies + - restore_cache: + keys: + - pulmap-{{ checksum "Gemfile.lock" }} + # fallback to using the latest cache if no exact match is found + - pulmap- + + - run: + name: Install dependencies + command: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs 4 --retry 3 + + - run: sudo apt install -y sqlite3 + + - save_cache: + paths: + - ./vendor/bundle + key: pulmap-{{ checksum "Gemfile.lock" }} + + - run: NODE_ENV=test bundle exec rails webpacker:compile + + - run: + name: Database setup + command: bundle exec rake db:migrate + # command: bundle exec rake geoblacklight:server + background: true + #- run: bin/jetty_wait + - run: bundle exec rake ci diff --git a/bin/jetty_wait b/bin/jetty_wait new file mode 100755 index 00000000..b2f26c40 --- /dev/null +++ b/bin/jetty_wait @@ -0,0 +1,6 @@ +#!/usr/bin/env sh + +until $(curl --output /dev/null --silent --head --fail http://localhost:8985/solr); do + printf '.' + sleep 1 +done \ No newline at end of file