diff --git a/.travis.yml b/.travis.yml index 23b6de644..fee22f2b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,8 +17,13 @@ before_install: script: # docker needs jar file to start - mvn clean test package + - docker-compose build - docker-compose up -d - - sleep 20 # wait that containers are ready + - sleep 120 # wait that containers are ready + - docker-compose logs workers + - docker-compose logs rabbitmq + - docker-compose ps + - docker-compose top - mvn integration-test -P integration-test after_script: diff --git a/datavault-worker/src/test/resources/config.properties b/datavault-worker/src/test/resources/config.properties new file mode 100644 index 000000000..ee7711960 --- /dev/null +++ b/datavault-worker/src/test/resources/config.properties @@ -0,0 +1,123 @@ +# This is the DataVault configuration file. Settings are used to customise different options. +# +# This file is used to set properties in the various Spring files located in each application. + +# Broker settings +# =============== +# The URL of the broker API for use by the default web application +broker.url = http://localhost:58080/datavault-broker +# API key for the default web client +broker.api.key = datavault-webapp +# Debug setting to disable API authentication +broker.validateclient = true + +# Database settings +# ================= +# The location of the MySQL database +db.url = localhost:53306/datavault?useUnicode=true +#The MySQL username +db.username = datavault +# The MySQL password +db.password = datavault + +# Message queue settings +# ====================== +# The location of the RabbitMQ server +queue.server = localhost +# The RabbitMQ username +queue.user = datavault +# The RabbitMQ password +queue.password = datavault +# The name of the primary RabbitMQ queue for communication between the broker and workers +queue.name = datavault +# The name of the RabbitMQ queue to use for notifying the broker of events +queue.events = datavault-event + +# Worker settings +# =============== +# The number of concurrent workers to start +worker.number = 1 + +# Top level storage location settings +# =================================== +# A default directory for sample user data (if per-user storage is not configured) +activeDir = /Users +# Directory for archive data (if using 'local storage') +archiveDir = /tmp/datavault/archive +# A temporary directory for workers to process files before storing in the archive +tempDir = /tmp/datavault/temp +# A directory for storing archive metadata +metaDir = /tmp/datavault/meta + +# Email server settings +# ===================== +# The email account of the system administrator +mail.administrator = feedback@datavaultplatform.org +# SMTP host for sending mail +mail.host = smtp.gmail.com +# SMTP port for sending mail +mail.port = 587 +# SMTP account name for sending mail +mail.username = XXX@gmail.com +# SMTP password for sending mail +mail.password = XXX + +# Welcome settings +# ================ +# Welcome message (HTML) displayed by the (non-shibboleth) login page. +webapp.welcome = + +# CRIS system settings +# ==================== +# The URL of the external metadata service (for example, a Pure CRIS API). Leave this blank to use a mock provider +# eg. https://example.org/ws/rest/datasets +# If using HTTP BASIC authentication, use: https://username:password@example.org/ws/rest/datasets +metadata.url = +# Name displayed in the help page for the institutional CRIS or external metadata system +metadata.system = CRIS +# URL displayed in the help page for the institutional CRIS or external metadata system +metadata.link = http://cris.example.com/ + +# Retention policy checker settings +# ================================= +# How frequently the retention policy check job is run (in 'cron' format) +# Example: Check the retention policies each weekday at 9am +retentioncheck.schedule = 0 0 9 * * MON-FRI + +# SFTP server settings +# ==================== +# Default SFTP host +sftp.host = localhost +# Default SFTP port +sftp.port = 22 +# Default SFTP path +sftp.rootPath = / +# Default SFTP key passphrase +sftp.passphrase = datavault + +# Shibboleth authentication settings +# ================================== +# Shibboleth header containing the username +shibboleth.principal= uid +# Shibboleth header containing the user's first name +shibboleth.firstname = givenName +# Shibboleth header containing the user's last name +shibboleth.lastname = sn +# Shibboleth header containing the user's email +shibboleth.email = mail + +# LDAP settings +# ============= +# Set this to false if you don't need to retrieve attributes from LDAP +ldap.enabled = true +ldap.host = hostname +ldap.port = 636 +ldap.useSsl = true +# In this example the uun is an account with privileged access to LDAP +ldap.dn = uid=uun,ou=people,o=myu.ed +ldap.password = secret +ldap.searchContext = ou=people,o=myu.ed +ldap.searchFilter = uid +# A list of the attributes you want to retrieve from LDAP +ldap.attrs = attr1,attr2,etc + diff --git a/datavault-worker/src/test/resources/config/datavault-worker.xml b/datavault-worker/src/test/resources/config/datavault-worker.xml new file mode 100644 index 000000000..c9da27391 --- /dev/null +++ b/datavault-worker/src/test/resources/config/datavault-worker.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/datavault-worker/src/test/resources/config/log4j.properties b/datavault-worker/src/test/resources/config/log4j.properties new file mode 100644 index 000000000..91a25d483 --- /dev/null +++ b/datavault-worker/src/test/resources/config/log4j.properties @@ -0,0 +1,15 @@ +log4j.rootCategory=INFO, stdout, file + +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %t %c{2}:%L - %m%n + +log4j.appender.file=org.datavaultplatform.worker.logger.WorkerDailyRollingFileAppender +log4j.appender.file.append=true +log4j.appender.file.file=${datavault-home}/logs/worker +log4j.appender.file.threshold=INFO +log4j.appender.file.layout=org.apache.log4j.PatternLayout +log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %t %c{2}:%L - %m%n + +log4j.category.org.springframework=INFO +log4j.category.org.datavaultplatform=INFO diff --git a/datavault-worker/src/test/resources/docker-compose.yml b/datavault-worker/src/test/resources/docker-compose.yml deleted file mode 100644 index 8f02add20..000000000 --- a/datavault-worker/src/test/resources/docker-compose.yml +++ /dev/null @@ -1,55 +0,0 @@ -version: '2' -services: - rabbitmq: - image: bitnami/rabbitmq:latest - volumes: - - ./docker/rabbitmq_data:/bitnami - ports: - - "5672:5672" - - "15672:15672" - environment: - RABBITMQ_USERNAME: datavault - RABBITMQ_PASSWORD: datavault - networks: - - mqnet - - mysql: - image: mysql:5.7 - ports: - - "53306:3306" - restart: always - environment: - MYSQL_ROOT_PASSWORD: unbr34kable - MYSQL_DATABASE: datavault - MYSQL_USER: datavault - MYSQL_PASSWORD: datavault - networks: - - dbnet - - workers: - build: - context: . - dockerfile: worker.Dockerfile - volumes: - - ./docker/tmp/datavault/active:/tmp/datavault/active:rw - - ./docker/tmp/datavault/archive:/tmp/datavault/archive:rw - - ./docker/tmp/datavault/temp:/tmp/datavault/temp:rw - - ./docker/tmp/datavault/meta:/tmp/datavault/meta:rw - - ./datavault-worker/target/datavault-worker-1.0-SNAPSHOT-jar-with-dependencies-spring.jar:/docker_datavault-home/datavault-worker-1.0-SNAPSHOT-jar-with-dependencies-spring.jar:rw - - ./docker/tmp/Users:/Users:rw - networks: - - dbnet - - mqnet - depends_on: - - rabbitmq - - mysql - -# volumes: -# db_data: -# rabbitmq_data: - -networks: - dbnet: - driver: bridge - mqnet: - driver: bridge \ No newline at end of file