Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-23 12:06:03 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-23 12:06:03 +0300
commitb3e4ec8e8adf4fe96c982124e91b6a05021a9cda (patch)
tree5fda0011a7cc7de000186e465e61f893d478a1c8 /qa
parent90cdc9391171e1be29b2b57a2e2aad0c02c2a7a9 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r--qa/qa.rb1
-rw-r--r--qa/qa/service/docker_run/maven.rb38
2 files changed, 39 insertions, 0 deletions
diff --git a/qa/qa.rb b/qa/qa.rb
index f9fba28bacb..17649c161ae 100644
--- a/qa/qa.rb
+++ b/qa/qa.rb
@@ -407,6 +407,7 @@ module QA
module DockerRun
autoload :Base, 'qa/service/docker_run/base'
autoload :LDAP, 'qa/service/docker_run/ldap'
+ autoload :Maven, 'qa/service/docker_run/maven'
autoload :NodeJs, 'qa/service/docker_run/node_js'
autoload :GitlabRunner, 'qa/service/docker_run/gitlab_runner'
end
diff --git a/qa/qa/service/docker_run/maven.rb b/qa/qa/service/docker_run/maven.rb
new file mode 100644
index 00000000000..435a68776d9
--- /dev/null
+++ b/qa/qa/service/docker_run/maven.rb
@@ -0,0 +1,38 @@
+# frozen_string_literal: true
+
+module QA
+ module Service
+ module DockerRun
+ class Maven < Base
+ def initialize(volume_host_path)
+ @image = 'maven:3.6.2-ibmjava-8-alpine'
+ @name = "qa-maven-#{SecureRandom.hex(8)}"
+ @volume_host_path = volume_host_path
+
+ super()
+ end
+
+ def publish!
+ # When we run the tests via gitlab-qa, we use docker-in-docker
+ # which means that host of a volume mount would be the host that
+ # started the gitlab-qa QA container (e.g., the CI runner),
+ # not the gitlab-qa container itself. That means we can't
+ # mount a volume from the file system inside the gitlab-qa
+ # container.
+ #
+ # Instead, we copy the files into the container.
+ shell <<~CMD.tr("\n", ' ')
+ docker run -d --rm
+ --network #{network}
+ --hostname #{host_name}
+ --name #{@name}
+ --volume #{@volume_host_path}:/home/maven
+ #{@image} sh -c "sleep 60"
+ CMD
+ shell "docker cp #{@volume_host_path}/. #{@name}:/home/maven"
+ shell "docker exec -t #{@name} sh -c 'cd /home/maven && mvn deploy -s settings.xml'"
+ end
+ end
+ end
+ end
+end