Merge pull request #9 from atusa17/PAN-6

Pan 6
This commit is contained in:
dantanxiaotian
2019-02-10 14:35:34 -07:00
committed by GitHub
5 changed files with 76 additions and 31 deletions
+27 -6
View File
@@ -1,20 +1,41 @@
language: java
services:
- mysql
install: true
addons:
apt:
sources:
- mysql-5.7-trusty
packages:
- mysql-server
- mysql-client
before_install:
- chmod +x pandamonium-theorem-prover/gradlew
- cd pandamonium-theorem-prover
before_script:
- mysql_upgrade --force -uroot
- mysql -u root -e 'CREATE DATABASE IF NOT EXISTS pandamonium;'
- mysql -u root -e "CREATE USER 'panda'@'localhost';"
- mysql -u root -e "GRANT ALL PRIVILEGES ON *.* to 'panda'@'localhost';"
- mysql -u root pandamonium < persistence/scripts/mysql/local_development.sql
stages:
- name: build
- name: unit tests
- name: integration tests
- name: Load Database
- name: Build
- name: Unit Tests
- name: Integration Tests
jobs:
include:
- stage: build
- stage: Load Database
script: ./gradlew loaddb
- stage: Build
script: ./gradlew build
- stage: unit tests
- stage: Unit Tests
script: ./gradlew test
- stage: integration tests
- stage: Integration Tests
script: ./gradlew integrationTest
-25
View File
@@ -1,25 +0,0 @@
language: java
install: true
sudo: false
addons:
apt:
packages:
- oracle-java8-installer
before_install:
- chmod +x pandamonium-theorem-prover/gradlew
stages:
- name: build
- name: unitTest
- name: integrationTest
jobs:
include:
- stage: build
script: ./pandamonium-theorem-prover/gradlew build
- stage: unitTest
script: ./pandamonium-theorem-prover/gradlew test
- stage: integrationTest
script: ./pandamonium-theorem-prover/gradlew integrationTest
@@ -2,6 +2,7 @@ plugins {
id 'java'
}
description = 'Provides database access and connectivity'
group 'edu.msudenver.tsp'
version '1.0'
@@ -14,4 +15,19 @@ repositories {
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile fileTree(dir: 'lib', include: '**/*.jar')
compile 'com.mchange:c3p0:0.9.5.2'
compile 'mysql:mysql-connector-java:5.1.35'
compile 'org.hibernate:hibernate-validator:5.3.4.Final'
compile 'javax.validation:validation-api:1.1.0.Final'
compile('com.googlecode.log4jdbc:log4jdbc:1.2') {
exclude(group: 'org.slf4j')
}
testCompile 'javax.el:javax.el-api:3.0.0'
}
task loadDb(type: Exec, group: 'Verification', description: 'Reloads the local database.') {
workingDir "./scripts/mysql"
commandLine './loaddb.sh'
}
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
export MYSQL_PWD=secret
for sqlScript in $( find . -name "*.sql" -print | sort);
do
echo "**** $sqlScript ****"
mysql --batch --quick --raw --line-numbers --force --user=panda < $sqlScript
done
@@ -0,0 +1,25 @@
drop database if exists pandamonium;
create database pandamonium;
use pandamonium;
create table accounts (
id int not null auto_increment primary key unique,
username varchar(50) not null unique,
password varchar(256) not null,
administrator_status boolean default false,
last_login date,
version int default 1
);
insert into accounts (username, password, administrator_status)
values ('admin', 'secret', true),
('atusa', 'secret', true),
('dantanxiaotian', 'secret', true),
('BrittanyBi', 'secret', true),
('lanlanzeliu', 'secret', true),
('tramanh305', 'secret', true);
create table definitions (
id int not null auto_increment primary key unique,
name varchar(200) not null,
definition json not null,
notation json,
version int default 1
);