NOTE: only can update image name
rancher 2.6.3 or above
steps:
- name: update-rancher
image: ystyle/drone-plugin-rancher2:2.6
when:
branch: master
event: [push]
environment:
SERVER: https://rancher.youdomain.com/k8s/clusters/c-m-w7b37mq1
TOKEN: kubeconfig-user-d71qwk98dq:d45jfxrdx672r26xmf8ltsj46dcbw2p7lf76dck3vt5nr24gzlpbk9
commands:
- /setup.sh
- kubectl set image deployment/${DRONE_REPO_NAME} ${DRONE_REPO_NAME}=registry.cn-hangzhou.aliyuncs.com/dexdev/${DRONE_REPO_NAME}:${DRONE_COMMIT_BRANCH}-${DRONE_BUILD_NUMBER}
The server and token environment are taken from the cluster - the server and token of kubectl config next to the search icon in the upper right corner