我试图通过GKE集群使用GitLab CI来执行管道。我有使用Docker runner的经验,但GKE对我来说还是一个新手,这就是我所做的:
使用以下内容创建gitlab-ci.yml before_script: - php -v
standard:
image: falnyr/php-ci-tools:php-cs-fixer-7.0
script:
- php-cs-fixer fix --diff --dry-run --stop-on-violation -v --using-cache=no
lint:7.1:
image: falnyr/php-ci:7.1-no-xdebug
script:
- composer build
- php vendor/bin/parallel-lint --exclude vendor .
cache:
paths:
- vendor/
将提交推送到存储库
管道输出如下
Running with gitlab-runner 10.3.0 (5cf5e19a)
on runner-gitlab-runner-666dd5fd55-h5xzh (04180b2e)
Using Kubernetes namespace: gitlab-managed-apps
Using Kubernetes executor with image falnyr/php-ci:7.1-no-xdebug ...
Waiting for pod gitlab-managed-apps/runner-04180b2e-project-5-concurrent-0nmpp7 to be running, status is Pending
Running on runner-04180b2e-project-5-concurrent-0nmpp7 via runner-gitlab-runner-666dd5fd55-h5xzh...
Cloning repository...
Cloning into '/group/project'...
remote: You are not allowed to download code from this project.
fatal: unable to access 'https://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@git.domain.tld/group/project.git/': The requested URL returned error: 403
ERROR: Job failed: error executing remote command: command terminated with non-zero exit code: Error executing in Docker Container: 1
现在我认为我应该在某处添加一个带密码的gitlab-ci-token用户,不确定它是否应该像这样工作。
谢谢!
答案 0 :(得分:0)
在阅读了有关该主题的更多内容之后,似乎管道应该仅通过HTTPS(而不是SSH)执行。
我启用了HTTPS通信,当我以项目中的用户(未添加到项目中的管理员引发此错误)执行管道时,它可以正常运行。