国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

【CI/CD】Rancher CD過(guò)程--20230906

這篇具有很好參考價(jià)值的文章主要介紹了【CI/CD】Rancher CD過(guò)程--20230906。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

gitlab設(shè)定CICD的變量

【CI/CD】Rancher CD過(guò)程--20230906,CICD,Git/GitLab/GitHub,ci/cd,rancher,kubernetes

  1. HARBOR_PASSWORD:密碼
  2. HARBOR_USER:工號(hào)
  3. K8S_TOKEN:Bearer + rancher key
    【CI/CD】Rancher CD過(guò)程--20230906,CICD,Git/GitLab/GitHub,ci/cd,rancher,kubernetes
  4. K8S_WORKLOAD_URL:選擇【View in API】的URL,并非workload的URL。
    如果是新版rancher,則使用/g回去舊版界面。
    【CI/CD】Rancher CD過(guò)程--20230906,CICD,Git/GitLab/GitHub,ci/cd,rancher,kubernetes
    【CI/CD】Rancher CD過(guò)程--20230906,CICD,Git/GitLab/GitHub,ci/cd,rancher,kubernetes

準(zhǔn)備json.txt方法1(W公司SOP,但是可能失效)

  1. 選擇workload,進(jìn)入【View in API】
    【CI/CD】Rancher CD過(guò)程--20230906,CICD,Git/GitLab/GitHub,ci/cd,rancher,kubernetes

  2. right panel >> click edit
    【CI/CD】Rancher CD過(guò)程--20230906,CICD,Git/GitLab/GitHub,ci/cd,rancher,kubernetes

  3. Move to buttom , and click “Show Request”
    【CI/CD】Rancher CD過(guò)程--20230906,CICD,Git/GitLab/GitHub,ci/cd,rancher,kubernetes

  4. Copy the highlight area from “-d” parameter content
    【CI/CD】Rancher CD過(guò)程--20230906,CICD,Git/GitLab/GitHub,ci/cd,rancher,kubernetes

  5. Create json.txt file and paste the content
    【CI/CD】Rancher CD過(guò)程--20230906,CICD,Git/GitLab/GitHub,ci/cd,rancher,kubernetes

  6. 記得修改image tag和 “cattle.io/timestamp”: “CHANGEME”。

{
    "actions": {
        "pause": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-django?action=pause",
        "redeploy": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-django?action=redeploy",
        "resume": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-django?action=resume",
        "rollback": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-django?action=rollback"
    },
    "annotations": {
        "cattle.io/timestamp": "CHANGEME"
    },
    "baseType": "workload",
    "containers": [
        {
            "allowPrivilegeEscalation": false,
            "image": "harbor-k8s.wzs.wistron.com.cn/season/training_platform_django:0.0.8-build36",
            "imagePullPolicy": "IfNotPresent",
            "initContainer": false,
            "name": "training-platform-django",
            "ports": [
                {
                    "containerPort": 8000,
                    "dnsName": "training-platform-django-nodeport",
                    "hostPort": 0,
                    "kind": "NodePort",
                    "name": "8000tcl",
                    "protocol": "TCP",
                    "sourcePort": 0,
                    "type": "/v3/project/schemas/containerPort"
                }
            ],
            "privileged": false,
            "readOnly": false,
            "resources": {
                "limits": {
                    "cpu": "1",
                    "memory": "1000Mi"
                },
                "requests": {
                    "cpu": "1",
                    "memory": "1000Mi"
                },
                "type": "/v3/project/schemas/resourceRequirements"
            },
            "restartCount": 0,
            "runAsNonRoot": false,
            "stdin": true,
            "stdinOnce": false,
            "terminationMessagePath": "/dev/termination-log",
            "terminationMessagePolicy": "File",
            "tty": true,
            "type": "/v3/project/schemas/container"
        }
    ],
    "created": "2023-06-27T13:13:37Z",
    "createdTS": 1687871617000,
    "creatorId": null,
    "deploymentConfig": {
        "maxSurge": 1,
        "maxUnavailable": 0,
        "minReadySeconds": 0,
        "progressDeadlineSeconds": 600,
        "revisionHistoryLimit": 10,
        "strategy": "RollingUpdate"
    },
    "deploymentStatus": {
        "availableReplicas": 1,
        "conditions": [
            {
                "lastTransitionTime": "2023-06-27T13:13:37Z",
                "lastTransitionTimeTS": 1687871617000,
                "lastUpdateTime": "2023-08-24T05:46:46Z",
                "lastUpdateTimeTS": 1692856006000,
                "message": "ReplicaSet \"training-platform-django-5dc8b9dc9c\" has successfully progressed.",
                "reason": "NewReplicaSetAvailable",
                "status": "True",
                "type": "Progressing"
            },
            {
                "lastTransitionTime": "2023-09-05T09:48:01Z",
                "lastTransitionTimeTS": 1693907281000,
                "lastUpdateTime": "2023-09-05T09:48:01Z",
                "lastUpdateTimeTS": 1693907281000,
                "message": "Deployment has minimum availability.",
                "reason": "MinimumReplicasAvailable",
                "status": "True",
                "type": "Available"
            }
        ],
        "observedGeneration": 67,
        "readyReplicas": 1,
        "replicas": 1,
        "type": "/v3/project/schemas/deploymentStatus",
        "unavailableReplicas": 0,
        "updatedReplicas": 1
    },
    "dnsConfig": {
        "type": "/v3/project/schemas/podDNSConfig"
    },
    "dnsPolicy": "ClusterFirst",
    "hostIPC": false,
    "hostNetwork": false,
    "hostPID": false,
    "id": "deployment:season:training-platform-django",
    "labels": {
        "workload.user.cattle.io/workloadselector": "deployment-season-training-platform-django"
    },
    "links": {
        "remove": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-django",
        "revisions": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-django/revisions",
        "self": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-django",
        "update": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-django",
        "yaml": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-django/yaml"
    },
    "name": "training-platform-django",
    "namespaceId": "season",
    "paused": false,
    "projectId": "local:p-vhqv2",
    "publicEndpoints": [
        {
            "addresses": [
                "10.41.241.111",
                "10.41.241.112",
                "10.41.241.113",
                "10.41.241.114",
                "10.41.241.115",
                "10.41.241.116"
            ],
            "allNodes": false,
            "hostname": "training-platform-django.k8sprd-wzs.k8s.wistron.com.cn",
            "ingressId": "season:training-platform-django-ingress",
            "nodeId": null,
            "podId": null,
            "port": 80,
            "protocol": "HTTP",
            "serviceId": "season:ingress-053ebdc075a82cf5efbe1ac16b822ab4"
        },
        {
            "addresses": [
                "10.41.241.111"
            ],
            "allNodes": true,
            "ingressId": null,
            "nodeId": null,
            "podId": null,
            "port": 30481,
            "protocol": "TCP",
            "serviceId": "season:training-platform-django-nodeport"
        }
    ],
    "restartPolicy": "Always",
    "scale": 1,
    "scheduling": {
        "scheduler": "default-scheduler"
    },
    "selector": {
        "matchLabels": {
            "workload.user.cattle.io/workloadselector": "deployment-season-training-platform-django"
        },
        "type": "/v3/project/schemas/labelSelector"
    },
    "state": "active",
    "terminationGracePeriodSeconds": 30,
    "transitioning": "no",
    "transitioningMessage": "",
    "type": "deployment",
    "uuid": "ab30eb79-f594-4de1-a615-b042b011b02f",
    "workloadAnnotations": {
        "deployment.kubernetes.io/revision": "12",
        "field.cattle.io/creatorId": "u-mp27e6gufb"
    },
    "workloadLabels": {
        "cattle.io/creator": "norman",
        "workload.user.cattle.io/workloadselector": "deployment-season-training-platform-django"
    }
}

準(zhǔn)備json.txt方法2(Vincent Wen方法)

1.獲取token
【CI/CD】Rancher CD過(guò)程--20230906,CICD,Git/GitLab/GitHub,ci/cd,rancher,kubernetes

輸入curl -H "Authorization: Bearer token-jgch5:wvcrwwpglhk5jxz2fxt2h2jwmd2f7znjbjmzg5gwg4pnrc2qp5h5r9" -H "Content-Type:application/json" -X GET https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-vue-dist

相當(dāng)于是 curl -H "Authorization:${K8S_TOKEN}" -H "Content-Type:application/json" -X GET ${K8S_WORKLOAD_URL}
【CI/CD】Rancher CD過(guò)程--20230906,CICD,Git/GitLab/GitHub,ci/cd,rancher,kubernetes
2. 復(fù)制并寫(xiě)入json.txt中。

{
	"actions": {
		"pause": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-vue-dist?action=pause",
		"redeploy": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-vue-dist?action=redeploy",
		"resume": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-vue-dist?action=resume",
		"rollback": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-vue-dist?action=rollback"
	},
	"annotations": {
		"cattle.io/timestamp": "1693990188"
	},
	"baseType": "workload",
	"containers": [{
		"allowPrivilegeEscalation": false,
		"image": "harbor-k8s.wzs.wistron.com.cn/season/training_platform_vue_dist:0.0.0-build30",
		"imagePullPolicy": "IfNotPresent",
		"initContainer": false,
		"name": "training-platform-vue-dist",
		"ports": [{
			"containerPort": 8080,
			"dnsName": "training-platform-vue-dist-nodeport",
			"hostPort": 0,
			"kind": "NodePort",
			"name": "8080tcl",
			"protocol": "TCP",
			"sourcePort": 0,
			"type": "/v3/project/schemas/containerPort"
		}],
		"privileged": false,
		"readOnly": false,
		"resources": {
			"limits": {
				"cpu": "300m",
				"memory": "300Mi"
			},
			"type": "/v3/project/schemas/resourceRequirements"
		},
		"restartCount": 0,
		"runAsNonRoot": false,
		"stdin": true,
		"stdinOnce": false,
		"terminationMessagePath": "/dev/termination-log",
		"terminationMessagePolicy": "File",
		"tty": true,
		"type": "/v3/project/schemas/container"
	}],
	"created": "2023-06-27T14:18:09Z",
	"createdTS": 1687875489000,
	"creatorId": null,
	"deploymentConfig": {
		"maxSurge": 1,
		"maxUnavailable": 0,
		"minReadySeconds": 0,
		"progressDeadlineSeconds": 600,
		"revisionHistoryLimit": 10,
		"strategy": "RollingUpdate"
	},
	"deploymentStatus": {
		"availableReplicas": 1,
		"conditions": [{
			"lastTransitionTime": "2023-09-07T02:04:59Z",
			"lastTransitionTimeTS": 1694052299000,
			"lastUpdateTime": "2023-09-07T02:04:59Z",
			"lastUpdateTimeTS": 1694052299000,
			"message": "ReplicaSet \"training-platform-vue-dist-7db7c6498f\" has successfully progressed.",
			"reason": "NewReplicaSetAvailable",
			"status": "True",
			"type": "Progressing"
		}, {
			"lastTransitionTime": "2023-09-07T02:05:23Z",
			"lastTransitionTimeTS": 1694052323000,
			"lastUpdateTime": "2023-09-07T02:05:23Z",
			"lastUpdateTimeTS": 1694052323000,
			"message": "Deployment has minimum availability.",
			"reason": "MinimumReplicasAvailable",
			"status": "True",
			"type": "Available"
		}],
		"observedGeneration": 74,
		"readyReplicas": 1,
		"replicas": 1,
		"type": "/v3/project/schemas/deploymentStatus",
		"unavailableReplicas": 0,
		"updatedReplicas": 1
	},
	"dnsPolicy": "ClusterFirst",
	"hostIPC": false,
	"hostNetwork": false,
	"hostPID": false,
	"id": "deployment:season:training-platform-vue-dist",
	"labels": {
		"workload.user.cattle.io/workloadselector": "deployment-season-training-platform-vue-dist"
	},
	"links": {
		"remove": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-vue-dist",
		"revisions": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-vue-dist/revisions",
		"self": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-vue-dist",
		"update": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-vue-dist",
		"yaml": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-vue-dist/yaml"
	},
	"name": "training-platform-vue-dist",
	"namespaceId": "season",
	"paused": false,
	"projectId": "local:p-vhqv2",
	"publicEndpoints": [{
		"addresses": ["10.41.241.111", "10.41.241.112", "10.41.241.113", "10.41.241.114", "10.41.241.115", "10.41.241.116"],
		"allNodes": false,
		"hostname": "training-platform.k8sprd-wzs.k8s.wistron.com.cn",
		"ingressId": "season:training-platform-vue-dist-ingress",
		"nodeId": null,
		"podId": null,
		"port": 80,
		"protocol": "HTTP",
		"serviceId": "season:ingress-9932efa3ab00c77c4cfb44b758c758b2"
	}, {
		"addresses": ["10.41.241.111"],
		"allNodes": true,
		"ingressId": null,
		"nodeId": null,
		"podId": null,
		"port": 30396,
		"protocol": "TCP",
		"serviceId": "season:training-platform-vue-dist-nodeport"
	}],
	"restartPolicy": "Always",
	"scale": 1,
	"scheduling": {
		"scheduler": "default-scheduler"
	},
	"selector": {
		"matchLabels": {
			"workload.user.cattle.io/workloadselector": "deployment-season-training-platform-vue-dist"
		},
		"type": "/v3/project/schemas/labelSelector"
	},
	"state": "active",
	"terminationGracePeriodSeconds": 30,
	"transitioning": "no",
	"transitioningMessage": "",
	"type": "deployment",
	"uuid": "d63402fa-b097-4f01-9a6e-1db4e2b87912",
	"workloadAnnotations": {
		"deployment.kubernetes.io/revision": "21",
		"field.cattle.io/creatorId": "u-mp27e6gufb"
	},
	"workloadLabels": {
		"cattle.io/creator": "norman",
		"workload.user.cattle.io/workloadselector": "deployment-season-training-platform-vue-dist"
	}
}
  1. 記得修改json.txt中image tag和 “cattle.io/timestamp”: “CHANGEME”。
{
	"actions": {
		"pause": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-vue-dist?action=pause",
		"redeploy": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-vue-dist?action=redeploy",
		"resume": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-vue-dist?action=resume",
		"rollback": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-vue-dist?action=rollback"
	},
	"annotations": {
		"cattle.io/timestamp": "CHANGEME"
	},
	"baseType": "workload",
	"containers": [{
		"allowPrivilegeEscalation": false,
		"image": "harbor-k8s.wzs.wistron.com.cn/season/training_platform_vue_dist:0.0.0-buildCI_PIPELINE_IID", #(image需要修訂版本號(hào))
		"imagePullPolicy": "IfNotPresent",
		"initContainer": false,
		"name": "training-platform-vue-dist",
		"ports": [{
			"containerPort": 8080,
			"dnsName": "training-platform-vue-dist-nodeport",
			"hostPort": 0,
			"kind": "NodePort",
			"name": "8080tcl",
			"protocol": "TCP",
			"sourcePort": 0,
			"type": "/v3/project/schemas/containerPort"
		}],
		"privileged": false,
		"readOnly": false,
		"resources": {
			"limits": {
				"cpu": "300m",
				"memory": "300Mi"
			},
			"type": "/v3/project/schemas/resourceRequirements"
		},
		"restartCount": 0,
		"runAsNonRoot": false,
		"stdin": true,
		"stdinOnce": false,
		"terminationMessagePath": "/dev/termination-log",
		"terminationMessagePolicy": "File",
		"tty": true,
		"type": "/v3/project/schemas/container"
	}],
	"created": "2023-06-27T14:18:09Z",
	"createdTS": 1687875489000,
	"creatorId": null,
	"deploymentConfig": {
		"maxSurge": 1,
		"maxUnavailable": 0,
		"minReadySeconds": 0,
		"progressDeadlineSeconds": 600,
		"revisionHistoryLimit": 10,
		"strategy": "RollingUpdate"
	},
	"deploymentStatus": {
		"availableReplicas": 1,
		"conditions": [{
			"lastTransitionTime": "2023-09-07T02:04:59Z",
			"lastTransitionTimeTS": 1694052299000,
			"lastUpdateTime": "2023-09-07T02:04:59Z",
			"lastUpdateTimeTS": 1694052299000,
			"message": "ReplicaSet \"training-platform-vue-dist-7db7c6498f\" has successfully progressed.",
			"reason": "NewReplicaSetAvailable",
			"status": "True",
			"type": "Progressing"
		}, {
			"lastTransitionTime": "2023-09-07T02:05:23Z",
			"lastTransitionTimeTS": 1694052323000,
			"lastUpdateTime": "2023-09-07T02:05:23Z",
			"lastUpdateTimeTS": 1694052323000,
			"message": "Deployment has minimum availability.",
			"reason": "MinimumReplicasAvailable",
			"status": "True",
			"type": "Available"
		}],
		"observedGeneration": 74,
		"readyReplicas": 1,
		"replicas": 1,
		"type": "/v3/project/schemas/deploymentStatus",
		"unavailableReplicas": 0,
		"updatedReplicas": 1
	},
	"dnsPolicy": "ClusterFirst",
	"hostIPC": false,
	"hostNetwork": false,
	"hostPID": false,
	"id": "deployment:season:training-platform-vue-dist",
	"labels": {
		"workload.user.cattle.io/workloadselector": "deployment-season-training-platform-vue-dist"
	},
	"links": {
		"remove": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-vue-dist",
		"revisions": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-vue-dist/revisions",
		"self": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-vue-dist",
		"update": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-vue-dist",
		"yaml": "https://rancher-wzsarm.wistron.com/v3/project/local:p-vhqv2/workloads/deployment:season:training-platform-vue-dist/yaml"
	},
	"name": "training-platform-vue-dist",
	"namespaceId": "season",
	"paused": false,
	"projectId": "local:p-vhqv2",
	"publicEndpoints": [{
		"addresses": ["10.41.241.111", "10.41.241.112", "10.41.241.113", "10.41.241.114", "10.41.241.115", "10.41.241.116"],
		"allNodes": false,
		"hostname": "training-platform.k8sprd-wzs.k8s.wistron.com.cn",
		"ingressId": "season:training-platform-vue-dist-ingress",
		"nodeId": null,
		"podId": null,
		"port": 80,
		"protocol": "HTTP",
		"serviceId": "season:ingress-9932efa3ab00c77c4cfb44b758c758b2"
	}, {
		"addresses": ["10.41.241.111"],
		"allNodes": true,
		"ingressId": null,
		"nodeId": null,
		"podId": null,
		"port": 30396,
		"protocol": "TCP",
		"serviceId": "season:training-platform-vue-dist-nodeport"
	}],
	"restartPolicy": "Always",
	"scale": 1,
	"scheduling": {
		"scheduler": "default-scheduler"
	},
	"selector": {
		"matchLabels": {
			"workload.user.cattle.io/workloadselector": "deployment-season-training-platform-vue-dist"
		},
		"type": "/v3/project/schemas/labelSelector"
	},
	"state": "active",
	"terminationGracePeriodSeconds": 30,
	"transitioning": "no",
	"transitioningMessage": "",
	"type": "deployment",
	"uuid": "d63402fa-b097-4f01-9a6e-1db4e2b87912",
	"workloadAnnotations": {
		"deployment.kubernetes.io/revision": "21",
		"field.cattle.io/creatorId": "u-mp27e6gufb"
	},
	"workloadLabels": {
		"cattle.io/creator": "norman",
		"workload.user.cattle.io/workloadselector": "deployment-season-training-platform-vue-dist"
	}
}

修改.gitlab-ci.yml

format

update:
  stage: deploy
  image: harbor.wistron.com/base_image/alpine:3.10
  before_script:
    - apk add curl
    - export CI_JOB_TIMESTAMP=$(date +"%s")
  tags:
    - prd-runner02  # select your runner
  script:
    - MOVE TO YOUR JSON.TXT PATH
    - sed -i s/CHANGEME/$CI_JOB_TIMESTAMP/g json.txt
    - sed -i s/CI_PIPELINE_IID/$CI_PIPELINE_IID/g json.txt
    - curl -H "Authorization:${K8S_TOKEN}" -H "Content-Type:application/json" -d "@json.txt" -X PUT ${K8S_WORKLOAD_URL}

我的代碼.gitlab-ci.yml

variables:
  DOCKER_IMAGE_NAME: training_platform_django
  DOCKER_IMAGE_TAG: 0.0.8

 
  
services:
  - name: harbor-k8s.wzs.wistron.com.cn/base_image/docker:stable
    entrypoint: []
    command: ["--insecure-registry=harbor-k8s.wistron.com.cn"]

stages:
  - docker_build
  - docker-update

docker-build:
  image: harbor-k8s.wzs.wistron.com.cn/base_image/docker:stable
  stage: docker_build
  tags: 
    - wzs-runner01
  script:
    - docker info
    - echo $DOCKER_IMAGE_NAME
    - echo $DOCKER_IMAGE_TAG
    - docker build -t $DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG .
    - docker tag $DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG harbor-k8s.wzs.wistron.com.cn/season/$DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG-build$CI_PIPELINE_IID
    - echo "$HARBOR_PASSWORD" | docker login -u "$HARBOR_USER"  --password "$HARBOR_PASSWORD" harbor-k8s.wzs.wistron.com.cn
    - docker push harbor-k8s.wzs.wistron.com.cn/season/$DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG-build$CI_PIPELINE_IID



docker-update:
  stage: docker-update
  image: harbor.wistron.com/base_image/alpine:3.10
  before_script:
    - apk add curl
    - export CI_JOB_TIMESTAMP=$(date +"%s")
  tags:
    - wzs-runner01
  script:
    - sed -i s/CHANGEME/$CI_JOB_TIMESTAMP/g json.txt
    - sed -i s/CI_PIPELINE_IID/$CI_PIPELINE_IID/g json.txt
    - curl -H "Authorization:${K8S_TOKEN}" -H "Content-Type:application/json" -d "@json.txt" -X PUT ${K8S_WORKLOAD_URL}

gitlab pipeline

顯示成功
【CI/CD】Rancher CD過(guò)程--20230906,CICD,Git/GitLab/GitHub,ci/cd,rancher,kubernetes
自動(dòng)更新
【CI/CD】Rancher CD過(guò)程--20230906,CICD,Git/GitLab/GitHub,ci/cd,rancher,kubernetes
【CI/CD】Rancher CD過(guò)程--20230906,CICD,Git/GitLab/GitHub,ci/cd,rancher,kubernetes文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-697422.html

到了這里,關(guān)于【CI/CD】Rancher CD過(guò)程--20230906的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶(hù)投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • gitlab CI/CD 安裝 gitlab runner

    gitlab CI/CD 安裝 gitlab runner

    一、為什么需要安裝gitlab runner ? 極狐GitLab Runner 是在流水線中運(yùn)行作業(yè)的應(yīng)用,與極狐GitLab CI/CD 配合運(yùn)作。 說(shuō)白了就是你部署的一個(gè)agent。 二、如何安裝? 1.介紹通過(guò)helm部署github runner 2.helm添加倉(cāng)庫(kù) helm repo add gitlab https://charts.gitlab.io 3.拉取chars helm pull gitlab/gitlab-runner -- 拉

    2024年02月14日
    瀏覽(32)
  • Rancher2.7 + Jenkins CI/CD全流程保姆級(jí)最佳實(shí)踐

    Rancher2.7 + Jenkins CI/CD全流程保姆級(jí)最佳實(shí)踐

    CI方面,官方推薦的視頻教程等多是使用極狐Gitlab CI,但社區(qū)版極狐每月僅400分鐘構(gòu)造時(shí)間,額外購(gòu)買(mǎi)價(jià)格為1000分鐘/68元,而私有化部署極狐Gitlab對(duì)比部署使用Jenkins,具有更高的成本、更狹窄的適用面,且如果個(gè)人使用其代碼倉(cāng)庫(kù)功能,并不比Gitee可靠。 Gitee 同樣提供CI服務(wù)

    2024年02月05日
    瀏覽(29)
  • 純手工搭建 GitaLab與Gitlab-CI/CD--附 gitlab-ci.yml示例

    純手工搭建 GitaLab與Gitlab-CI/CD--附 gitlab-ci.yml示例

    作者:javastarboy 背景:前幾年(2018 年前后)的 jenkins+docker+k8s 的CI/CD 在工作之中受益不少。提升了不少工作效率。而隨著這幾年的使用發(fā)現(xiàn),目前 gitlab-CI/CD 在持續(xù)集成部署中更加方便、高效。 尤其是在測(cè)試環(huán)節(jié)中,研發(fā)無(wú)需編寫(xiě)復(fù)雜的 jenkins 腳本,只要提交代碼,即可自動(dòng)

    2023年04月08日
    瀏覽(23)
  • GitLab Runner 實(shí)現(xiàn)項(xiàng)目 CI/CD 發(fā)布

    GitLab Runner 實(shí)現(xiàn)項(xiàng)目 CI/CD 發(fā)布

    Gitlab實(shí)現(xiàn)CICD的方式有很多,比如通過(guò)Jenkins,通過(guò)Gitlab Runner等,今天主要介紹后者。Gitlab在安裝的時(shí)候,就默認(rèn)包含了Gitlab CI的能力,但是該能力只是用于協(xié)調(diào)作業(yè),并不能真的去執(zhí)行作業(yè),因此需要搭配Gitlab Runner來(lái)作為執(zhí)行器實(shí)現(xiàn)具體的CICD工作。Gitlab Runner可以被安裝在任

    2024年01月17日
    瀏覽(33)
  • DevOps系列文章之 GitLab CI/CD

    DevOps系列文章之 GitLab CI/CD

    由于目前公司使用的gitlab,大部分項(xiàng)目使用的CICD是gitlab的CICD,少部分用的是jenkins,使用了gitlab-ci一段時(shí)間后感覺(jué)還不錯(cuò),因此總結(jié)一下 介紹gitlab的CICD之前,可以先了解CICD是什么 我們的開(kāi)發(fā)模式經(jīng)歷了如下的轉(zhuǎn)變:瀑布模型-敏捷開(kāi)發(fā)→DevOps(Development、Operations的組合詞,是

    2024年01月22日
    瀏覽(62)
  • Gitlab CI/CD: rules和only

    Gitlab CI/CD: rules和only

    rules 和 only 都是在 GitLab CI/CD 配置中用于控制作業(yè)(job)何時(shí)執(zhí)行的,但它們之間有一些不同之處: only : only 用于定義在特定情況下觸發(fā)作業(yè)的條件。你可以指定一系列觸發(fā)條件,只有當(dāng)至少一個(gè)條件匹配時(shí),作業(yè)才會(huì)被觸發(fā)執(zhí)行。 only 通常用于根據(jù)分

    2024年02月03日
    瀏覽(35)
  • 使用gitlab 自帶 CI/CD 構(gòu)建部署項(xiàng)目

    使用gitlab 自帶 CI/CD 構(gòu)建部署項(xiàng)目

    這里我用的是橋接模式 橋接模式方便局域網(wǎng)內(nèi)的小伙伴一起使用 如果沒(méi)有這個(gè)打算可跳過(guò)這步 編輯網(wǎng)絡(luò) vi /etc/sysconfig/network-scripts/ifcfg-你的網(wǎng)絡(luò)名稱(chēng) 修改如下內(nèi)容 這里我有句話要講, 這些信息配置完成后出現(xiàn)\\\"網(wǎng)絡(luò)不可達(dá)\\\" 需要把 BOOTPROTO 改為 dhcp 詳情可參考 處理網(wǎng)絡(luò)不可達(dá)

    2024年02月12日
    瀏覽(27)
  • CI/CD:GitLab-CI 自動(dòng)化集成/部署 JAVA微服務(wù)的應(yīng)用合集

    CI/CD:GitLab-CI 自動(dòng)化集成/部署 JAVA微服務(wù)的應(yīng)用合集

    日常開(kāi)發(fā)中,每次代碼編寫(xiě)完成后,都需要手動(dòng)打包,并且上傳服務(wù)器,無(wú)論本地打包的時(shí)間或者上傳文件到服務(wù)器都需要花費(fèi)大量的時(shí)間來(lái)完成,都是重復(fù)的并且毫無(wú)意義,應(yīng)該將時(shí)間花費(fèi)在更有價(jià)值的時(shí)間上;所以編寫(xiě)這篇文章,將自己收集、搭建、測(cè)試的步驟或經(jīng)驗(yàn)匯

    2024年02月08日
    瀏覽(23)
  • 【基于 GitLab 的 CI/CD 實(shí)踐】03、GitLab Pipeline 實(shí)踐(上)

    【基于 GitLab 的 CI/CD 實(shí)踐】03、GitLab Pipeline 實(shí)踐(上)

    目錄 一、GitLab Pipeline 流水線語(yǔ)法有哪些?流水線參數(shù)列表 如何檢查語(yǔ)法錯(cuò)誤?流水線語(yǔ)法檢測(cè) 二、Pipeline 基礎(chǔ)語(yǔ)法 job script before_script after_script stages 未定義 stages ?定義 stages 控制 stage 運(yùn)行順序 ? .pre .post stage variables 綜合實(shí)例(一) tags allow_failure when manual 手動(dòng) delayed 延遲

    2024年02月17日
    瀏覽(31)
  • gitlab+jenkins+harbor實(shí)現(xiàn)CI/CD(2)——初級(jí)

    gitlab+jenkins+harbor實(shí)現(xiàn)CI/CD(2)——初級(jí)

    git安裝 jenkins主機(jī)上安裝docker-ce 配置倉(cāng)庫(kù)證書(shū) 測(cè)試 創(chuàng)建項(xiàng)目 創(chuàng)建一個(gè)freestyle project 在jenkins主機(jī)獲取密鑰 在gitlab上傳公鑰 在jenkins上傳私鑰 輸入測(cè)試命令后保存 點(diǎn)擊立即構(gòu)建 查看控制臺(tái)輸出 工作路徑 構(gòu)建觸發(fā)器,定時(shí)觸發(fā) 安裝插件 gitlab和 Cloudbee docker 配置gitlab 在網(wǎng)絡(luò)設(shè)

    2024年02月09日
    瀏覽(25)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包