相关疑难解决方法(0)

通过CI runner将文件推送到gitlab-ci

我正在使用gitlab CI runner来测试我的代码并生成一些文件.我只是想通过CI runner将生成的文件推送到gitlab存储库.有没有办法做到这一点?

gitlab gitlab-ci gitlab-ci-runner

19
推荐指数
4
解决办法
1万
查看次数

无法从gitlab-ci.yml推送

与我的同事一起,我们致力于开发一个每天变得越来越重要的C++库.我们已经通过gitlab-ci.yml文件构建了持续集成实用程序,让我们:

  • 在调试模式下构建和测试
  • 在发布模式下构建和测试
  • 使用Valgrind执行内存泄漏等安全检查,并检查我们的库中是否有任何我们不想要的清晰符号
  • 生成文档

各种让我们选择GitLab的东西!

我们希望对整个库进行概述,并将基准推送到一个单独的项目中.我们已经使用SSH密钥方法完成了类似的文档,但是这次我们想避免这种情况.

我们尝试了这样的脚本:

test_ci_push:
  tags:
    - linux
    - shell
    - light
  stage: profiling
  allow_failure: false
  only:
    - new-benchmark-stage
  script:
    - git clone http://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.mycompany.home/developers/benchmarks.git &> /dev/null
    - cd benchmarks
    - touch test.dat
    - echo "This is a test" > test.dat
    - git config --global user.name "${GITLAB_USER_NAME}"
    - git config --global user.email "${GITLAB_USER_EMAIL}"
    - git add --all
    - git commit -m "GitLab Runner Push"
    - git push http://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.mycompany.home/developers/benchmarks.git HEAD:master
    - cd ..
Run Code Online (Sandbox Code Playgroud)

我们还尝试了一个基本 …

shell gitlab-ci gitlab-ci-runner

17
推荐指数
3
解决办法
1万
查看次数

如何在gitlab CI管道中推送到仓库?

在我的CI管道中,我正在生成一个public/graph.png可视化我的代码某些方面的工件。在以后的步骤中,我想将其从CI管道中提交给仓库。这是相关的部分.gitlab-ci.yml

commit-graph:
  stage: pages
  script:
    - git config user.email "cipipeline@example.com"
    - git config user.name "CI Pipeline"
    - cd /group/project
    - mv public/graph.png .
    - git add graph.png
    - git commit -m "committing graph.png [ci skip]"
    - echo $CI_COMMIT_REF_NAME
    - git push origin HEAD:$CI_COMMIT_REF_NAME
Run Code Online (Sandbox Code Playgroud)

当管道在gitlab中运行时,它失败并显示:

$ git config user.email“ cipipeline@dhgitlab.dunnhumby.co.uk”
$ git config user.name“ CI管道”
$ cd / group / project
$ mv public / graph.png。
$ git add graph.png
$ git commit -m“ committing graph.png [ci …

gitlab gitlab-ci

11
推荐指数
6
解决办法
3034
查看次数

标签 统计

gitlab-ci ×3

gitlab ×2

gitlab-ci-runner ×2

shell ×1