由于gke的新gcloud更新,我需要在此头盔映像之上使用另一张图片google cloud。
如何为这些gcloud命令添加另一个映像?因为gitlab运行程序使用不同的容器,而且我安装的gke插件没有保存到整个管道环境中
deploy:
stage: deploy
image: helm:latest
variables:
ENVIRONMENT: staging
rules:
- if: $CI_COMMIT_BRANCH == "main"
variables:
ENVIRONMENT: production
- if: $CI_COMMIT_BRANCH == "staging"
variables:
ENVIRONMENT: staging
- if: $CI_COMMIT_BRANCH == "new-google-auth"
variables:
ENVIRONMENT: staging
environment:
name: $ENVIRONMENT
dependencies:
- authenticate
script:
- helm version
- gcloud components update
- gcloud components install gke-gcloud-auth-plugin
- export USE_GKE_GCLOUD_AUTH_PLUGIN=True
- export KUBECONFIG=kube.conf
- helm upgrade $HELM_CHART_NAME ./chart --install --values=./chart/$ENVIRONMENT.yaml --namespace $KUBE_NAMESPACE
发布于 2022-07-23 14:00:41
您可以在图像中使用变量。看上去:
deploy:
stage: deploy
image: $IMAGE_NAME
variables:
ENVIRONMENT: staging
rules:
- if: $CI_COMMIT_BRANCH == "main"
variables:
ENVIRONMENT: production
IMAGE_NAME: helm:latest
- if: $CI_COMMIT_BRANCH == "staging"
variables:
ENVIRONMENT: staging
IMAGE_NAME: helm:latest
- if: $CI_COMMIT_BRANCH == "new-google-auth"
variables:
ENVIRONMENT: staging
IMAGE_NAME: your-custom-image:name
environment:
name: $ENVIRONMENT
dependencies:
- authenticate
script:
- helm version
https://stackoverflow.com/questions/73086755
复制相似问题