Skip to content

Commit

Permalink
#19 create application and system graphics and bootstrap command
Browse files Browse the repository at this point in the history
  • Loading branch information
ThetaSinner committed Nov 11, 2018
1 parent eaea754 commit 37e0e29
Show file tree
Hide file tree
Showing 5 changed files with 250 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package org.ephyra.acropolis.shell

import org.ephyra.acropolis.persistence.api.GraphicalAssetType
import org.ephyra.acropolis.service.api.IGraphicalAssetService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.shell.standard.ShellComponent
import org.springframework.shell.standard.ShellMethod
import java.io.File

@ShellComponent
class BootstrapCommand {
@Autowired
private lateinit var graphicalAssetService: IGraphicalAssetService

@ShellMethod("Bootstrap Acropolis")
fun bootstrap() {
println("Bootstrapping the acropolis system.")

importGraphicalAssets()

println("Done. Acropolis is now ready to use!")
}

private fun importGraphicalAssets() {
println("Importing graphical assets")

graphicalAssetService.create(
"load-balancer",
File("user/graphics/load-balancer.png").readBytes(),
GraphicalAssetType.PNG
)

graphicalAssetService.create(
"reverse-proxy",
File("user/graphics/reverse-proxy.png").readBytes(),
GraphicalAssetType.PNG
)

graphicalAssetService.create(
"queue",
File("user/graphics/queue.png").readBytes(),
GraphicalAssetType.PNG
)

graphicalAssetService.create(
"datastore",
File("user/graphics/datastore.png").readBytes(),
GraphicalAssetType.PNG
)

graphicalAssetService.create(
"application",
File("user/graphics/application.png").readBytes(),
GraphicalAssetType.PNG
)

graphicalAssetService.create(
"system",
File("user/graphics/system.png").readBytes(),
GraphicalAssetType.PNG
)
}
}
Binary file added user/graphics/application.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
95 changes: 95 additions & 0 deletions user/graphics/application.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added user/graphics/system.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
92 changes: 92 additions & 0 deletions user/graphics/system.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 37e0e29

Please sign in to comment.