Browse Source

feature: init

Yi 11 months ago
parent
commit
5987e91d12
2 changed files with 18 additions and 17 deletions
  1. 17 16
      .drone.yml
  2. 1 1
      Makefile

+ 17 - 16
.drone-bak.yml → .drone.yml

@@ -1,18 +1,10 @@
 kind: pipeline
 type: docker
-name: kpt-tmr
+name: test
 
-clone:
-  depth: 1
-  disable: true
 steps:
-  - name: clone
-    image: alpine/git
-    commands:
-     - git clone -b develop http://192.168.1.8:3000/baishaojie/tmrgo.git
-     - cp -R tmrgo/* ./
   - name: build
-    image: plugins/docker:20.14.2
+    image: plugins/docker
     volumes:
       - name: hosts
         path: /etc/hosts
@@ -21,23 +13,32 @@ steps:
       - name: docker-sock
         path: /var/run/docker.sock
     settings:
-      dockerfile: /drone/src/tmrgo/Dockerfile
+      dockerfile: /drone/src/Dockerfile
       username:
         from_secret: aliyun_name
       password:
         from_secret: aliyun_password
       repo: registry.cn-hangzhou.aliyuncs.com/kpt-event/kpt-tmr-sheep
       registry: registry.cn-hangzhou.aliyuncs.com
-      tags: [ 1.0.0,latest ]
-
+      tags: [test]
+  - name: ssh commands
+    image: appleboy/drone-ssh
+    settings:
+      host: 192.168.1.70
+      username: tmrwatch
+      password:
+        from_secret: ssh_password
+      port: 22
+      script:
+        - cd /data/docker-compose/kpt-tmr-sheep/
+        - echo "123456" | ./restart.sh
 trigger:
   branch:
     include:
-      - develop
+      - feature/*
   event:
     include:
       - push
-
 volumes:
   - name: host
     host:
@@ -47,4 +48,4 @@ volumes:
       path: /ect/docker
   - name: docker-sock
     host:
-      path: /var/run/docker.sock
+      path: /var/run/docker.sock

+ 1 - 1
Makefile

@@ -18,4 +18,4 @@ lint:
 build:
 	rm -rf bin
 	mkdir -p bin
-	GOARCH=amd64 GOOS=linux CGO_ENABLED=0 go build -o bin/kptTmr -ldflags "-X kpt.kptyun.cn:3000/kpt-event/kpt-tmr/pod.appVersion=${version}" main.go
+	GOARCH=amd64 GOOS=linux CGO_ENABLED=0 go build -o bin/kptTmrSheep -ldflags "-X kpt.kptyun.cn:3000/kpt-event/kpt-tmr-sheep/pod.appVersion=${version}" main.go