Deployment gitlab自动部署到kubernetes/openshift:错误:与“不匹配”:大师;

Deployment gitlab自动部署到kubernetes/openshift:错误:与“不匹配”:大师;,deployment,kubernetes,gitlab,gitlab-ci,openshift-origin,Deployment,Kubernetes,Gitlab,Gitlab Ci,Openshift Origin,我正在尝试处理kubernetes(openshift源代码)的自动部署。ci配置如下所示 据我所知,CI应该获得代码,检查dockerfile,如果它不存在(也不存在),则构建herokuish容器并将其推送到kubernetes。但我有一个错误: $ command deploy Generating kubeconfig... Cluster "gitlab-deploy" set. User "gitlab-deploy" set. Context "gitlab-deploy" set

我正在尝试处理kubernetes(openshift源代码)的自动部署。ci配置如下所示

据我所知,CI应该获得代码,检查dockerfile,如果它不存在(也不存在),则构建herokuish容器并将其推送到kubernetes。但我有一个错误:

$ command deploy
Generating kubeconfig...
Cluster "gitlab-deploy" set.
User "gitlab-deploy" set.
Context "gitlab-deploy" set.
Switched to context "gitlab-deploy".

Running on OpenShift.
Deleting old application...
No resources found

Creating application...
error: no match for ":master"
CI:


我做错了什么?是否应该在openshift中另外设置一些内容?

没有执行此处的所有步骤,我只是在中尝试了来自的命令,但它对您无效

我在我的OpenShift环境中运行了类似的命令,我猜您的环境变量
CI\u REGISTRY\u IMAGE
没有设置,所以脚本取它的空值

我跑

签出与您得到的错误类似的错误:

error: no match for ":master"
因此,请尝试导出该环境变量

oc new-app "--name=${CI_ENVIRONMENT_SLUG}" "$CI_REGISTRY_IMAGE:$CI_REGISTRY_TAG"
$ oc new-app :master
error: no match for ":master"

The 'oc new-app' command will match arguments to the following types:

  1. Images tagged into image streams in the current project or the 'openshift' project
     - if you don't specify a tag, we'll add ':latest'
  2. Images in the Docker Hub, on remote registries, or on the local Docker engine
  3. Templates in the current project or the 'openshift' project
  4. Git repository URLs or local paths that point to Git repositories

--allow-missing-images can be used to point to an image that does not exist yet.

See 'oc new-app -h' for examples.
error: no match for ":master"