diff --git a/.travis.yml b/.travis.yml index c046c3b..b31619a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,17 +20,3 @@ env: before_install: - mysql -e 'create database deploydb;' - psql -c 'create database travis_ci_test;' -U postgres - -install: - - "sudo apt-get remove mysql-common mysql-server-5.5 mysql-server-core-5.5 mysql-client-5.5 mysql-client-core-5.5" - - "sudo apt-get autoremove" - - "sudo apt-get install libaio1" - - "wget -O mysql-5.6.14.deb http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.14-debian6.0-x86_64.deb/from/http://cdn.mysql.com/" - - "sudo dpkg -i mysql-5.6.14.deb" - - "sudo cp /opt/mysql/server-5.6/support-files/mysql.server /etc/init.d/mysql.server" - - "sudo ln -s /opt/mysql/server-5.6/bin/* /usr/bin/" - # some config values were changed since 5.5 - - "sudo sed -i'' 's/table_cache/table_open_cache/' /etc/mysql/my.cnf" - - "sudo sed -i'' 's/log_slow_queries/slow_query_log/' /etc/mysql/my.cnf" - - "sudo sed -i'' 's/basedir[^=]\\+=.*$/basedir = \\/opt\\/mysql\\/server-5.6/' /etc/mysql/my.cnf" - - "sudo /etc/init.d/mysql.server start" \ No newline at end of file diff --git a/src/cucumber/groovy/step_definitions/HttpSteps.groovy b/src/cucumber/groovy/step_definitions/HttpSteps.groovy index 0b1fee5..dcbb0b5 100644 --- a/src/cucumber/groovy/step_definitions/HttpSteps.groovy +++ b/src/cucumber/groovy/step_definitions/HttpSteps.groovy @@ -81,10 +81,12 @@ Then(~/^the response body should be:$/) { String expectedBody -> } Then(~/^the body should be JSON:$/) { String expectedBody -> + + ObjectMapper mapper = new ObjectMapper() String body = response.readEntity(String.class) templateVariables = [ - 'created_timestamp' : DateTime.now(), + 'created_timestamp' : DateTime.now().withMillisOfSecond(0), ] expectedBody = processTemplate(expectedBody, templateVariables) diff --git a/src/cucumber/groovy/step_definitions/WebhookSteps.groovy b/src/cucumber/groovy/step_definitions/WebhookSteps.groovy index a340870..8461368 100644 --- a/src/cucumber/groovy/step_definitions/WebhookSteps.groovy +++ b/src/cucumber/groovy/step_definitions/WebhookSteps.groovy @@ -125,7 +125,7 @@ Then(~/^the webhook should be invoked with the JSON:$/) { String expectedMessage String requestMessageBody = requestWebhookObject.getRequestMessageBody() templateVariables = [ - 'created_timestamp' : DateTime.now(), + 'created_timestamp' : DateTime.now().withMillisOfSecond(0), ] expectedMessageBody = processTemplate(expectedMessageBody, templateVariables) @@ -144,7 +144,7 @@ Then(~/^the webhook ([1-9][0-9]*) should be invoked with the JSON:$/) { int webh String requestMessageBody = requestWebhookObject.getRequestMessageBodies()[webhookNumber -1] templateVariables = [ - 'created_timestamp' : DateTime.now(), + 'created_timestamp' : DateTime.now().withMillisOfSecond(0), ] expectedMessageBody = processTemplate(expectedMessageBody, templateVariables) diff --git a/src/main/groovy/db/migration/V2__artifacts_versions.groovy b/src/main/groovy/db/migration/V2__artifacts_versions.groovy index 5f03d44..2811415 100644 --- a/src/main/groovy/db/migration/V2__artifacts_versions.groovy +++ b/src/main/groovy/db/migration/V2__artifacts_versions.groovy @@ -46,8 +46,8 @@ class V2__artifacts_versions extends DeployDBMigration { ADD COLUMN ( version VARCHAR(255) NOT NULL, sourceUrl TEXT, - createdAt TIMESTAMP(3), - deletedAt TIMESTAMP(3) NULL + createdAt TIMESTAMP, + deletedAt TIMESTAMP NULL ); """ } diff --git a/src/main/groovy/db/migration/V4__create_deployments_table.groovy b/src/main/groovy/db/migration/V4__create_deployments_table.groovy index daf201f..47b9b36 100644 --- a/src/main/groovy/db/migration/V4__create_deployments_table.groovy +++ b/src/main/groovy/db/migration/V4__create_deployments_table.groovy @@ -53,8 +53,8 @@ class V4__create_deployments_table extends DeployDBMigration { environment VARCHAR(8192) NOT NULL, status INT NOT NULL, - createdAt TIMESTAMP(3), - deletedAt TIMESTAMP(3) NULL, + createdAt TIMESTAMP, + deletedAt TIMESTAMP NULL, PRIMARY KEY (id) ); diff --git a/src/main/groovy/db/migration/V5__create_flows_table.groovy b/src/main/groovy/db/migration/V5__create_flows_table.groovy index e7f0b48..07ac0fa 100644 --- a/src/main/groovy/db/migration/V5__create_flows_table.groovy +++ b/src/main/groovy/db/migration/V5__create_flows_table.groovy @@ -51,8 +51,8 @@ class V5__create_flows_table extends DeployDBMigration { artifactId BIGINT NOT NULL, service TEXT NOT NULL, - createdAt TIMESTAMP(3), - deletedAt TIMESTAMP(3) NULL, + createdAt TIMESTAMP, + deletedAt TIMESTAMP NULL, PRIMARY KEY (id) ); diff --git a/src/main/groovy/db/migration/V6__create_promotion_results_table.groovy b/src/main/groovy/db/migration/V6__create_promotion_results_table.groovy index 4dc1982..77f389a 100644 --- a/src/main/groovy/db/migration/V6__create_promotion_results_table.groovy +++ b/src/main/groovy/db/migration/V6__create_promotion_results_table.groovy @@ -57,8 +57,8 @@ class V6__create_promotion_results_table extends DeployDBMigration { infoUrl TEXT, deploymentId BIGINT NOT NULL, - createdAt TIMESTAMP(3), - deletedAt TIMESTAMP(3) NULL, + createdAt TIMESTAMP, + deletedAt TIMESTAMP NULL, PRIMARY KEY (id), FOREIGN KEY (deploymentId) REFERENCES deployments(id) diff --git a/src/main/groovy/db/migration/V8__create_configs_table.groovy b/src/main/groovy/db/migration/V8__create_configs_table.groovy index c7b63f5..dd3c0c2 100644 --- a/src/main/groovy/db/migration/V8__create_configs_table.groovy +++ b/src/main/groovy/db/migration/V8__create_configs_table.groovy @@ -51,8 +51,8 @@ class V8__create_configs_table extends DeployDBMigration { contents TEXT NOT NULL, ident VARCHAR(8192), modelType INT NOT NULL, - createdAt TIMESTAMP(3), - deletedAt TIMESTAMP(3) NULL, + createdAt TIMESTAMP, + deletedAt TIMESTAMP NULL, PRIMARY KEY (id) ); """ diff --git a/src/main/groovy/deploydb/models/AbstractModel.groovy b/src/main/groovy/deploydb/models/AbstractModel.groovy index 03b9e49..5ecdd49 100644 --- a/src/main/groovy/deploydb/models/AbstractModel.groovy +++ b/src/main/groovy/deploydb/models/AbstractModel.groovy @@ -16,7 +16,7 @@ abstract class AbstractModel { Long id @Column(name='createdAt', nullable=false) - protected DateTime createdAt = DateTime.now() + protected DateTime createdAt = DateTime.now().withMillisOfSecond(0) @Column(name='deletedAt') protected DateTime deletedAt