-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#19 create application and system graphics and bootstrap command
- Loading branch information
1 parent
eaea754
commit 37e0e29
Showing
5 changed files
with
250 additions
and
0 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
acropolis-shell/src/main/kotlin/org/ephyra/acropolis/shell/BootstrapCommand.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.