我有下一个管道
image: maven:3-amazoncorretto-21
definitions:
services:
docker:
memory: 2048
pipelines:
branches:
'mybranch':
- step:
name: run job
deployment: test
services:
- docker
caches:
- docker
script:
- pipe: atlassian/kubectl-run:3.11.0
variables:
KUBE_CONFIG: $KUBE_CONFIG_DEV
KUBECTL_COMMAND: 'create -f path/to/configuration.yaml'
KUBECTL_ARGS:
- '-n mynamespace'
- '--validate=false'
PRE_EXECUTION_SCRIPT: 'pre-execution.sh' # Optional.
DISABLE_VALIDATION: 'true'
DEBUG: 'true'
预执行.sh文件:
#!/bin/sh
ls path/to -alh
结果是:
drwxrwxrwx 3 nobody nogroup 4.0K Nov 27 09:23 .
drwxrwxrwx 5 nobody nogroup 4.0K Nov 27 09:23 ..
-rw-rw-rw- 1 nobody nogroup 9 Nov 27 09:23 .gitignore
-rw-rw-rw- 1 nobody nogroup 3.3K Nov 27 09:23 configuration.yaml
E1127 09:24:32.367492 11 memcache.go:265] couldn't get current server API group list: unknown
error: unable to recognize "path/to/configuration.yaml": unknown
✖ kubectl create -f path/to/configuration.yaml failed.
我做错了什么?
我认为您的
path/to/
文件没有 configuration.yaml
目录结构。请检查项目中configuration.yaml
文件的正确文件路径并重新运行管道。