# Check https://circleci.com/docs/2.0/language-clojure/ for more details
version: 2.1
jobs:
  build:
    docker:
      - image: cimg/clojure:1.11.1
        auth:
          username: mydockerhub-user
          password: $DOCKERHUB_PASSWORD
        environment:
          TEST_DATABASE_URL: postgresql://postgres@localhost/ktra_test
      - image: cimg/postgres:14.5
        auth:
          username: mydockerhub-user
          password: $DOCKERHUB_PASSWORD
        environment:
          POSTGRES_USER: postgres
          POSTGRES_DB: ktra_test
          POSTGRES_PASSWORD: testpwd

    working_directory: ~/repo

    resource_class: small
    environment:
      JVM_OPTS: -Xmx3200m
      POSTGRESQL_DB_USERNAME: postgres
      POSTGRESQL_DB_PASSWORD: testpwd

    steps:
      - checkout

      - run:
          name: database setup
          command: |
            sleep 5
            sudo apt install -y postgresql-client || true
            psql -d ${TEST_DATABASE_URL} < db-def.sql

      - run:
          name: setup config
          command: |
            cp resources/config.edn_sample resources/dev/config.edn

      - run: clojure -T:build ci

      - run: clojure -M:eastwood

      - run: clojure -M:kibit

# Check https://circleci.com/docs/2.0/language-clojure/ for more details
version: 2.1
jobs:
  build:
    docker:
      - image: cimg/clojure:1.11.1
        auth:
          username: mydockerhub-user
          password: $DOCKERHUB_PASSWORD
        environment:
          TEST_DATABASE_URL: postgresql://postgres@localhost/ktra_test
      - image: cimg/postgres:15.0
        auth:
          username: mydockerhub-user
          password: $DOCKERHUB_PASSWORD
        environment:
          POSTGRES_USER: postgres
          POSTGRES_DB: ktra_test
          POSTGRES_PASSWORD: testpwd

    working_directory: ~/repo

    resource_class: small
    environment:
      JVM_OPTS: -Xmx3200m
      POSTGRESQL_DB_USERNAME: postgres
      POSTGRESQL_DB_PASSWORD: testpwd

    steps:
      - checkout

      - run:
          name: database setup
          command: |
            sleep 5
            sudo apt install -y postgresql-client || true
            psql -d ${TEST_DATABASE_URL} < db-def.sql

      - run:
          name: setup config
          command: |
            cp resources/config.edn_sample resources/dev/config.edn

      - run: clojure -T:build ci

      - run: clojure -M:eastwood

      - run: clojure -M:kibit

Update PostgreSQL image version in CI
Update PostgreSQL image version in CI
