From d64e3a8b281d355c7d51d04df52fab407b8cc76d Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 29 Oct 2019 12:06:40 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- qa/qa/service/docker_run/jenkins.rb | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 qa/qa/service/docker_run/jenkins.rb (limited to 'qa/qa/service') diff --git a/qa/qa/service/docker_run/jenkins.rb b/qa/qa/service/docker_run/jenkins.rb new file mode 100644 index 00000000000..00b63282484 --- /dev/null +++ b/qa/qa/service/docker_run/jenkins.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module QA + module Service + module DockerRun + class Jenkins < Base + def initialize + @image = 'registry.gitlab.com/gitlab-org/gitlab-qa/jenkins-gitlab:version1' + @name = 'jenkins-server' + @port = '8080' + super() + end + + def host_address + "http://#{host_name}:#{@port}" + end + + def host_name + return 'localhost' unless QA::Runtime::Env.running_in_ci? + + super + end + + def register! + command = <<~CMD.tr("\n", ' ') + docker run -d --rm + --network #{network} + --hostname #{host_name} + --name #{@name} + --env JENKINS_HOME=jenkins_home + --publish #{@port}:8080 + --publish 50000:50000 + #{@image} + CMD + + command.gsub!("--network #{network} ", '') unless QA::Runtime::Env.running_in_ci? + + shell command + end + end + end + end +end -- cgit v1.2.1