-
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.
- Loading branch information
1 parent
91beb67
commit ba6b04b
Showing
4 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
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
7 changes: 7 additions & 0 deletions
7
...e/app/xquareinfra/domain/deploy/application/port/in/DeployMigrationToV2PipelineUseCase.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,7 @@ | ||
package xquare.app.xquareinfra.domain.deploy.application.port.`in` | ||
|
||
import java.util.UUID | ||
|
||
interface DeployMigrationToV2PipelineUseCase { | ||
fun migrationDeploy(deployId: UUID) | ||
} |
29 changes: 29 additions & 0 deletions
29
...e/app/xquareinfra/domain/deploy/application/service/DeployMigrationToV2PipelineService.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,29 @@ | ||
package xquare.app.xquareinfra.domain.deploy.application.service | ||
|
||
import org.springframework.stereotype.Service | ||
import org.springframework.transaction.annotation.Transactional | ||
import xquare.app.xquareinfra.domain.container.application.port.out.FindContainerPort | ||
import xquare.app.xquareinfra.domain.deploy.application.port.`in`.DeployMigrationToV2PipelineUseCase | ||
import xquare.app.xquareinfra.domain.deploy.application.port.out.FindDeployPort | ||
import xquare.app.xquareinfra.infrastructure.exception.BusinessLogicException | ||
import xquare.app.xquareinfra.infrastructure.vault.VaultUtil | ||
import java.util.* | ||
|
||
@Transactional | ||
@Service | ||
class DeployMigrationToV2PipelineService( | ||
private val findDeployPort: FindDeployPort, | ||
private val findContainerPort: FindContainerPort, | ||
private val vaultUtil: VaultUtil | ||
) : DeployMigrationToV2PipelineUseCase{ | ||
override fun migrationDeploy(deployId: UUID) { | ||
val deploy = findDeployPort.findById(deployId) ?: throw BusinessLogicException.DEPLOY_NOT_FOUND | ||
val containers = findContainerPort.findAllByDeploy(deploy) | ||
|
||
containers.map { | ||
vaultUtil.addSecret(it.environmentVariable, vaultUtil.getPath(deploy, it)) | ||
} | ||
|
||
deploy.migrationToV2() | ||
} | ||
} |
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