forked from TencentBlueKing/bk-ci
-
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.
feat: 构建并推送镜像支持插件接入 TencentBlueKing#5032
Signed-off-by: sawyersong <sawyersong@tencent.com>
- Loading branch information
1 parent
66e3b72
commit 996e69d
Showing
10 changed files
with
85 additions
and
119 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
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
56 changes: 0 additions & 56 deletions
56
.../api-dockerhost/src/main/kotlin/com/tencent/devops/dockerhost/pojo/DockerBuildParamNew.kt
This file was deleted.
Oops, something went wrong.
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
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
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
27 changes: 27 additions & 0 deletions
27
...erhost/src/main/kotlin/com/tencent/devops/dockerhost/services/image/ImageDeleteHandler.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,27 @@ | ||
package com.tencent.devops.dockerhost.services.image | ||
|
||
import org.slf4j.LoggerFactory | ||
import org.springframework.stereotype.Service | ||
|
||
@Service | ||
class ImageDeleteHandler : Handler<ImageHandlerContext>() { | ||
override fun handlerRequest(handlerContext: ImageHandlerContext) { | ||
with(handlerContext) { | ||
if (!scanFlag) { | ||
imageTagSet.parallelStream().forEach { | ||
logger.info("[$buildId]|[$vmSeqId] Push image success, now remove local image, image name and tag: $it") | ||
try { | ||
dockerClient.removeImageCmd(it).exec() | ||
logger.info("[$buildId]|[$vmSeqId] Remove local image success") | ||
} catch (e: Throwable) { | ||
logger.error("[$buildId]|[$vmSeqId] Docker rmi failed, msg: ${e.message}") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
companion object { | ||
private val logger = LoggerFactory.getLogger(ImageDeleteHandler::class.java) | ||
} | ||
} |
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
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
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