我想在我的 Windows 10 机器上安装一个gitlab-runner(executor shaell)。我在 gitlab 服务器上开始工作,它总是以消息结束the command "git" cannot be found(大致翻译成英文)。事实上,git这不是我的道路的一部分。如何PATH在gitlab-runner启动时修改shell 的变量?
To use git on the command line in windows I usually set it with the statement: PATH %PATH%C:\Program Files\Git\bin.
Is it documented somewhere, git has to be available to the runner?
How can I see the command line the runner invokes (i.e. the call to git)?
我有一个docker-compose.yml设置 Gitlab、Container Registry 和 Gitlab Runner 的文件。
version: '2'
services:
redis:
restart: always
image: sameersbn/redis:latest
command:
- --loglevel warning
volumes:
- redis:/var/lib/redis:Z
postgresql:
restart: always
image: sameersbn/postgresql:9.5-3
volumes:
- postgresql:/var/lib/postgresql:Z
environment:
- DB_USER=gitlab
- DB_PASS=password
- DB_NAME=gitlabhq_production
- DB_EXTENSION=pg_trgm
gitlab:
restart: always
image: sameersbn/gitlab:10.1.1
volumes:
- gitlab-data:/home/git/data:Z
- gitlab-logs:/var/log/gitlab
- ./certs:/certs
depends_on:
- redis
- postgresql
ports:
- "80:80"
- "2222:22"
external_links:
- "registry:registry"
environment:
- DEBUG=false
- DB_ADAPTER=postgresql
- DB_HOST=postgresql
- DB_PORT=5432
- DB_USER=gitlab
- DB_PASS=password
- …Run Code Online (Sandbox Code Playgroud) 我们有一个本地部署的 Gitlab 实例,当时我们无法负担一个 GitLab Runner 来运行 CI/CD 管道。
是否可以在没有 CI/CD 的情况下使用 GitLab Pages?例如,是否可以手动准备 HTML 内容,将其放在public根目录中的文件夹中并使其可访问?
我想标记一个构建,当尝试推送标签时,我在 CI 中收到以下错误
如何创建 CI 令牌并在构建环境中设置它可以将标签推送到存储库。
[01:59:14]: Exit status of command 'git push origin --tags' was 128 instead of 0.
remote: You are not allowed to upload code.
fatal: unable to access 'https://gitlab-ci-token:[MASKED]@gxx.yy.zz.git/': The requested URL returned error: 403
Run Code Online (Sandbox Code Playgroud) 我有一个本地 gitlab,我正在尝试运行一些构建/管道,但出现以下错误 -
fatal: unable to access 'https://gitlab-ci-token:[MASKED]@gitlab.systems/testing/test-project-poc.git/': Peer's certificate issuer has been marked as not trusted by the user.
Run Code Online (Sandbox Code Playgroud)
我已经研究过这个 - Gitlab:Peer's Certificate Issuer is not recognize.pem并按照通过合并 来获取文件的步骤进行操作server certificate,intermediate certificate但root certificate我仍然收到以下错误,并且确实很难找到根本原因。
/etc/gitlab/gitlab.rb config
##! enable/disable 2-way SSL client authentication
#nginx['ssl_verify_client'] = "off"
##! if ssl_verify_client on, verification depth in the client certificates chain
#nginx['ssl_verify_depth'] = "1"
nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.systems.pem"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.systems.key"
Run Code Online (Sandbox Code Playgroud)
是否还有其他配置需要更新/修改?非常感谢任何指导。
我遇到一个问题,我的 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 ×9
gitlab-ci ×6
cypress ×1
docker ×1
gitlab-pages ×1
kubernetes ×1
node-modules ×1
npm ×1