gitlab-ci-runner

GitLab CI Runner, how to use volumes or mounts in service containers

青春壹個敷衍的年華 提交于 2019-12-10 13:33:33
问题 I use GitLab CI Runner, it uses the command: docker run -d --name postgres postgres:9.4 I want to do something like this: docker run -d --name postgres --volumes-from postgres_datastore postgres:9.4 But GitLab CI Runner doesn't support any options (-v or --volumes-from) . Is there any other way? 回答1: The Docker volumes-from option is not yet available in Gitlab CI Runner (see this PR), however you can configure host mounts and volumes: [runners.docker] volumes = ["/host/path:/target/path:rw",

How can I save the Docker container that was used to perform a build in Gitlab CI?

♀尐吖头ヾ 提交于 2019-12-10 13:25:27
问题 I am using Gitlab CI in combination with a runner that uses Docker. In the git repo of a project in Gitlab, I have placed a .gitlab-ci.yml file. Pushing this file causes the runner to create a Docker container based on the Docker image I have provided. It then runs the build steps laid down in the yml file. This works very well when the build succeeds. However, when the build fails, I would like to be able to find the cause in the Docker container that was used to run this build. Is this

Gitlab ci artifacts not found

主宰稳场 提交于 2019-12-10 12:33:41
问题 . Hello, can someone tell me, why gitlab cannot find my artifacts? Logfile: $ ls -la /build/Project*.zip -rw-r--r-- 1 root root 1641 Nov 25 21:18 /build/Project-1.0.zip Uploading artifacts... WARNING: /build/Project*.zip: no matching files CI File: package: stage: package script: - ... ... ... - ls -la /build/Project*.zip only: - master artifacts: paths: - "/build/$CI_PROJECT_NAME*.mkp" expire_in: 1 week 回答1: The path of artifacts has to be relative to and be a child of $CI_PROJECT_DIR. 来源:

Can anyone post a working example of GitLab CI that has external submodules?

余生长醉 提交于 2019-12-10 11:47:03
问题 I am trying to get gitlab’s CI to work properly with an external submodule. I have a submodule in ANOTHER repository, so no relative path. I do NOT want to use a SSH key solution. I want to use the CI token (CI_JOB_TOKEN). Documentation is NOT clear because what is possible, or not, has changed and there are texts all over the place with many different approaches and, yet, nothing that fits the basic criteria. It used to not be possible to pull submodules, with CI, if they had an absolute

Automating pushing parts of a git repo to google cloud bucket

爷,独闯天下 提交于 2019-12-10 10:59:55
问题 In setting this up, my thinking was that I'd work on my repo and have it privately stored with Gitlab. I'd then create a .gitlab-ci.yml file which on every push it would trigger a push to a Google Source Repo which triggers actions to update the project's bucket. I went through the Generating Static Credentials guide which seems to link to a very antiquated page to which instructs you to create a .gitcookies file which will store your static credentials. I don't understand what it's giving me

“Host key verification failed” on Gitlab_ci although ssh_key is present

家住魔仙堡 提交于 2019-12-09 13:40:10
问题 "Host key verification failed." on Gitlab_ci when running "ssh name@server" Here's a part of my gitlab_ci which is supposed to login to my server and run scripts from the repo: script: - which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y ) - eval $(ssh-agent -s) - ssh-add <(echo -e "$SSH_PRIVATE_KEY") - echo "debug" - echo "$SSH_PRIVATE_KEY" # all is ok here, it'll be printed - echo "debug" # - here comes an error - (cat ./script/script1.sh) | ssh -t -t $SSH_USERNAME@

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

戏子无情 提交于 2019-12-09 03:18:47
问题 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? 回答1: 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

GitLab-CI Multi Runner php composer cache

本小妞迷上赌 提交于 2019-12-08 23:09:32
问题 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? 回答1: You could modify the composer cache path and write the stuff to a docker volume. That storage is persistent

Why can't gitlab-runner clone my project? (Incorrect hostname, failed to connect)

冷暖自知 提交于 2019-12-08 17:40:03
问题 I set-up a Gitlab server and need to run tests Windows using gitlab-runner.exe. The gitlab-runner's executor is set to shell , the config.toml looks like concurrent = 1 check_interval = 0 [[runners]] name = "PC123" url = "http://1.2.3.4/ci" token = "cd2b093adc5ca09ea41ee4eadb0752" executor = "shell" [runners.cache] When the test is spawned on a commit it fails with Cloning into 'C:/git/builds/ac70aeb9/0/test/myproject'... fatal: unable to access 'http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx

Switch from shared to dedicated Gitlab runner: pipeline broken

此生再无相见时 提交于 2019-12-08 11:40:22
问题 I'm starting with CI/CD, and for a dockerized Rails application I was using Gitlab shared runners, until I was stuck by trigger limits on these. So I decided to build my own dedicated runner, following the official documentation, in order to continue my tests (I'm actually trying to deploy to DigitalOcean using .gitlab-ci.yml ). But, since I switched the pipeline always fails with this error: The command '/bin/sh -c docker/potential_asset_precompile.sh $PRECOMPILEASSETS' returned a non-zero