浏览代码

测试Jenkins

4228306 5 年之前
父节点
当前提交
041b297ce4
共有 3 个文件被更改,包括 8 次插入14 次删除
  1. 1 1
      buildAndRun.sh
  2. 7 0
      deploy.sh
  3. 0 13
      deployment.yaml

+ 1 - 1
buildAndRun.sh

@@ -5,5 +5,5 @@ date=`date +%Y%m%d_%H%M%S`
 mvn -s /etc/maven/settings.xml -DskipTests=true clean package
 docker build -t feick/diagnosis:$date .
 #sed -i "s/\${date}/$(echo $date)/g" diagnosis.yaml
-kubectl apply -f
+#kubectl apply -f deployment.yaml
 #docker run --rm -p 9090:8080 feick/diagnosis:$date --spring.profiles.active=dev

+ 7 - 0
deploy.sh

@@ -0,0 +1,7 @@
+date=`date +%Y%m%d_%H%M%S`
+cd /home/jenkins/workspace/diagnosis
+docker build -t feick/diagnosis:$date .
+echo "current tag is $date"
+sed -i "s/\${date}/$(echo $date)/g" deployment.yaml
+kubectl apply -f deployment.yaml
+echo "build finish."

+ 0 - 13
deployment.yaml

@@ -1,20 +1,8 @@
 apiVersion: apps/v1
 kind: Deployment
 metadata:
-  annotations:
-    deployment.kubernetes.io/revision: "1"
-    field.cattle.io/creatorId: user-ktj2n
-    field.cattle.io/publicEndpoints: '[{"addresses":["172.18.129.124"],"port":31692,"protocol":"TCP","serviceName":"dev:diagnosis1-nodeport","allNodes":true}]'
-  creationTimestamp: "2020-02-20T08:02:48Z"
-  generation: 2
-  labels:
-    cattle.io/creator: norman
-    workload.user.cattle.io/workloadselector: deployment-dev-diagnosis1
   name: diagnosis1
   namespace: dev
-  resourceVersion: "27368155"
-  selfLink: /apis/apps/v1/namespaces/dev/deployments/diagnosis1
-  uid: e920a811-f196-4797-b77d-3f180b14edda
 spec:
   progressDeadlineSeconds: 600
   replicas: 1
@@ -30,7 +18,6 @@ spec:
   template:
     metadata:
       annotations:
-        cattle.io/timestamp: "2020-02-20T08:02:48Z"
         field.cattle.io/ports: '[[{"containerPort":8080,"dnsName":"diagnosis1-nodeport","kind":"NodePort","name":"8080tcp01","protocol":"TCP","sourcePort":0}]]'
       creationTimestamp: null
       labels: