From fe2c643253bcbc1f865facbe0fafbbe263b7183f Mon Sep 17 00:00:00 2001 From: "zhipeng.hu" Date: Sat, 27 Nov 2021 18:06:35 +0800 Subject: [PATCH] drone pull1 --- .drone.yml | 156 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 155 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index a172098..81d07c8 100644 --- a/.drone.yml +++ b/.drone.yml @@ -34,7 +34,161 @@ steps: when: target: [ "" ] -# - name: rancher-deploy + - name: rancher-deploy + image: busybox # 直接用busybox + commands: + - curl --location --request PUT 'https://121.40.194.123:8443/v3/project/c-wh6tz:p-vwfqk/workloads/deployment:default:test-drone' \ + --header 'Authorization: Bearer token-j24z5:fwbzktwzs4kqf8p4pzsfn92thzms76vrglghh2khmdxkr6svm57796' \ + --header 'Content-Type: application/javascript' \ + --data-raw '{ + "hostIPC": false, + "hostNetwork": false, + "hostPID": false, + "paused": false, + "annotations": { + "cattle.io/timestamp": "2021-11-27T09:15:56Z" + }, + "baseType": "workload", + "containers": [ + { + "initContainer": false, + "restartCount": 0, + "stdin": true, + "stdinOnce": false, + "tty": true, + "allowPrivilegeEscalation": false, + "image": "registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone:${DRONE_BUILD_NUMBER}", + "imagePullPolicy": "Always", + "name": "test-drone", + "ports": [ + { + "containerPort": 8080, + "dnsName": "test-drone-nodeport", + "hostPort": 0, + "kind": "NodePort", + "name": "8080tcp300001", + "protocol": "TCP", + "sourcePort": 30000, + "type": "/v3/project/schemas/containerPort" + } + ], + "privileged": false, + "readOnly": false, + "resources": { + "type": "/v3/project/schemas/resourceRequirements", + "requests": { }, + "limits": { } + }, + "runAsNonRoot": false, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "type": "container", + "environmentFrom": [ ], + "capAdd": [ ], + "capDrop": [ ], + "livenessProbe": null, + "volumeMounts": [ ] + } + ], + "created": "2021-11-27T09:08:05Z", + "createdTS": 1638004085000, + "creatorId": null, + "deploymentConfig": { + "maxSurge": 1, + "maxUnavailable": 0, + "minReadySeconds": 0, + "progressDeadlineSeconds": 600, + "revisionHistoryLimit": 10, + "strategy": "RollingUpdate" + }, + "deploymentStatus": { + "availableReplicas": 1, + "conditions": [ + { + "lastTransitionTime": "2021-11-27T09:08:12Z", + "lastTransitionTimeTS": 1638004092000, + "lastUpdateTime": "2021-11-27T09:08:12Z", + "lastUpdateTimeTS": 1638004092000, + "message": "Deployment has minimum availability.", + "reason": "MinimumReplicasAvailable", + "status": "True", + "type": "Available" + }, + { + "lastTransitionTime": "2021-11-27T09:08:05Z", + "lastTransitionTimeTS": 1638004085000, + "lastUpdateTime": "2021-11-27T09:08:12Z", + "lastUpdateTimeTS": 1638004092000, + "message": "ReplicaSet \"test-drone-6d46b7f96d\" has successfully progressed.", + "reason": "NewReplicaSetAvailable", + "status": "True", + "type": "Progressing" + } + ], + "observedGeneration": 2, + "readyReplicas": 1, + "replicas": 1, + "type": "/v3/project/schemas/deploymentStatus", + "unavailableReplicas": 0, + "updatedReplicas": 1 + }, + "dnsPolicy": "ClusterFirst", + "id": "deployment:default:test-drone", + "imagePullSecrets": [ + { + "name": "aliyun-docker", + "type": "/v3/project/schemas/localObjectReference" + } + ], + "labels": { + "workload.user.cattle.io/workloadselector": "deployment-default-test-drone" + }, + "name": "test-drone", + "namespaceId": "default", + "projectId": "c-wh6tz:p-vwfqk", + "restartPolicy": "Always", + "scale": 1, + "scheduling": { + "scheduler": "default-scheduler", + "node": { } + }, + "selector": { + "matchLabels": { + "workload.user.cattle.io/workloadselector": "deployment-default-test-drone" + }, + "type": "/v3/project/schemas/labelSelector" + }, + "state": "active", + "terminationGracePeriodSeconds": 30, + "transitioning": "no", + "transitioningMessage": "", + "type": "deployment", + "uuid": "94091e03-986e-4809-9b46-12b6716b4a7f", + "workloadAnnotations": { + "deployment.kubernetes.io/revision": "1", + "field.cattle.io/creatorId": "user-7wt8c" + }, + "workloadLabels": { + "cattle.io/creator": "norman", + "workload.user.cattle.io/workloadselector": "deployment-default-test-drone" + }, + "publicEndpoints": [ + { + "addresses": [ + "172.26.40.69" + ], + "allNodes": true, + "ingressId": null, + "nodeId": null, + "podId": null, + "port": 30000, + "protocol": "TCP", + "serviceId": "default:test-drone-nodeport", + "type": "publicEndpoint" + } + ], + "volumes": [ ] + }' # # drone-rancher插件,利用此插件来启动rancher # image: pelotech/drone-rancher # settings: