Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-boot-admin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-boot-admin
Commits
83384d9b
Commit
83384d9b
authored
Feb 26, 2018
by
Johannes Edmeier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revisit liquibase and flyway legacy conversion
parent
393d3da5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
112 additions
and
97 deletions
+112
-97
LegacyEndpointConverters.java
...oot/admin/server/web/client/LegacyEndpointConverters.java
+15
-10
flyway-expected.json
...centric/boot/admin/server/web/client/flyway-expected.json
+33
-28
liquibase-expected.json
...tric/boot/admin/server/web/client/liquibase-expected.json
+64
-59
No files found.
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/web/client/LegacyEndpointConverters.java
View file @
83384d9b
...
...
@@ -208,11 +208,14 @@ public class LegacyEndpointConverters {
@SuppressWarnings
(
"unchecked"
)
private
static
Map
<
String
,
Object
>
convertLiquibase
(
List
<
Map
<
String
,
Object
>>
reports
)
{
return
reports
.
stream
()
.
sequential
()
.
collect
(
toMap
(
r
->
(
String
)
r
.
get
(
"name"
),
r
->
singletonMap
(
"changeSets"
,
LegacyEndpointConverters
.
convertLiquibaseChangesets
(
(
List
<
Map
<
String
,
Object
>>)
r
.
get
(
"changeLogs"
)))));
Map
<
String
,
Object
>
liquibaseBeans
=
reports
.
stream
()
.
sequential
()
.
collect
(
toMap
(
r
->
(
String
)
r
.
get
(
"name"
),
r
->
singletonMap
(
"changeSets"
,
LegacyEndpointConverters
.
convertLiquibaseChangesets
(
(
List
<
Map
<
String
,
Object
>>)
r
.
get
(
"changeLogs"
)))));
return
singletonMap
(
"contexts"
,
singletonMap
(
"application"
,
singletonMap
(
"liquibaseBeans"
,
liquibaseBeans
)));
}
private
static
List
<
Map
<
String
,
Object
>>
convertLiquibaseChangesets
(
List
<
Map
<
String
,
Object
>>
changeSets
)
{
...
...
@@ -243,11 +246,13 @@ public class LegacyEndpointConverters {
@SuppressWarnings
(
"unchecked"
)
private
static
Map
<
String
,
Object
>
convertFlyway
(
List
<
Map
<
String
,
Object
>>
reports
)
{
return
reports
.
stream
()
.
sequential
()
.
collect
(
toMap
(
r
->
(
String
)
r
.
get
(
"name"
),
r
->
singletonMap
(
"migrations"
,
LegacyEndpointConverters
.
convertFlywayMigrations
(
(
List
<
Map
<
String
,
Object
>>)
r
.
get
(
"migrations"
)))));
Map
<
String
,
Object
>
flywayBeans
=
reports
.
stream
()
.
sequential
()
.
collect
(
toMap
(
r
->
(
String
)
r
.
get
(
"name"
),
r
->
singletonMap
(
"migrations"
,
LegacyEndpointConverters
.
convertFlywayMigrations
(
(
List
<
Map
<
String
,
Object
>>)
r
.
get
(
"migrations"
)))));
return
singletonMap
(
"contexts"
,
singletonMap
(
"application"
,
singletonMap
(
"flywayBeans"
,
flywayBeans
)));
}
private
static
List
<
Map
<
String
,
Object
>>
convertFlywayMigrations
(
List
<
Map
<
String
,
Object
>>
migrations
)
{
...
...
spring-boot-admin-server/src/test/resources/de/codecentric/boot/admin/server/web/client/flyway-expected.json
View file @
83384d9b
{
"flyway"
:
{
"migrations"
:
[
{
"type"
:
"SQL"
,
"checksum"
:
710039845
,
"version"
:
"1"
,
"description"
:
"init"
,
"script"
:
"V1__init.sql"
,
"state"
:
"SUCCESS"
,
"installedOn"
:
"2017-12-30T11:12:18.544+0000"
,
"executionTime"
:
10
"contexts"
:
{
"application"
:
{
"flywayBeans"
:
{
"flyway"
:
{
"migrations"
:
[
{
"type"
:
"SQL"
,
"checksum"
:
710039845
,
"version"
:
"1"
,
"description"
:
"init"
,
"script"
:
"V1__init.sql"
,
"state"
:
"SUCCESS"
,
"installedOn"
:
"2017-12-30T11:12:18.544+0000"
,
"executionTime"
:
10
}
]
},
"secondary"
:
{
"migrations"
:
[
{
"type"
:
"SQL"
,
"checksum"
:
710039845
,
"version"
:
"1"
,
"description"
:
"init"
,
"script"
:
"V1__init.sql"
,
"state"
:
"SUCCESS"
,
"installedOn"
:
"2017-12-30T11:12:18.544+0000"
,
"executionTime"
:
10
}
]
}
}
]
},
"secondary"
:
{
"migrations"
:
[
{
"type"
:
"SQL"
,
"checksum"
:
710039845
,
"version"
:
"1"
,
"description"
:
"init"
,
"script"
:
"V1__init.sql"
,
"state"
:
"SUCCESS"
,
"installedOn"
:
"2017-12-30T11:12:18.544+0000"
,
"executionTime"
:
10
}
]
}
}
}
\ No newline at end of file
}
spring-boot-admin-server/src/test/resources/de/codecentric/boot/admin/server/web/client/liquibase-expected.json
View file @
83384d9b
{
"liquibase"
:
{
"changeSets"
:
[
{
"author"
:
"marceloverdijk"
,
"changeLog"
:
"classpath:/db/changelog/db.changelog-master.yaml"
,
"comments"
:
""
,
"contexts"
:
[],
"dateExecuted"
:
"2017-12-29T23:05:35.890+0000"
,
"deploymentId"
:
"4588735849"
,
"description"
:
"createTable tableName=person"
,
"execType"
:
"EXECUTED"
,
"id"
:
"1"
,
"labels"
:
[],
"checksum"
:
"7:b8f2ae9c88deabd32666dff9bc5d7f5d"
,
"orderExecuted"
:
1
,
"tag"
:
null
},
{
"author"
:
"marceloverdijk"
,
"changeLog"
:
"classpath:/db/changelog/db.changelog-master.yaml"
,
"comments"
:
""
,
"contexts"
:
[
"dev"
,
"db2"
],
"dateExecuted"
:
"2017-12-29T23:05:35.899+0000"
,
"deploymentId"
:
"4588735849"
,
"description"
:
"insert tableName=person"
,
"execType"
:
"EXECUTED"
,
"id"
:
"2"
,
"labels"
:
[
"hard"
,
"core"
],
"checksum"
:
"7:a8006415097ebb8b3334a23347847322"
,
"orderExecuted"
:
2
,
"tag"
:
null
"contexts"
:
{
"application"
:
{
"liquibaseBeans"
:
{
"liquibase"
:
{
"changeSets"
:
[
{
"author"
:
"marceloverdijk"
,
"changeLog"
:
"classpath:/db/changelog/db.changelog-master.yaml"
,
"comments"
:
""
,
"contexts"
:
[],
"dateExecuted"
:
"2017-12-29T23:05:35.890+0000"
,
"deploymentId"
:
"4588735849"
,
"description"
:
"createTable tableName=person"
,
"execType"
:
"EXECUTED"
,
"id"
:
"1"
,
"labels"
:
[],
"checksum"
:
"7:b8f2ae9c88deabd32666dff9bc5d7f5d"
,
"orderExecuted"
:
1
,
"tag"
:
null
},
{
"author"
:
"marceloverdijk"
,
"changeLog"
:
"classpath:/db/changelog/db.changelog-master.yaml"
,
"comments"
:
""
,
"contexts"
:
[
"dev"
,
"db2"
],
"dateExecuted"
:
"2017-12-29T23:05:35.899+0000"
,
"deploymentId"
:
"4588735849"
,
"description"
:
"insert tableName=person"
,
"execType"
:
"EXECUTED"
,
"id"
:
"2"
,
"labels"
:
[
"hard"
,
"core"
],
"checksum"
:
"7:a8006415097ebb8b3334a23347847322"
,
"orderExecuted"
:
2
,
"tag"
:
null
}
]
},
"secondary"
:
{
"changeSets"
:
[
{
"author"
:
"marceloverdijk"
,
"changeLog"
:
"classpath:/db/changelog/db.changelog-master.yaml"
,
"comments"
:
""
,
"contexts"
:
[],
"dateExecuted"
:
"2017-12-29T23:05:35.890+0000"
,
"deploymentId"
:
"4588735849"
,
"description"
:
"createTable tableName=person"
,
"execType"
:
"EXECUTED"
,
"id"
:
"1"
,
"labels"
:
[],
"checksum"
:
"7:b8f2ae9c88deabd32666dff9bc5d7f5d"
,
"orderExecuted"
:
1
,
"tag"
:
null
}
]
}
}
]
},
"secondary"
:
{
"changeSets"
:
[
{
"author"
:
"marceloverdijk"
,
"changeLog"
:
"classpath:/db/changelog/db.changelog-master.yaml"
,
"comments"
:
""
,
"contexts"
:
[],
"dateExecuted"
:
"2017-12-29T23:05:35.890+0000"
,
"deploymentId"
:
"4588735849"
,
"description"
:
"createTable tableName=person"
,
"execType"
:
"EXECUTED"
,
"id"
:
"1"
,
"labels"
:
[],
"checksum"
:
"7:b8f2ae9c88deabd32666dff9bc5d7f5d"
,
"orderExecuted"
:
1
,
"tag"
:
null
}
]
}
}
}
\ No newline at end of file
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment