这些是我的错误信息
Running with gitlab-ci-multi-runner 1.5.3 (fb49c47)
Using Shell executor...
Running on luckyxmobiledeMac-mini-2.local...
Fetching changes...
HEAD is now at e56d7ac Update README.md
Checking out e56d7ace as master...
bash: line 4: shell_session_update: command not found
ERROR: Build failed: exit status 127
Run Code Online (Sandbox Code Playgroud)
这些是我的.gitlab-ci.yml:=的内容
stages:
- build
build_project:
stage: build
script:
- xcodebuild clean -project ProjectName.xcodeproj -scheme SchemeName | xcpretty
- xcodebuild test -project ProjectName.xcodeproj -scheme SchemeName -destination 'platform=iOS Simulator,name=iPhone 6s,OS=9.2' | xcpretty -s
tags:
- ios_9-2
- osx_10-11
我正在为多个项目设置一个gitlab运行器,我们希望能够为所有项目设置环境变量.我尝试在.bashrcfor gitlab-runner和rootusers中设置全局变量,但是在CI脚本期间它没有识别它们.声明全局环境变量的正确位置是什么?
我设置了一个Gitlab服务器,需要使用gitlab-runner.exe运行Windows测试.
gitlab-runner的执行器设置为shell,config.toml看起来像
concurrent = 1
check_interval = 0
[[runners]]
name = "PC123"
url = "http://1.2.3.4/ci"
token = "cd2b093adc5ca09ea41ee4eadb0752"
executor = "shell"
[runners.cache]
Run Code Online (Sandbox Code Playgroud)
当测试在提交时生成时,它将失败
Cloning into 'C:/git/builds/ac70aeb9/0/test/myproject'...
fatal: unable to access 'http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@localhost/test/boundaries.git/': Failed to connect to localhost port 80: Connection refused
Run Code Online (Sandbox Code Playgroud)
我想问题是URL中的主机名"localhost",它指的是gitlab-runner所在的机器.当我在开始时设置服务器时,我使用'localhost'作为服务器主机名.这可能不是最好的主意.:)
在此期间我改变了这个"localgit",但URL没有调整,它仍然显示"localhost".(服务器重启,gitlab-runner servive重启).
可能是服务器的主机名存储在主机名仍然是我克隆的原始仓库中的某个位置localhost?.git/config显示正确的IP:
[remote "origin"]
url = http://1.2.3.4/test/myproject.git
Run Code Online (Sandbox Code Playgroud)
我发现了另一个问题(GitLab运行器无法通过http克隆存储库)提到了一种将其他主机添加到gitlab-runner的方法config.toml,比如
[runners.docker]
extra_hosts = ["ci.mygitlab:127.0.0.1"]
Run Code Online (Sandbox Code Playgroud)
但我必须使用shell执行者,而不是docker.
管道完成后,是否可以使用Gitlab CI使管道缓存无效或清除?
我的.gitlab-ci.yml文件具有以下全局缓存定义
cache:
key: "%CI_PIPELINE_ID%"
paths:
- './msvc/Project1`/bin/Debug'
- './msvc/Project2`/bin/Debug'
- './msvc/Project3`/bin/Debug'
Run Code Online (Sandbox Code Playgroud)
该cache-key值指定每个管道应维护自己的缓存,这可以正常工作,但是在管道完成后,缓存文件仍然存在。随着数百个管道的运行,大小开始增加,手动删除我们计算机上的缓存文件夹并不是一个很好的解决方案。
我尝试在管道的末尾添加清理作业
cleanup:
stage: cleanup
script:
- rm -rf './msvc/Project1/bin'
- rm -rf './msvc/Project2/bin'
- rm -rf './msvc/Project3/bin'
when: always
Run Code Online (Sandbox Code Playgroud)
会删除本地文件,但不会从缓存中删除它们。
我在这里想念什么吗?
当前正在运行的Gitlab-EE 10.3.3
我们有一个本地部署的 Gitlab 实例,当时我们无法负担一个 GitLab Runner 来运行 CI/CD 管道。
是否可以在没有 CI/CD 的情况下使用 GitLab Pages?例如,是否可以手动准备 HTML 内容,将其放在public根目录中的文件夹中并使其可访问?
我遇到一个问题,我的 e2e 测试在 GitLab 中失败,但正常通过。我将问题范围缩小到了 node_modules,并且 cypress 缓存没有延续到下一个作业。这就是WARN Local package.json exists, but node_modules missing, did you mean to install出现错误的原因,因为 node_modules 不存在。
我认为缓存没有保留的原因是因为它被保存在一个运行器上,但是如果下一个作业在另一个运行器上,则缓存将不存在并且最终会失败。我可以将所有内容都放在一项工作中,但如果我要添加另一项工作进行部署,那么我仍然会遇到同样的问题。
这是我的 gitlab-ci.yml 文件:
image: cypress/base:12.18.4
variables:
NPM_REGISTRY: https://registry.npmjs.org/
npm_config_cache: $CI_PROJECT_DIR/.npm
CYPRESS_CACHE_FOLDER: $CI_PROJECT_DIR/cache/Cypress
stages:
- build
- test:unit
- test:e2e
- lint
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- cache/Cypress
- node_modules/
build:
stage: build
script:
# set the npm registry if different from the default
- npm config set registry $NPM_REGISTRY
- npm i
- npx cypress verify …Run Code Online (Sandbox Code Playgroud) 我正在尝试创建一个 kubernetes gitlab 运行程序,并且遇到了Failed to register the runner. You may be having network problems.我知道gitlab.com可以从我的主机访问的非常普遍的错误,但我需要更多信息来调试此问题的根本原因。
请注意,该错误确实会持续 30 次尝试,每次尝试与以下情况相同:
Registration attempt 8 of 30
Runtime platform arch=amd64 os=linux pid=107 revision=775dd39d version=13.8.0
WARNING: Running in user-mode.
WARNING: The user-mode requires you to manually start builds processing:
WARNING: $ gitlab-runner run
WARNING: Use sudo for system-mode:
WARNING: $ sudo gitlab-runner...
ERROR: Registering runner... failed runner=dh5qxNxL status=couldn't execute POST against https://gitlab.com/api/v4/runners: Post https://gitlab.com/api/v4/runners: EOF
PANIC: Failed to register the runner. You …Run Code Online (Sandbox Code Playgroud) AWS我已经在现场实例上自动缩放了 gitlab-runner 。而且效果很好。
我在运行作业时遇到问题。下面是我的.gitlab-ci.yml,它有两个阶段。
stages:
- build
- dev1:build
build:
stage: build
script:
- docker build --rm -t broker-connect-dev1-${CI_COMMIT_SHORT_SHA} -f BrokerConnect/Dockerfile .
only:
- dev1/release
tags:
- itela-spot-runner
build-dev1:
stage: dev1:build
script:
- docker tag broker-connect-dev1-${CI_COMMIT_SHORT_SHA}:latest 19950818/broker-connect:${DEV1_TAG}
only:
- dev1/release
tags:
- itela-spot-runner
Run Code Online (Sandbox Code Playgroud)
问题来了,因为我使用竞价实例来运行作业,有时该build阶段发生在一个竞价实例中,而该dev1:build阶段发生在另一个竞价实例中。当这种情况发生时,dev1:build它会失败,因为它无法找到图像,broker-connect-dev1-${CI_COMMIT_SHORT_SHA}因为它是在单独的 Spot 实例中构建的。在 gitlab 或 gitlab-runner 中,有没有办法控制这种行为并在同一个现场实例中运行这两个build作业dev1:build?
我已经设置了一个 docker 运行程序,我想在其中运行存储在本地存储库上的映像。我的 /etc/gitlab-runner/config.toml 是
concurrent = 1
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "Docker runner"
url = "https://gitlab.str.corp/"
token = "*secret*"
executor = "docker"
[runners.custom_build_dir]
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
[runners.cache.azure]
[runners.docker]
tls_verify = false
image = "gitlab.example.com:4443/docker:19.03.1-dind"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/certs/client", "/cache"]
shm_size = 0
Run Code Online (Sandbox Code Playgroud)
当我提交作业时,它在运行器上启动,但无法拉取图像:
Running with gitlab-runner 13.4.0 (4e1f20da)
on Docker runner abcde123
Preparing the "docker" executor
Using Docker executor with image gitlab.example.com:4443/docker:19.03.8-git …Run Code Online (Sandbox Code Playgroud) 在新的 WIN10 机器上安装带有 shell 执行器(即 powershell)的 gitlab-runner 并启动 CI 构建会引发以下错误:
Preparing environment
ERROR: Job failed (system failure): prepare environment: failed to start process: exec: "pwsh": executable file not found in %PATH%. Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information
Run Code Online (Sandbox Code Playgroud) gitlab-ci-runner ×10
gitlab ×8
gitlab-ci ×8
git ×2
cypress ×1
docker ×1
gitlab-pages ×1
kubernetes ×1
node-modules ×1
npm ×1