JX 引导在步骤上失败:无法在目录"工作区\源"中运行'/bin/sh -c jx step git validate'命令,输出:



我有一个运行在Azure Kubernetes Service上的现有Kubernete集群,我正试图使用Jenkins X cli将Jenkins X安装到该集群中。我的操作系统是WIndows 10。

我已经在jenkins-x-boot-config目录中克隆并执行了命令jx boot。这是输出:

Attempting to resolve version for boot config https://github.com/jenkins-x/jenkins-x-boot-config from https://github.com/jenkins-x/jenkins-x-versions.git
Current HEAD HEAD in . is not an ancestor of v1.0.81, the boot config version from the version stream.
Proceeding with current HEAD.
Booting Jenkins X
WARNING: failed to load ConfigMap jenkins-x-docker-registry in namespace jx: failed to get configmap jenkins-x-docker-registry in namespace jx, configmaps "jenkins-x-docker-registry" not found
WARNING: failed to load ConfigMap jenkins-x-docker-registry in namespace jx: failed to get configmap jenkins-x-docker-registry in namespace jx, configmaps "jenkins-x-docker-registry" not found
STEP: validate-git command: /bin/sh -c jx step git validate in dir: C:Usersdrioux.guidryDocumentsjenkins-x-boot-configworkspacesource
error: failed to interpret pipeline file jenkins-x.yml: failed to run '/bin/sh -c jx step git validate' command in directory 'workspacesource', output: ''

在bash和Windows命令提示符中运行jx boot时,我收到了同样的错误。奇怪的是,我能够成功地手动执行失败的命令,尽管我必须用引号括住参数(尽管,我尝试在jenkins-x.yml文件中用引号括起参数,但我仍然收到上面显示的相同错误(:

$ /bin/sh -c "jx step git validate"
WARNING
Traditional Jenkins masters are being deprecated and removed from all new Jenkins X releases starting on April 20, 2020.
We strongly recommend using the default Tekton-based configuration instead for all Jenkins X activity going forward. We do not recommend using the Jenkins X workflow based around Jenkins masters.
For more information: https://jenkins-x.io/blog/2020/03/11/tekton/
Git configured for user: Dr** **** and email dr*****@******.com

我安装了jxcli。以下是运行命令jx version:的输出

NAME               VERSION
jx                 2.0.1215
Kubernetes cluster v1.14.8
kubectl            v1.15.2
helm client        v2.16.1+gbbdfe5e
helm server        v2.16.1+gbbdfe5e
git                2.25.1.windows.1
Operating System   Windows 10 Enterprise 1903 build 18362

verifying packages
WARNING: jx version 2.0.1263 is available in the version stream. You are using 2.0.1215. We highly recommend you upgrade to it.

这是我的jenkins-x-boot-config/jenkins-x.yml

buildPack: none
pipelineConfig:
pipelines:
pullRequest:
pipeline:
agent:
image: gcr.io/jenkinsxio/builder-go
stages:
- name: pr-checks
options:
containerOptions:
name: ""
resources: {}
volumeMounts:
- mountPath: /builder/home/.jx/localSecrets/currentCluster
name: local-secrets
readOnly: true
volumes:
- name: local-secrets
secret:
optional: true
secretName: local-param-secrets
steps:
- args:
- step
- verify
- values
- --values-file=parameters.yaml
- --schema-file=parameters.tmpl.schema.json
command: jx
dir: /workspace/source/env
name: verify-parameters
- args:
- build
command: make
dir: /workspace/source/env
name: lint-env-helm
release:
pipeline:
agent:
image: gcr.io/jenkinsxio/builder-go
environment:
- name: DEPLOY_NAMESPACE
value: jx
stages:
- name: release
options:
containerOptions:
name: ""
resources: {}
volumeMounts:
- mountPath: /builder/home/.jx/localSecrets/currentCluster
name: local-secrets
readOnly: true
volumes:
- name: local-secrets
secret:
optional: true
secretName: local-param-secrets
steps:
- args:
- step
- git
- validate
command: jx
dir: .
name: validate-git
- args:
- step
- verify
- preinstall
- --provider-values-dir="kubeProviders"
command: jx
dir: /env
name: verify-preinstall
- args:
- upgrade
- crd
command: jx
name: install-jx-crds
- args:
- step
- helm
- apply
- --boot
- --remote
- --no-vault
- --name
- velero
command: jx
dir: /workspace/source/systems/velero
env:
- name: DEPLOY_NAMESPACE
value: velero
name: install-velero
- args:
- step
- helm
- apply
- --boot
- --remote
- --no-vault
- --name
- velero-backups
command: jx
dir: /workspace/source/systems/velero-backups
env:
- name: DEPLOY_NAMESPACE
value: velero
name: install-velero-backups
- args:
- step
- helm
- apply
- --boot
- --remote
- --no-vault
- --name
- jxing
command: jx
dir: /workspace/source/systems/jxing
env:
- name: DEPLOY_NAMESPACE
value: kube-system
name: install-nginx-controller
- args:
- step
- create
- install
- values
- -b
command: jx
dir: /workspace/source/env
name: create-install-values
- args:
- step
- helm
- apply
- --boot
- --remote
- --no-vault
- --name
- exdns
command: jx
dir: /workspace/source/systems/external-dns
name: install-external-dns
- args:
- apply
- --wait
- --validate=false
- -f
- https://raw.githubusercontent.com/jetstack/cert-manager/release-0.11/deploy/manifests/00-crds.yaml
command: kubectl
dir: /workspace/source
env:
- name: DEPLOY_NAMESPACE
value: cert-manager
name: install-cert-manager-crds
- args:
- step
- helm
- apply
- --boot
- --remote
- --no-vault
- --name
- cm
command: jx
dir: /workspace/source/systems/cm
env:
- name: DEPLOY_NAMESPACE
value: cert-manager
name: install-cert-manager
- args:
- step
- helm
- apply
- --boot
- --remote
- --no-vault
- --name
- acme
command: jx
dir: /workspace/source/systems/acme
name: install-acme-issuer-and-certificate
- args:
- step
- boot
- vault
- --provider-values-dir
- ../../kubeProviders
command: jx
dir: /workspace/source/systems/vault
name: install-vault
- args:
- step
- create
- values
- --name
- parameters
command: jx
dir: /workspace/source/env
name: create-helm-values
- args:
- step
- create
- templated
- --parameters-file=../../env/parameters.yaml
- --requirements-dir=../../
- --template-file=jx-auth-configmap.tmpl.yaml
- --config-file=templates/jx-auth-configmap.yaml
command: jx
dir: /workspace/source/systems/jx-auth
name: create-jx-auth-config
- args:
- step
- helm
- apply
- --boot
- --remote
- --no-vault
- --name
- jx-auth
command: jx
dir: /workspace/source/systems/jx-auth
name: install-jx-auth-config
- args:
- step
- helm
- apply
- --boot
- --remote
- --name
- jenkins-x
- --provider-values-dir
- ../kubeProviders
command: jx
dir: /workspace/source/env
name: install-jenkins-x
- args:
- step
- verify
- env
command: jx
dir: /workspace/source
name: verify-jenkins-x-environment
- args:
- step
- helm
- apply
- --boot
- --name
- repos
command: jx
dir: /workspace/source/repositories
name: install-repositories
- args:
- step
- scheduler
- config
- apply
- --direct=true
command: jx
dir: /workspace/source/prowConfig
name: install-pipelines
- args:
- update
- webhooks
- --verbose
- --warn-on-fail
command: jx
dir: /workspace/source/repositories
name: update-webhooks
- args:
- step
- verify
- install
- --pod-wait-time
- 30m
command: jx
dir: /workspace/source/env
name: verify-installation

如果我应该提供任何其他细节来帮助解决这个问题,请告诉我。

尝试在v1.16.7版本的AKS中创建一个新的Kubernetes集群后,我仍然收到了同样的错误。此外,使用命令jx create cluster gke --skip-installation在Google Cloud Platform中创建集群,然后运行jx boot会导致与此堆栈溢出问题中共享的错误相同的错误。

我在Stack Overflow上提出了另一个问题;stackoverflow.com/questions/6106267/…";,有人建议使用Windows Linux子系统,事实证明,它可以成功地将Jenkins X安装到我的GKE集群中,而无需遵循堆栈溢出问题中定义的任何步骤。以下是我使用的设置WSL的链接:learn.microsoft.com/en-us/windows/WSL/install-win10

最新更新