JujaLabs / sqlcmd

0 stars 5 forks source link

Подключить Travis CI к репозиторию #99

Closed ivshapovalov closed 6 years ago

ivshapovalov commented 6 years ago

Задача выполняется после задачи #95

1) Добавить в пакет test папку resources/config. Папку resources назначить в IDEA папкой тестовых ресурсов. 2) Создать в этой папке файл pg_hba.conf с содержимым:

local   all             postgres                                     trust
host    all             postgres             ::1/128                 trust
host    all             postgres             127.0.0.1/32           trust

host    all             all             ::1/128                 md5
host    all             all             127.0.0.1/32           md5

3) В корне проекта создать файл .travis.yml с содержимым:

language: java

jdk:
- oraclejdk8

addons:
  postgresql: "9.6"

services:
  - postgresql

before_script:
    - sudo mv -f $TRAVIS_BUILD_DIR/target/test-classes/config/pg_hba.conf /etc/postgresql/9.6/main/
    - sudo service postgresql restart
    - psql -U postgres -c "CREATE USER sqlcmd PASSWORD 'sqlcmd';"
   - psql -U postgres -c "CREATE DATABASE sqlcmd OWNER sqlcmd ENCODING = 'UTF8' CONNECTION LIMIT = -1;" 

4) Подключить к своему репозиторию на гитхабе Travis CI, разобраться с содержимым файла выше.