ソースを参照

gitlab-ci测试

hu hao 4 年 前
コミット
2401002014
3 ファイル変更16 行追加15 行削除
  1. 12 11
      .gitlab-ci.yml
  2. 1 1
      ci/executeCommand.sh
  3. 3 3
      ci/scpUpdate.sh

+ 12 - 11
.gitlab-ci.yml

@@ -11,8 +11,8 @@ cache:
 
 before_script:
 #配置环境
-#  - sudo cp ci/.envCi .env
-#  - sudo bash ci/installEnv.sh
+  - sudo cp ci/.envCi .env
+  - sudo bash ci/installEnv.sh
 
 build:
   stage: build
@@ -27,10 +27,10 @@ test:
     - testwas
   script:
     - echo "run test....."
-#    - path=`pwd`
-#    - sudo bash ci/judgePush.sh $path
-#    - php vendor/bin/phpunit --testsuite=Services
-#    - sudo bash ci/sendEmail.sh
+    - path=`pwd`
+    - sudo bash ci/judgePush.sh $path
+    - php vendor/bin/phpunit --testsuite=Services
+    - sudo bash ci/sendEmail.sh
 
 test_failed:
   stage: test_failed
@@ -38,8 +38,8 @@ test_failed:
     - testwas
   script:
     - echo "run test_failed"
-#    - email=`sudo git log --pretty=format:"%ce" -1`
-#    - sudo bash ci/sendEmail.sh $email
+    - email=`sudo git log --pretty=format:"%ce" -1`
+    - sudo bash ci/sendEmail.sh $email
   when: on_failure
 
 deploy:
@@ -50,6 +50,7 @@ deploy:
     - echo "deploy ...."
 #    - cd /var/www/bswas_test && sudo git config --global credential.helper store
 #    - sudo git pull
-#    - sudo bash ci/executeCommand.sh
-#  only:
-#    - master
+    - sudo bash ci/scpUpdate.sh
+    - sudo bash ci/executeCommand.sh
+  only:
+    - master

+ 1 - 1
ci/executeCommand.sh

@@ -16,7 +16,7 @@ for file in `ls $update_path`
         elif [ "package.json" == "$file" ]; then
             sudo yarn install
         elif [ "resources" == "$file" ]; then
-            sudo yarn run prod
+            sudo yarn run development
         elif [ "database" == "$file" ]; then
             sudo php artisan migrate
         fi

+ 3 - 3
ci/scpUpdate.sh

@@ -1,9 +1,9 @@
 #!/bin/bash
 Ip="was.baoshi56.com"
-username="haozi"
-password="haozi"
+username="ci"
+password="q22w33e"
 update_path=/var/www/update
-dsc=/var/www/update
+dsc=/var/www/was
 
 # shellcheck disable=SC2045
 # shellcheck disable=SC2034