Skip to content

Commit 4a7ae24

Browse files
committed
fix registry cache on AWS
1 parent 33aaaea commit 4a7ae24

1 file changed

Lines changed: 5 additions & 11 deletions

File tree

pkg/devdeploy/build_docker.go

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,8 @@ func BuildDocker(log *log.Logger, req *BuildDockerRequest) error {
256256
var ciRegImg string
257257
ciReg := os.Getenv("CI_REGISTRY")
258258
if ciReg != "" {
259-
ciLoginCmd = []string{
260-
"docker", "login",
261-
"-u", os.Getenv("CI_REGISTRY_USER"),
262-
"-p", os.Getenv("CI_REGISTRY_PASSWORD"),
263-
ciReg}
264-
ciRegImg = os.Getenv("CI_REGISTRY_IMAGE")
259+
ciLoginCmd = req.ReleaseDockerLoginCmd
260+
ciRegImg = ciReg + "/" + os.Getenv("CI_REGISTRY_IMAGE")
265261
}
266262

267263
var cmds [][]string
@@ -302,11 +298,9 @@ func BuildDocker(log *log.Logger, req *BuildDockerRequest) error {
302298
buildBaseImage string
303299
)
304300
if ciReg != "" {
305-
cmds = append(cmds, []string{
306-
"docker", "login",
307-
"-u", os.Getenv("CI_REGISTRY_USER"),
308-
"-p", os.Getenv("CI_REGISTRY_PASSWORD"),
309-
ciReg})
301+
if len(req.ReleaseDockerLoginCmd) > 0 {
302+
cmds = append(cmds, req.ReleaseDockerLoginCmd)
303+
}
310304

311305
buildBaseImage = ciRegImg + ":" + stage.CacheTag
312306
pushTargetImg = true

0 commit comments

Comments
 (0)