2024年2月27日发(作者:镜冬卉)
[Pipeline] checkoutusing credential 77e5313a-2e94-4f47-8d4b-17a4cf3d4a2fCloning the remote Git repositoryCloning repository 20.0.0.208/web-test/pping resolution of commit remotes/origin/master, since it originates from another repositoryChecking out Revision fc5b47ef6461a023faa52123eeaaffbdf50cb90d (refs/remotes/origin/master) > git init /home/jenkins/agent/workspace/gitlab-citest-pipeline # timeout=10Fetching upstream changes from 20.0.0.208/web-test/ > git --version # timeout=10using GIT_ASKPASS to set credentials gitlab-auth > git fetch --tags --progress 20.0.0.208/web-test/ +refs/heads/*:refs/remotes/origin/* # timeout=10 > git config 20.0.0.208/web-test/ # timeout=10 > git config --add +refs/heads/*:refs/remotes/origin/* # timeout=10 > git config 20.0.0.208/web-test/ # timeout=10Fetching upstream changes from 20.0.0.208/web-test/ng GIT_ASKPASS to set credentials gitlab-auth > git fetch --tags --progress 20.0.0.208/web-test/ +refs/heads/*:refs/remotes/origin/* # timeout=10 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 > git config checkout # timeout=10 > git checkout -f fc5b47ef6461a023faa52123eeaaffbdf50cb90d # timeout=10Commit message: "Update " > git rev-list --no-walk 56a05f7cfabb39e805104f68edf29d4a2a62a00e # timeout=10[Pipeline] sh+ pprun_[Pipeline] }[Pipeline] // stage[Pipeline] echook[Pipeline] stage[Pipeline] { (构建镜像)[Pipeline] withCredentialsMasking supported pattern matches of $username or $password[Pipeline] {[Pipeline] sh+ echo ' #tomcat web1 FROM /web-test/tomcat-base:v8.0.32
ADD /apps/tomcat/bin/ ADD /apps/tomcat/conf/ ADD myapp/* /data/tomcat/webapps/myapp/ #ADD /data/tomcat/webapps/myapp/ ADD run_ /apps/tomcat/bin/run_ ADD /etc/filebeat/
RUN chown -R /data/ /apps/ && chmod a+x /apps/tomcat/bin/*.sh
EXPOSE 8080 8443
CMD ["/apps/tomcat/bin/run_"] '+ docker build -t 20.0.0.207:443/jenkinsci/citest:27 .Sending build context to Docker daemon 138.8kBStep 1/9 : FROM /web-test/tomcat-base:v8.0.32 ---> 57a68cb49838Step 2/9 : ADD /apps/tomcat/bin/ ---> Using cache ---> 952bd7aedf45Step 3/9 : ADD /apps/tomcat/conf/ ---> Using cache ---> 514e8fd3fb0aStep 4/9 : ADD myapp/* /data/tomcat/webapps/myapp/ ---> 955e12db7ba0Step 5/9 : ADD run_ /apps/tomcat/bin/run_ ---> b602420d4ceeStep 6/9 : ADD /etc/filebeat/ ---> eb303540006cStep 7/9 : RUN chown -R /data/ /apps/ && chmod a+x /apps/tomcat/bin/*.sh ---> Running in 25733526d18cRemoving intermediate container 25733526d18c ---> e0bdc01f0e60Step 8/9 : EXPOSE 8080 8443 ---> Running in cb73eba5c8ccRemoving intermediate container cb73eba5c8cc ---> de3838fd9278Step 9/9 : CMD ["/apps/tomcat/bin/run_"] ---> Running in 1eb7e3aea8c5Removing intermediate container 1eb7e3aea8c5 ---> 6e76d78777a4Successfully built 6e76d78777a4Successfully tagged 20.0.0.207:443/jenkinsci/citest:27+ docker login -u **** -p **** 20.0.0.207:443WARNING! Using --password via the CLI is insecure. Use --G! Your password will be stored unencrypted in /root/.docker/ure a credential helper to remove this warning. See/engine/reference/commandline/login/#credentials-storeLogin Succeeded+ docker push 20.0.0.207:443/jenkinsci/citest:27The push refers to repository [20.0.0.207:443/jenkinsci/citest]16d625dc57d6: Preparingcf823686624a: Preparing234132b6269c: Preparingc5c916246c3b: Preparing0d62fdc12392: Preparing8e3632860e66: Preparingb08c99aa7244: Preparingaf6ca6732cdd: Preparing5a30b566c369: Preparing2dded0b9e69e: Preparing8979abf3f442: Preparing5660fcdf24c6: Preparinge: Preparing33cb7880c818: Preparing97275cad22f5: Preparing74aad83882e8: Preparing4826cdadf1ef: Preparing2dded0b9e69e: Waiting8979abf3f442: Waiting5660fcdf24c6: Waitinge: Waitingb08c99aa7244: Waiting33cb7880c818: Waiting97275cad22f5: Waiting
8e3632860e66: Waiting74aad83882e8: Waitingaf6ca6732cdd: Waiting5a30b566c369: Waiting0d62fdc12392: Layer already exists8e3632860e66: Layer already existsb08c99aa7244: Layer already existscf823686624a: Pushedc5c916246c3b: Pushed234132b6269c: Pushed5a30b566c369: Layer already existsaf6ca6732cdd: Layer already exists2dded0b9e69e: Layer already existse: Layer already exists33cb7880c818: Layer already exists8979abf3f442: Layer already exists5660fcdf24c6: Layer already exists97275cad22f5: Layer already exists74aad83882e8: Layer already exists4826cdadf1ef: Layer already exists16d625dc57d6: Pushed27: digest: sha256:087c08554de2af922353410f9583b2ded4c536040f2ced73fb050530e9a2ee6e size: 3879[Pipeline] }[Pipeline] // withCredentials[Pipeline] echook[Pipeline] }[Pipeline] // stage[Pipeline] stage[Pipeline] { (部署到K8s)[Pipeline] sh+ sed -i 's#$IMAGE_NAME#20.0.0.207:443/jenkinsci/citest:27#' + sed -i 's#$SECRET_NAME#k8s-harbor-login#' + sed -i 's#$NODE_PORT#33333#' [Pipeline] kubernetesDeployStarting Kubernetes deploymentLoading configuration: /home/jenkins/agent/workspace/gitlab-citest-pipeline/eated V1Deployment: class V1Deployment { apiVersion: apps/v1 kind: Deployment metadata: class V1ObjectMeta { annotations: null clusterName: null creationTimestamp: 2020-03-25T12:24:48.000Z deletionGracePeriodSeconds: null deletionTimestamp: null finalizers: null generateName: null generation: 1 initializers: null labels: {app=tomcat-app1-test} managedFields: null name: web-test-tomcat1-deployment namespace: assembly ownerReferences: null resourceVersion: 463562 selfLink: /apis/apps/v1/namespaces/assembly/deployments/web-test-tomcat1-deployment uid: 28a27040-6804-4c65-91bd-4183211e1402 } spec: class V1DeploymentSpec { minReadySeconds: null paused: null progressDeadlineSeconds: 600 replicas: 1 revisionHistoryLimit: 10 selector: class V1LabelSelector { matchExpressions: null matchLabels: {app=tomcat-app1-test} } strategy: class V1DeploymentStrategy { rollingUpdate: class V1RollingUpdateDeployment { maxSurge: 25% maxUnavailable: 25% } type: RollingUpdate } template: class V1PodTemplateSpec { metadata: class V1ObjectMeta { annotations: null clusterName: null creationTimestamp: null deletionGracePeriodSeconds: null deletionTimestamp: null finalizers: null generateName: null generation: null initializers: null labels: {app=tomcat-app1-test} managedFields: null name: null namespace: null ownerReferences: null resourceVersion: null selfLink: null uid: null } spec: class V1PodSpec { activeDeadlineSeconds: null affinity: null automountServiceAccountToken: null containers: [class V1Container { args: null command: null env: null envFrom: null image: 20.0.0.207:443/jenkinsci/citest:27 imagePullPolicy: Always lifecycle: null livenessProbe: null name: web-test-tomcat1-spec ports: [class V1ContainerPort { containerPort: 8080 hostIP: null hostPort: null name: http protocol: TCP }] readinessProbe: null resources: class V1ResourceRequirements { limits: null requests: null } securityContext: null
stdin: null stdinOnce: null terminationMessagePath: /dev/termination-log terminationMessagePolicy: File tty: null volumeDevices: null volumeMounts: null workingDir: null }] dnsConfig: null dnsPolicy: ClusterFirst enableServiceLinks: null hostAliases: null hostIPC: null hostNetwork: null hostPID: null hostname: null imagePullSecrets: [class V1LocalObjectReference { name: k8s-harbor-login }] initContainers: null nodeName: null nodeSelector: null preemptionPolicy: null priority: null priorityClassName: null readinessGates: null restartPolicy: Always runtimeClassName: null schedulerName: default-scheduler securityContext: class V1PodSecurityContext { fsGroup: null runAsGroup: null runAsNonRoot: null runAsUser: null seLinuxOptions: null supplementalGroups: null sysctls: null windowsOptions: null } serviceAccount: null serviceAccountName: null shareProcessNamespace: null subdomain: null terminationGracePeriodSeconds: 30 tolerations: null volumes: null } } } status: class V1DeploymentStatus { availableReplicas: null collisionCount: null conditions: null observedGeneration: null readyReplicas: null replicas: null unavailableReplicas: null updatedReplicas: null }}Applied V1Service: class V1Service { apiVersion: v1 kind: Service metadata: class V1ObjectMeta { annotations: null clusterName: null creationTimestamp: 2020-03-24T13:53:32.000Z deletionGracePeriodSeconds: null deletionTimestamp: null finalizers: null generateName: null generation: null initializers: null labels: {app=tomcat-app1-test} managedFields: null name: web-test-tomcat1-spec namespace: assembly ownerReferences: null resourceVersion: 422339 selfLink: /api/v1/namespaces/assembly/services/web-test-tomcat1-spec uid: 72cca44f-a4a1-4695-8b0e-212448fe1026 } spec: class V1ServiceSpec { clusterIP: 10.68.198.131 externalIPs: null externalName: null externalTrafficPolicy: Cluster healthCheckNodePort: null loadBalancerIP: null loadBalancerSourceRanges: null ports: [class V1ServicePort { name: http nodePort: 33333 port: 80 protocol: TCP targetPort: 8080 }] publishNotReadyAddresses: null selector: {app=tomcat-app1-test} sessionAffinity: None sessionAffinityConfig: null type: NodePort } status: class V1ServiceStatus { loadBalancer: class V1LoadBalancerStatus { ingress: null } }}Finished Kubernetes deployment[Pipeline] }[Pipeline] // stage[Pipeline] }[Pipeline] // node[Pipeline] }[Pipeline] // podTemplate[Pipeline] End of PipelineFinished: SUCCESS删除web-test-tomcat1 pod
2024年2月27日发(作者:镜冬卉)
[Pipeline] checkoutusing credential 77e5313a-2e94-4f47-8d4b-17a4cf3d4a2fCloning the remote Git repositoryCloning repository 20.0.0.208/web-test/pping resolution of commit remotes/origin/master, since it originates from another repositoryChecking out Revision fc5b47ef6461a023faa52123eeaaffbdf50cb90d (refs/remotes/origin/master) > git init /home/jenkins/agent/workspace/gitlab-citest-pipeline # timeout=10Fetching upstream changes from 20.0.0.208/web-test/ > git --version # timeout=10using GIT_ASKPASS to set credentials gitlab-auth > git fetch --tags --progress 20.0.0.208/web-test/ +refs/heads/*:refs/remotes/origin/* # timeout=10 > git config 20.0.0.208/web-test/ # timeout=10 > git config --add +refs/heads/*:refs/remotes/origin/* # timeout=10 > git config 20.0.0.208/web-test/ # timeout=10Fetching upstream changes from 20.0.0.208/web-test/ng GIT_ASKPASS to set credentials gitlab-auth > git fetch --tags --progress 20.0.0.208/web-test/ +refs/heads/*:refs/remotes/origin/* # timeout=10 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 > git config checkout # timeout=10 > git checkout -f fc5b47ef6461a023faa52123eeaaffbdf50cb90d # timeout=10Commit message: "Update " > git rev-list --no-walk 56a05f7cfabb39e805104f68edf29d4a2a62a00e # timeout=10[Pipeline] sh+ pprun_[Pipeline] }[Pipeline] // stage[Pipeline] echook[Pipeline] stage[Pipeline] { (构建镜像)[Pipeline] withCredentialsMasking supported pattern matches of $username or $password[Pipeline] {[Pipeline] sh+ echo ' #tomcat web1 FROM /web-test/tomcat-base:v8.0.32
ADD /apps/tomcat/bin/ ADD /apps/tomcat/conf/ ADD myapp/* /data/tomcat/webapps/myapp/ #ADD /data/tomcat/webapps/myapp/ ADD run_ /apps/tomcat/bin/run_ ADD /etc/filebeat/
RUN chown -R /data/ /apps/ && chmod a+x /apps/tomcat/bin/*.sh
EXPOSE 8080 8443
CMD ["/apps/tomcat/bin/run_"] '+ docker build -t 20.0.0.207:443/jenkinsci/citest:27 .Sending build context to Docker daemon 138.8kBStep 1/9 : FROM /web-test/tomcat-base:v8.0.32 ---> 57a68cb49838Step 2/9 : ADD /apps/tomcat/bin/ ---> Using cache ---> 952bd7aedf45Step 3/9 : ADD /apps/tomcat/conf/ ---> Using cache ---> 514e8fd3fb0aStep 4/9 : ADD myapp/* /data/tomcat/webapps/myapp/ ---> 955e12db7ba0Step 5/9 : ADD run_ /apps/tomcat/bin/run_ ---> b602420d4ceeStep 6/9 : ADD /etc/filebeat/ ---> eb303540006cStep 7/9 : RUN chown -R /data/ /apps/ && chmod a+x /apps/tomcat/bin/*.sh ---> Running in 25733526d18cRemoving intermediate container 25733526d18c ---> e0bdc01f0e60Step 8/9 : EXPOSE 8080 8443 ---> Running in cb73eba5c8ccRemoving intermediate container cb73eba5c8cc ---> de3838fd9278Step 9/9 : CMD ["/apps/tomcat/bin/run_"] ---> Running in 1eb7e3aea8c5Removing intermediate container 1eb7e3aea8c5 ---> 6e76d78777a4Successfully built 6e76d78777a4Successfully tagged 20.0.0.207:443/jenkinsci/citest:27+ docker login -u **** -p **** 20.0.0.207:443WARNING! Using --password via the CLI is insecure. Use --G! Your password will be stored unencrypted in /root/.docker/ure a credential helper to remove this warning. See/engine/reference/commandline/login/#credentials-storeLogin Succeeded+ docker push 20.0.0.207:443/jenkinsci/citest:27The push refers to repository [20.0.0.207:443/jenkinsci/citest]16d625dc57d6: Preparingcf823686624a: Preparing234132b6269c: Preparingc5c916246c3b: Preparing0d62fdc12392: Preparing8e3632860e66: Preparingb08c99aa7244: Preparingaf6ca6732cdd: Preparing5a30b566c369: Preparing2dded0b9e69e: Preparing8979abf3f442: Preparing5660fcdf24c6: Preparinge: Preparing33cb7880c818: Preparing97275cad22f5: Preparing74aad83882e8: Preparing4826cdadf1ef: Preparing2dded0b9e69e: Waiting8979abf3f442: Waiting5660fcdf24c6: Waitinge: Waitingb08c99aa7244: Waiting33cb7880c818: Waiting97275cad22f5: Waiting
8e3632860e66: Waiting74aad83882e8: Waitingaf6ca6732cdd: Waiting5a30b566c369: Waiting0d62fdc12392: Layer already exists8e3632860e66: Layer already existsb08c99aa7244: Layer already existscf823686624a: Pushedc5c916246c3b: Pushed234132b6269c: Pushed5a30b566c369: Layer already existsaf6ca6732cdd: Layer already exists2dded0b9e69e: Layer already existse: Layer already exists33cb7880c818: Layer already exists8979abf3f442: Layer already exists5660fcdf24c6: Layer already exists97275cad22f5: Layer already exists74aad83882e8: Layer already exists4826cdadf1ef: Layer already exists16d625dc57d6: Pushed27: digest: sha256:087c08554de2af922353410f9583b2ded4c536040f2ced73fb050530e9a2ee6e size: 3879[Pipeline] }[Pipeline] // withCredentials[Pipeline] echook[Pipeline] }[Pipeline] // stage[Pipeline] stage[Pipeline] { (部署到K8s)[Pipeline] sh+ sed -i 's#$IMAGE_NAME#20.0.0.207:443/jenkinsci/citest:27#' + sed -i 's#$SECRET_NAME#k8s-harbor-login#' + sed -i 's#$NODE_PORT#33333#' [Pipeline] kubernetesDeployStarting Kubernetes deploymentLoading configuration: /home/jenkins/agent/workspace/gitlab-citest-pipeline/eated V1Deployment: class V1Deployment { apiVersion: apps/v1 kind: Deployment metadata: class V1ObjectMeta { annotations: null clusterName: null creationTimestamp: 2020-03-25T12:24:48.000Z deletionGracePeriodSeconds: null deletionTimestamp: null finalizers: null generateName: null generation: 1 initializers: null labels: {app=tomcat-app1-test} managedFields: null name: web-test-tomcat1-deployment namespace: assembly ownerReferences: null resourceVersion: 463562 selfLink: /apis/apps/v1/namespaces/assembly/deployments/web-test-tomcat1-deployment uid: 28a27040-6804-4c65-91bd-4183211e1402 } spec: class V1DeploymentSpec { minReadySeconds: null paused: null progressDeadlineSeconds: 600 replicas: 1 revisionHistoryLimit: 10 selector: class V1LabelSelector { matchExpressions: null matchLabels: {app=tomcat-app1-test} } strategy: class V1DeploymentStrategy { rollingUpdate: class V1RollingUpdateDeployment { maxSurge: 25% maxUnavailable: 25% } type: RollingUpdate } template: class V1PodTemplateSpec { metadata: class V1ObjectMeta { annotations: null clusterName: null creationTimestamp: null deletionGracePeriodSeconds: null deletionTimestamp: null finalizers: null generateName: null generation: null initializers: null labels: {app=tomcat-app1-test} managedFields: null name: null namespace: null ownerReferences: null resourceVersion: null selfLink: null uid: null } spec: class V1PodSpec { activeDeadlineSeconds: null affinity: null automountServiceAccountToken: null containers: [class V1Container { args: null command: null env: null envFrom: null image: 20.0.0.207:443/jenkinsci/citest:27 imagePullPolicy: Always lifecycle: null livenessProbe: null name: web-test-tomcat1-spec ports: [class V1ContainerPort { containerPort: 8080 hostIP: null hostPort: null name: http protocol: TCP }] readinessProbe: null resources: class V1ResourceRequirements { limits: null requests: null } securityContext: null
stdin: null stdinOnce: null terminationMessagePath: /dev/termination-log terminationMessagePolicy: File tty: null volumeDevices: null volumeMounts: null workingDir: null }] dnsConfig: null dnsPolicy: ClusterFirst enableServiceLinks: null hostAliases: null hostIPC: null hostNetwork: null hostPID: null hostname: null imagePullSecrets: [class V1LocalObjectReference { name: k8s-harbor-login }] initContainers: null nodeName: null nodeSelector: null preemptionPolicy: null priority: null priorityClassName: null readinessGates: null restartPolicy: Always runtimeClassName: null schedulerName: default-scheduler securityContext: class V1PodSecurityContext { fsGroup: null runAsGroup: null runAsNonRoot: null runAsUser: null seLinuxOptions: null supplementalGroups: null sysctls: null windowsOptions: null } serviceAccount: null serviceAccountName: null shareProcessNamespace: null subdomain: null terminationGracePeriodSeconds: 30 tolerations: null volumes: null } } } status: class V1DeploymentStatus { availableReplicas: null collisionCount: null conditions: null observedGeneration: null readyReplicas: null replicas: null unavailableReplicas: null updatedReplicas: null }}Applied V1Service: class V1Service { apiVersion: v1 kind: Service metadata: class V1ObjectMeta { annotations: null clusterName: null creationTimestamp: 2020-03-24T13:53:32.000Z deletionGracePeriodSeconds: null deletionTimestamp: null finalizers: null generateName: null generation: null initializers: null labels: {app=tomcat-app1-test} managedFields: null name: web-test-tomcat1-spec namespace: assembly ownerReferences: null resourceVersion: 422339 selfLink: /api/v1/namespaces/assembly/services/web-test-tomcat1-spec uid: 72cca44f-a4a1-4695-8b0e-212448fe1026 } spec: class V1ServiceSpec { clusterIP: 10.68.198.131 externalIPs: null externalName: null externalTrafficPolicy: Cluster healthCheckNodePort: null loadBalancerIP: null loadBalancerSourceRanges: null ports: [class V1ServicePort { name: http nodePort: 33333 port: 80 protocol: TCP targetPort: 8080 }] publishNotReadyAddresses: null selector: {app=tomcat-app1-test} sessionAffinity: None sessionAffinityConfig: null type: NodePort } status: class V1ServiceStatus { loadBalancer: class V1LoadBalancerStatus { ingress: null } }}Finished Kubernetes deployment[Pipeline] }[Pipeline] // stage[Pipeline] }[Pipeline] // node[Pipeline] }[Pipeline] // podTemplate[Pipeline] End of PipelineFinished: SUCCESS删除web-test-tomcat1 pod