Skip to content

Commit

Permalink
Merge pull request #41 from OPUS4/dbsetup40
Browse files Browse the repository at this point in the history
#40 Use opus4db for initializing db
  • Loading branch information
j3nsch authored Feb 20, 2023
2 parents cd8c962 + aee52da commit 53bc489
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 75 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
php-versions: ['7.1', '7.4', '8.1']
php-versions: ['7.1', '8.1']

name: PHP ${{ matrix.php-versions }} Test

Expand All @@ -31,15 +31,18 @@ jobs:
- name: Install Composer and Dependencies
run: curl -s http://getcomposer.org/installer | php && php composer.phar self-update && php composer.phar install

- name: Check files
run: ant lint

- name: Start MySQL
run: sudo systemctl start mysql.service

- name: Prepare workspace
run: ant prepare-workspace

- name: Prepare database
run: bash vendor/bin/opus4db --adminpwd root --userpwd root --sqlpwd root

- name: Prepare
run: ant prepare-workspace prepare-config lint -DdbUserPassword=root -DdbAdminPassword=root && export APPLICATION_PATH=. && php vendor/opus4-repo/framework/db/createdb.php

- name: Tests
run: php composer.phar test

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ nbproject

# Build files
build
test/config.ini
database.ini*

# Other
**/.DS_Store
Expand Down
14 changes: 6 additions & 8 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@ bin/install-composer.sh
bin/composer update
SCRIPT

$database = <<SCRIPT
/vagrant/vendor/bin/opus4db --adminpwd root --userpwd root --sqlpwd root
$workspace = <<SCRIPT
cd /vagrant
ant prepare-workspace
SCRIPT

$opus = <<SCRIPT
cd /vagrant
ant prepare-workspace prepare-config -DdbUserPassword=root -DdbAdminPassword=root
export APPLICATION_PATH=/vagrant
php vendor/opus4-repo/framework/db/createdb.php
$database = <<SCRIPT
/vagrant/vendor/bin/opus4db --adminpwd root --userpwd root --sqlpwd root
SCRIPT

$environment = <<SCRIPT
Expand All @@ -63,8 +61,8 @@ Vagrant.configure("2") do |config|

config.vm.provision "Install required software...", type: "shell", inline: $software
config.vm.provision "Install Composer dependencies...", type: "shell", privileged: false, inline: $composer
config.vm.provision "Create workspace...", type: "shell", privileged: false, inline: $workspace
config.vm.provision "Create database...", type: "shell", inline: $database
config.vm.provision "Configure OPUS 4...", type: "shell", privileged: false, inline: $opus
config.vm.provision "Setup environment...", type: "shell", inline: $environment
config.vm.provision "Information", type: "shell", privileged: false, run: "always", inline: $help
end
21 changes: 0 additions & 21 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
<project name="opus4-import">

<property environment="env" />
<property name="bindir" value="${basedir}/vendor/bin" />

<!-- Properties for configuration files (tests/config.ini) used for testing. -->
<property name="dbName" value="opusdb" />
<property name="dbUserName" value="opus4" />
<property name="dbUserPassword" value="" />
<property name="dbAdminName" value="opus4admin" />
<property name="dbAdminPassword" value="" />

<target name="clean">
<delete dir="${basedir}/build/logs" />
Expand All @@ -35,19 +27,6 @@
<mkdir dir="${basedir}/build/workspace/files" />
</target>

<target name="prepare-config">
<copy file="${basedir}/test/config.ini.template" toFile="${basedir}/test/config.ini" filtering="true"
overwrite="true">
<filterset>
<filter token="db.user.name" value="${dbUserName}" />
<filter token="db.user.password" value="${dbUserPassword}" />
<filter token="db.admin.name" value="${dbAdminName}" />
<filter token="db.admin.password" value="${dbAdminPassword}" />
<filter token="db.name" value="${dbName}" />
</filterset>
</copy>
</target>

<target name="lint">
<apply executable="php" dir="${basedir}" failonerror="on" logerror="on">
<arg line="-l"/>
Expand Down
41 changes: 0 additions & 41 deletions test/config.ini.template

This file was deleted.

0 comments on commit 53bc489

Please sign in to comment.