+27
-6
@@ -1,20 +1,41 @@
|
|||||||
language: java
|
language: java
|
||||||
|
services:
|
||||||
|
- mysql
|
||||||
|
|
||||||
install: true
|
install: true
|
||||||
|
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- mysql-5.7-trusty
|
||||||
|
packages:
|
||||||
|
- mysql-server
|
||||||
|
- mysql-client
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- chmod +x pandamonium-theorem-prover/gradlew
|
- chmod +x pandamonium-theorem-prover/gradlew
|
||||||
- cd pandamonium-theorem-prover
|
- 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:
|
stages:
|
||||||
- name: build
|
- name: Load Database
|
||||||
- name: unit tests
|
- name: Build
|
||||||
- name: integration tests
|
- name: Unit Tests
|
||||||
|
- name: Integration Tests
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
include:
|
include:
|
||||||
- stage: build
|
- stage: Load Database
|
||||||
|
script: ./gradlew loaddb
|
||||||
|
- stage: Build
|
||||||
script: ./gradlew build
|
script: ./gradlew build
|
||||||
- stage: unit tests
|
- stage: Unit Tests
|
||||||
script: ./gradlew test
|
script: ./gradlew test
|
||||||
- stage: integration tests
|
- stage: Integration Tests
|
||||||
script: ./gradlew integrationTest
|
script: ./gradlew integrationTest
|
||||||
|
|||||||
@@ -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'
|
id 'java'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
description = 'Provides database access and connectivity'
|
||||||
group 'edu.msudenver.tsp'
|
group 'edu.msudenver.tsp'
|
||||||
version '1.0'
|
version '1.0'
|
||||||
|
|
||||||
@@ -14,4 +15,19 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
testCompile group: 'junit', name: 'junit', version: '4.12'
|
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||||
compile fileTree(dir: 'lib', include: '**/*.jar')
|
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
|
||||||
|
);
|
||||||
Reference in New Issue
Block a user