我刚刚在我的开发机器(Ubuntu 17.10)上安装了Gitlab Runner进行测试.当我跑步时,我得到了:
$: sudo gitlab-runner exec docker test
Running with gitlab-ci-multi-runner dev (1.4.2)
Using Docker executor with image php:5.6 ...
ERROR: Build failed (system failure): open /var/lib/gitlab-runner/gitlab-runner-prebuilt.tar.xz: no such file or directory
FATAL: open /var/lib/gitlab-runner/gitlab-runner-prebuilt.tar.xz: no such file or directory
Run Code Online (Sandbox Code Playgroud)
.gitlab-ci.yml文件:
image: php:5.6
before_script:
- php -v
stages:
- test
test:
script:
- php -v
Run Code Online (Sandbox Code Playgroud)
目前的安装过程:
sudo apt-get install gitlab-runner
Run Code Online (Sandbox Code Playgroud)
输出:
...
Configuring gitlab-ci-multi-runner (1.4.2+dfsg-1) ...
I: generating GitLab Runner Docker image. This may take a while...
E: No …Run Code Online (Sandbox Code Playgroud) 我刚刚安装了Gitlab作为我的项目的存储库,我想利用他们的Gitlab CI系统.我希望在每次提交后自动生成分发并调试Apk.我用Google搜索,但我没有找到任何教程或类似案例.如果有人能以某种方式指导我,那就太好了.
谢谢!
有3个阶段 - 构建,测试和部署.gitlab-ci.yml.
需要运行夜间回归测试阶段 - 好nightly:)
这是相关的.gitlab-ci.yml代码:
stages:
- build
- test
- deploy
build_project:
stage: build
script:
- cd ./some-dir
- build-script.sh
except:
- tags
#Run this only when say variable 'NIGHTLY_TEST == True'. But HOW?
nightly_regression_test_project:
stage: test
script:
- cd ./some-dir
- execute test-script
Run Code Online (Sandbox Code Playgroud)
每天标记到only运行test阶段是不可取的.
还有其他想法吗?
当使用GitLab CI以及它时gitlab-ci-multi-runner,我无法获得内部启动的Docker容器以将其端口暴露给"主机",这是运行构建的Docker映像.
我的.gitlab-ci.yml档案:
test:
image: docker
stage: test
services:
- docker:dind
script:
- APP_CONTAINER_ID=`docker run -d --privileged -p "9143:9143" appropriate/nc nc -l 9143`
- netstat -a
- docker exec $APP_CONTAINER_ID netstat -a
- nc -v localhost 9143
Run Code Online (Sandbox Code Playgroud)
我的命令:
gitlab-ci-multi-runner exec docker --docker-privileged test
Run Code Online (Sandbox Code Playgroud)
输出:
$ netstat -a
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 runner--project-1-concurrent-0:54664 docker:2375 TIME_WAIT
tcp 0 0 runner--project-1-concurrent-0:54666 docker:2375 TIME_WAIT
Active UNIX domain …Run Code Online (Sandbox Code Playgroud) 我创建了两个gitlab作业:
我使用以下gitlab-ci-multi-runner配置:
concurrent = 1
check_interval = 0
[[runners]]
name = "name-ci"
url = "https://uri/ci"
token = "token"
executor = "docker"
[runners.docker]
tls_verify = false
image = "docker:latest"
privileged = true
disable_cache = false
volumes = ["/cache"]
shm_size = 0
[runners.cache]
Run Code Online (Sandbox Code Playgroud)
测试单元作业正常工作但Sonar作业对以下消息失败:
service runner-f66e3b66-project-227-concurrent-0-docker-wait-for-service did timeout
2017-07-05T16:13:18.543802416Z mount: mounting none on /sys/kernel/security failed: Permission denied
2017-07-05T16:13:18.543846406Z Could not mount /sys/kernel/security.
2017-07-05T16:13:18.543855189Z AppArmor detection and --privileged mode might break.
2017-07-05T16:13:18.543861712Z mount: mounting none on /tmp failed: Permission denied
Run Code Online (Sandbox Code Playgroud)
当我将'runner.docker'的配置参数'privileged'更改为false时.声纳工作但测试单元失败: …
我是 GitLab 新手,面临一个问题:如果我在同一个 gitlab-runner 上同时触发两个管道,它们都会并行运行并导致失败。我想要的是将运行限制为一次只运行一个管道,而其他管道则在队列中运行。
我已经在 config.toml 中设置concurrent = 1并重新启动了运行器,但没有帮助。我的最终目标是防止runner上多管道运行。
谢谢。
我们有一个普通的存储库,其中包含一些代码和测试。
一项工作有“规则”声明:
rules:
- changes:
- foo/**/*
- foo_scenarios/**/*
- .gitlab-ci.yml
Run Code Online (Sandbox Code Playgroud)
问题是, 的存在会rules导致 Gitlab 运行“独立管道”,这不是我的本意,而且很烦人。有什么方法可以禁用那些“分离”的管道,但保留该rules部分?
我正在致力于向 gitlab 添加代码质量。其中一个步骤需要更改 config.toml。
我在项目存储库的根级别有 .gitlab-ci.yml。并且管道拾取此文件。
我在哪里定义 config.toml ?在根级别,或者我需要创建一个新文件夹,例如 /etc/gitlab-runner/config.toml
我想定义一个管道来编译、部署到目标和测试我的项目。
这应该以两种不同的方式发生:每次提交时增量(希望快速)构建和安排在晚上的完整构建。
以下.gitlab-ci.yml所有作业均标记为“手动”以进行测试。
stages:
- build
- deploy
- test
variables:
BUILD_ARTIFACTS_DIR: "artifacts"
build-incremental:
timeout: 5h
stage: build
script:
- echo "Building"
- ./ci/do-prep
- echo "done."
artifacts:
paths:
- $BUILD_ARTIFACTS_DIR/
variables:
BUILD_TOP_DIR: "/workspace/builds"
tags:
- yocto
when: manual
build-nightly:
timeout: 5h
stage: build
script:
- echo "Building"
- ./ci/do-prep
- echo "done."
artifacts:
paths:
- $BUILD_ARTIFACTS_DIR/
tags:
- yocto
when: manual
deploy:
stage: deploy
script:
- echo "Deploying..."
- ./ci/do-deploy
- echo "done."
tags:
- yocto
dependencies: …Run Code Online (Sandbox Code Playgroud) 我有多个工作使用单个外部资源(服务器)。第一个作业将应用程序部署到环境中,第二个作业在此环境中执行测试,第三个作业在此环境中执行集成测试。
我知道有资源组选项。但它只锁定工作。如果两个管道同时运行,我需要从第一个管道执行job1, job2,job3并且只有当第一个管道释放资源时 - 第二个管道才能启动jobs1-3。有没有办法实现这一目标?管道中还有其他工作 - 它们应该同时工作。