hu hao 5 лет назад
Родитель
Сommit
ac940f071e
3 измененных файлов с 24 добавлено и 6 удалено
  1. 3 4
      .gitlab-ci.yml
  2. 21 0
      ci/executeCommand.sh
  3. 0 2
      ci/judgePush.sh

+ 3 - 4
.gitlab-ci.yml

@@ -18,8 +18,6 @@ build:
     - testwas
   script:
     - echo "build ....."
-#    - path=`pwd`
-#    - sudo bash ci/judgePush.sh $path
 
 test:
   stage: test
@@ -35,8 +33,9 @@ deploy:
     - testwas
   script:
 #    - echo "deploy ...."
-    - path=`pwd`
-    - sudo bash ci/judgePush.sh $path
+#    - path=`pwd`
+#    - sudo bash ci/judgePush.sh $path
     - cd /var/www/testwas && git pull
+    -
 #  only:
 #    - master

+ 21 - 0
ci/executeCommand.sh

@@ -0,0 +1,21 @@
+#!/bin/bash
+
+project_path=/var/www/testwas
+update_path=/var/www/update
+#重启队列
+#sudo bash runServes.sh
+#进入项目目录
+cd $project_path
+#将项目文件中3分钟之前改动的文件存到update文件
+find -mmin -3 |xargs -I {} cp {} -u -t $update_path
+
+for file in `ls $update_path`
+    do
+        if test -f $file
+        then
+            echo "file:  $file"
+        elif test -d $file
+        then
+            echo "path: $file"
+        fi
+    done

+ 0 - 2
ci/judgePush.sh

@@ -1,6 +1,4 @@
 #!/bin/bash
 
-#sudo su gitlab-runner
 echo $1
 cd $1
-echo "112233"