Skip to content
代码片段 群组 项目
未验证 提交 f43224ee 编辑于 作者: Will Meek's avatar Will Meek 提交者: GitLab
浏览文件

Apply 1 suggestion(s) to 1 file(s)

上级 9c5249a8
No related branches found
No related tags found
无相关合并请求
......@@ -4,8 +4,13 @@ module QA
module Service
module DockerRun
class ContainerRegistryUtils < Base
def tag_image(current_tag, new_tag)
run_docker_command("tag #{current_tag} #{new_tag}")
def initialize(image:)
@image = image
super()
end
def tag_image(new_tag)
run_docker_command("tag #{@image} #{new_tag}")
end
def push_image(tag)
......
......@@ -22,7 +22,7 @@ module QA
end
let(:new_image_tag) { "#{registry_host}/#{project.full_path}:latest" }
let(:docker_utils) { QA::Service::DockerRun::ContainerRegistryUtils.new }
let(:docker_utils) { QA::Service::DockerRun::ContainerRegistryUtils.new(image: image_tag) }
before do
Runtime::Feature.enable(:cvs_for_container_scanning, project: project)
......@@ -50,10 +50,11 @@ def configure_security_scanning
end
def push_container_image
docker_utils.pull
docker_utils.login(registry_host,
user: Runtime::Env.user_username,
password: registry_password_token)
docker_utils.tag_image(image_tag, new_image_tag)
docker_utils.tag_image(new_image_tag)
docker_utils.push_image(new_image_tag)
end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册