I have project on java, where i have my tests. Now i have .gitlab-ci.yml
:
image: maven:latest
stages:
- build
build:
stage: build
script:
- mvn test-compile compile
tags:
- mytag
only:
refs:
- dev
Each time, when i am making commit in my repo, i am waiting a lot of time, when it will download all depencies. In docker we can use volume option. The question:
Can i download and compile locally this project for creating of .m2
directory, and can i use this directory in my .gitlab-ci.yml
. If yes, can you help me how, because i have not found in internet examples according to it.
I made changes in my /etc/gitlab-runner/config.toml
:
[runners.docker]
tls_verify = false
image = "maven:latest"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache","/M2/.m2:/root/.m2"]
shm_size = 0
/M2/
is a dir, with gitlab-runner owner. But it does not help, how we can see:
Downloaded from central: https://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-parent/1.3/hamcrest-parent-1.3.pom (2.0 kB at 20 kB/s)
Downloading from atlas: https://dl.bintray.com/qameta/maven/org/seleniumhq/selenium/selenium-java/3.8.1/selenium-java-3.8.1.pom
Downloading from nio: http://clojars.org/repo/org/seleniumhq/selenium/selenium-java/3.8.1/selenium-java-3.8.1.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/seleniumhq/selenium/selenium-java/3.8.1/selenium-java-3.8.1.pom
Progress (1): 2.2/5.9 kB
Progress (1): 5.0/5.9 kB
Progress (1): 5.9 kB