我在我的MAC主机上的Docker容器中运行了Gitlab。我还按照here的说明通过Homebrew安装了一个Gitlab运行程序。在Gitlab上,我已经配置了跑步者,它处于活动状态。
.gitlab-ci.yml中的以下Gitlab配置:
image:
name: hashicorp/terraform:light
entrypoint:
- '/usr/bin/env'
- 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/go/bin'
before_script:
- rm -rf .terraform
- terraform --version
- export AWS_ACCESS_KEY
- export AWS_SECRET_KEY
- terraform init
stages:
- validate
- plan
- apply
validate:
stage: validate
tags:
- test
script:
- terraform validate
only:
- tags
plan:
stage: plan
tags:
- test
script:
- terraform plan -out "planfile"
dependencies:
- validate
artifacts:
paths:
- planfile
only:
- tags
apply:
stage: apply
tags:
- test
script:
- terraform apply -input=false "planfile"
dependencies:
- plan
only:
- tags
when: manual
我一直无法运行管道,实际上是在“最后一次联系”中,它提到Gitlab永远无法联系服务器。有任何疑难解答的想法吗?