gitlab-ci-runner

GitLab runner on Windows and dealing with & %ERRORLEVEL%

一世执手 提交于 2019-12-08 00:29:43
问题 In my .gitlab-ci.yml, i am trying to use the findstr command. findstr /c:"%SOLUTION_DIR%" gitlab.dif > founded.ref This command set the %ERRORLEVEL% to 1 if it has no match of "%SOLUTION_DIR%" in gitlab.dif. It seems like GitLab runner is interpreting this as a job failure. ERROR: Job failed: exit status 1 Is there any workaround? EDIT : my .gitlab-ci.yml file stages: - check - build check_diff: stage: check script: - git diff --name-only origin/develop...HEAD > _gitlab_diff.txt - git diff -

GitlabCI build failed, docker.sock: write: broken pipe

£可爱£侵袭症+ 提交于 2019-12-07 18:11:32
问题 I was trying to implement a new CI workflow using GitlabCI but now I can't understand the issue. I followed this doc and I choose the Docker socket binding method. Everything is running on the same machine, a RancherOS : $ uname -a Linux xxx 4.2.8-ckt4-rancher #1 SMP Tue Apr 5 16:12:00 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 57801c725226 gitlab/gitlab-runner:latest "/usr/bin/dumb-init /" 14 hours ago Up 14 hours gitlab-runner

GitLab pull submodules inside CI

元气小坏坏 提交于 2019-12-07 11:05:15
问题 I have a GitLab project that utilises GitLab CI. The project also uses submodules, both the project and it's submodules are under the same GitLab account. Here is my .gitmodules file [submodule "proto_contracts"] path = proto_contracts url = https://gitlab.com/areller/proto_contracts.git I also have this piece in the .gitlab-ci.yml file variables: GIT_SUBMODULE_STRATEGY: recursive However, when i run the CI I get this error fatal: could not read Username for 'https://gitlab.com': No such

./deploy.sh not working on gitlab ci

核能气质少年 提交于 2019-12-07 04:37:54
问题 My problem is the bash script I created got this error "/bin/sh: eval: line 88: ./deploy.sh: not found" on gitlab. Below is my sample script .gitlab-ci.yml . I suspect that gitlab ci is not supporting bash script. image: docker:latest variables: IMAGE_NAME: registry.gitlab.com/$PROJECT_OWNER/$PROJECT_NAME DOCKER_DRIVER: overlay services: - docker:dind stages: - deploy before_script: - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com - docker pull $IMAGE_NAME:$CI_BUILD

Gitlab-Ci: How could I share data between jobs

六月ゝ 毕业季﹏ 提交于 2019-12-07 00:53:36
问题 I want to share a file between two jobs and modify it if there are changed files. The python script compare the cache.json file with changes and modify the cahce file sometimes. .gitlab-ci.yaml : image: ubuntu stages: - test cache: key: one-cache paths: - cache.json job1: stage: test script: # - touch cache.json - cat cache.json - python3 modify_json_file.py - cat cache.json The problem is that it the cache.json file not exist at the next job run. I get the error message: cat: cache.json: No

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

試著忘記壹切 提交于 2019-12-06 15:58:26
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 path, so people came up with various solutions. Then it became possible and there are a few solutions

Docker caching of .m2 doesn't work locally

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 12:07:06
问题 Consider this of .gitlab-ci.yml : variables: MAVEN_OPTS: "-Dmaven.repo.local=/root/.m2/repository" cache: key: "M2" paths: - /root/.m2/repository This works correctly when running directly in gitlab, but it doesn't work locally when running as: gitlab-runner exec docker test If I run it locally like this, I can see messages like Successfully extracted cache , but then it re-downloads all the maven dependencies, which in my case meaning downloading hundreds of megabytes. I cannot see the

Gitlab Ci unable to push on a branch from runner

社会主义新天地 提交于 2019-12-06 11:53:39
I'm trying to settup a CI/CD pipelines with Gitlab Here is what I would like to do : NOTE: It's a typescript project unit tests && integration tests promote branch dev to branch integration Build docker image from branch integration deploy to integration env Here is the .gitlab-ci.yml I am using (i: stages: - test - promote - build - deploy cache: paths: - node_modules/ test: image: node stage: test before_script: - yarn script: - yarn test promote: image: node stage: promote only: - dev script: - git push origin HEAD:integration build image: node stage: build only: - integration script: -

Automating pushing parts of a git repo to google cloud bucket

不羁的心 提交于 2019-12-06 07:23:52
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 or how I can put those as a secret into Gitlab to use to trigger a push to a remote git repo. This

GitLab CI ssh registry login

白昼怎懂夜的黑 提交于 2019-12-06 06:48:23
问题 I have a GitLab project gitlab.com/my-group/my-project which has a CI pipeline that builds an image and pushes it to the project's GitLab registry registry.gitlab.com/my-group/my-project:tag . I want to deploy this image to Google Compute Engine, where I have a VM running docker. Easy enough to do it manually by ssh'ing into the VM, then docker login registry.gitlab.com and docker run ... registry.gitlab.com/my-group/my-project:tag . Except the docker login command is interactive, which is a