gitlab-ci-runner

`git clone project2` in gitlab-ci.yml?

你。 提交于 2019-12-01 07:38:17
I'd like Gitlab CI to fetch source code of another project. Is there a better way than adding a read-only deploy key and setting it up in .gitlab-ci.yml? You can also use GIT SUBMODULES within your project A to refer to project B and then add GIT_SUBMODULE_STRATEGY: recursive to the gitlab-ci.yml file in project A. This also enables you to specifically include a specific branch or commit from your subproject. https://docs.gitlab.com/ce/ci/git_submodules.html 来源: https://stackoverflow.com/questions/44444616/git-clone-project2-in-gitlab-ci-yml

Gitlab runner docker Could not resolve host

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 03:32:43
Im using 2 containers on my Ubuntu OS: Gitlab-ce and gitlab-runner Containers names are: gitlab_gitlab_1 and gitlab_gitlab-runner_1 I access to my gitlab app via gitlab.localhost.com:801 I register successfully a runner with this command: docker exec -it gitlab_gitlab-runner_1 gitlab-runner register --non-interactive --url http://gitlab_gitlab_1 --registration-token _wgMgEx3nBocYQtoi83c --executor docker --docker-image alpine:latest Then, when I start the job, I got this error message: Running with gitlab-runner 10.7.1 (b9bba623) on 589a617ee407 12ba77f7 Using Docker executor with image alpine

Gitlab runner docker Could not resolve host

匆匆过客 提交于 2019-12-01 00:51:54
问题 Im using 2 containers on my Ubuntu OS: Gitlab-ce and gitlab-runner Containers names are: gitlab_gitlab_1 and gitlab_gitlab-runner_1 I access to my gitlab app via gitlab.localhost.com:801 I register successfully a runner with this command: docker exec -it gitlab_gitlab-runner_1 gitlab-runner register --non-interactive --url http://gitlab_gitlab_1 --registration-token _wgMgEx3nBocYQtoi83c --executor docker --docker-image alpine:latest Then, when I start the job, I got this error message:

How to fail a build on Gitlab CI shell runner

我的梦境 提交于 2019-11-30 14:37:35
问题 I have a Gitlab CI runner running on windows 10: before_script: - "echo off" - 'call "%VS120COMNTOOLS%\vsvars32.bat"' - echo. - set - echo. stages: - build build: stage: build script: - 'StatusTest.exe' #- msbuild... I am trying to fail the build with StatusText.exe (I tried returning status codes -1,0,1; throwing an exception, etc.) But Runner only logs the exception and continues with following steps. What determines that CI shell runner should fail the build and not proceed to next step?

Gitlabs artifact of one project used in further projects

本小妞迷上赌 提交于 2019-11-30 13:07:24
Question What is the best way to carry artifacts (jar, class, war) among projects when using docker containers in CI phase. Let me explain my issue in details, please don't stop the reading... =) Gitlabs project1 unit tests etc... package Gitlabs project2 unit test etc... build (failing) here I need one artifact (jar) generated in project1 Current scenario / comments I'm using dockers so in each .gitlab-ci.yml I'll have independent containers All is working fine in project1 If I use "shell" instead of dockers in my .gitlab-ci.yml I can keep the jar file from the project1 in the disk and use

Trigger jobs in gitlab-ci on merge request

≡放荡痞女 提交于 2019-11-30 11:16:59
It's posible run a job from gitlab-ci only on merge request? Now, we have a big monolitic project with heavy tests, but we only want to run the test before merging to the branch master. This is now possible. This has been introduced in GitLab 11.6. Well, it's not built in currently however it's not impossible to do it yourself. Gitlab allows to trigger a job. It also supports webhooks on merge requests. However webhooks don't support variable in URIs and triggers can't read request body so you'd have to create a script that will act like a middle-man here: Webhook on merge request calls to

How to integrate Sonar Quality Gates with Gitlab-CI

对着背影说爱祢 提交于 2019-11-30 10:38:48
I have a gitlab-ci integration that require a sonar analysis and if the quality gates pass, to build a docker image. Is this possible using gitlab-ci ? To break the CI build for a failed Quality Gate, 1.Search in /report-task.txt the values of the CE Task URL (ceTaskUrl) and CE Task Id (ceTaskId) 2.Call /api/ce/task?id=XXX where XXX is the CE Task Id retrieved from step 1 Ex:- https:///api/ce/task?id=Your ceTaskId 3.Wait for sometime until the status is SUCCESS, CANCELED or FAILED from Step 2 4.If it is FAILED, break the build (Here failure is unable to generate sonar report) 5.If successful

Docker-in-Docker with Gitlab Shared runner for building and pushing docker images to registry

情到浓时终转凉″ 提交于 2019-11-30 09:46:42
Been trying to set-up Gitlab CI which can build a docker image, and came across that DinD was enabled initially only for separate runners and Blog Post suggest it would be enabled soon for shared runners, Running DinD requires enabling privileged mode in runners, which is set as a flag while registering runner, but couldn't find an equivalent mechanism for Shared Runners The shared runners are now capable of building Docker images. Here is the job that you can use: stages: - build - test - deploy # ... # other jobs here # ... docker:image: stage: deploy image: docker:1.11 services: - docker

GitLab CI runner can't connect to unix:///var/run/docker.sock in kubernetes

一曲冷凌霜 提交于 2019-11-30 08:10:39
GitLab's running in kubernetes cluster. Runner can't build docker image with build artifacts. I've already tried several approaches to fix this, but no luck. Here are some configs snippets: .gitlab-ci.yml image: docker:latest services: - docker:dind variables: DOCKER_DRIVER: overlay stages: - build - package - deploy maven-build: image: maven:3-jdk-8 stage: build script: "mvn package -B --settings settings.xml" artifacts: paths: - target/*.jar docker-build: stage: package script: - docker build -t gitlab.my.com/group/app . - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN gitlab.my.com

GitLab-CI Multi Runner php composer cache

北慕城南 提交于 2019-11-30 03:08:25
I'm using gitlab-ci-multi-runner with docker containers. Everything is going fine, but docker containers don't keep the composer cache so in every run composer downloads dependencies again and again, which takes a lot of time. Is there any way to configure gitlab-ci-runner docker container to keep the composer cache or mount a volume on each run where the composer cache is kept? Jens A. Koch You could modify the composer cache path and write the stuff to a docker volume. That storage is persistent and can be shared across containers. Referencing: https://gitlab.com/gitlab-org/gitlab-runner