Просмотр исходного кода

Make minor changes to drone script to imporve stability (#3868)

* Update drone.yml

* Regenetere multipphp templates

php_ver = /etc/php/x.x instead of x.x when you use ls -d /etc/php/*

* No need to run it any more as it is duplicate
Jaap Marcus 2 лет назад
Родитель
Сommit
ed5d307429
3 измененных файлов с 21 добавлено и 11 удалено
  1. 18 0
      .drone.yml
  2. 3 2
      bin/v-update-web-templates
  3. 0 9
      test/config-tests.bats

+ 18 - 0
.drone.yml

@@ -28,6 +28,14 @@ steps:
       - npm ci
       - npm ci
       - npm run build
       - npm run build
       - ./src/hst_autocompile.sh --hestia --install '~localsrc'
       - ./src/hst_autocompile.sh --hestia --install '~localsrc'
+  - name: Reset Web templates
+    commands:
+      - rm /usr/local/hestia/data/templates/web/nginx/php-fpm/*.*
+      - rm /usr/local/hestia/data/templates/web/nginx/*.*
+      - rm /usr/local/hestia/data/templates/web/apache2/php-fpm/*.*
+      - rm /usr/local/hestia/data/templates/web/apache2/*.*
+      - rm /usr/local/hestia/data/templates/web/php-fpm/*.*
+      - /usr/local/hestia/bin/v-update-web-templates
   - name: Run system / user tests
   - name: Run system / user tests
     commands:
     commands:
       - bats ./test/test.bats
       - bats ./test/test.bats
@@ -44,6 +52,7 @@ trigger:
     - refs/heads/release
     - refs/heads/release
     - refs/heads/prerelease
     - refs/heads/prerelease
     - refs/heads/servicing
     - refs/heads/servicing
+    - refs/heads/tests/*
     - refs/heads/main
     - refs/heads/main
     - refs/pull/*/head
     - refs/pull/*/head
 
 
@@ -77,6 +86,14 @@ steps:
       - npm ci
       - npm ci
       - npm run build
       - npm run build
       - ./src/hst_autocompile.sh --hestia --install '~localsrc'
       - ./src/hst_autocompile.sh --hestia --install '~localsrc'
+  - name: Reset Web templates
+    commands:
+      - rm /usr/local/hestia/data/templates/web/nginx/php-fpm/*.*
+      - rm /usr/local/hestia/data/templates/web/nginx/*.*
+      - rm /usr/local/hestia/data/templates/web/apache2/php-fpm/*.*
+      - rm /usr/local/hestia/data/templates/web/apache2/*.*
+      - rm /usr/local/hestia/data/templates/web/php-fpm/*.*
+      - /usr/local/hestia/bin/v-update-web-templates
   - name: Run system / user tests
   - name: Run system / user tests
     commands:
     commands:
       - bats ./test/test.bats
       - bats ./test/test.bats
@@ -97,6 +114,7 @@ trigger:
     - refs/heads/release
     - refs/heads/release
     - refs/heads/prerelease
     - refs/heads/prerelease
     - refs/heads/servicing
     - refs/heads/servicing
+    - refs/heads/tests/*
     - refs/heads/main
     - refs/heads/main
     - refs/pull/*/head
     - refs/pull/*/head
 
 

+ 3 - 2
bin/v-update-web-templates

@@ -52,8 +52,9 @@ done
 
 
 versions_list=$(ls -d /etc/php/*)
 versions_list=$(ls -d /etc/php/*)
 for php_ver in $versions_list; do
 for php_ver in $versions_list; do
-	[ ! -d "/etc/php/$php_ver/fpm/pool.d/" ] && continue
-	cp -f $HESTIA_INSTALL_DIR/php-fpm/multiphp.tpl ${WEBTPL}/php-fpm/PHP-${php_ver/\./_}.tpl
+	version=$(echo $php_ver | sed 's/.*\///')
+	[ ! -d "/etc/php/$version/fpm/pool.d/" ] && continue
+	cp -f $HESTIA_INSTALL_DIR/php-fpm/multiphp.tpl ${WEBTPL}/php-fpm/PHP-${version/\./_}.tpl
 done
 done
 
 
 if [ -n "$awstats_patch" ]; then
 if [ -n "$awstats_patch" ]; then

+ 0 - 9
test/config-tests.bats

@@ -35,15 +35,6 @@ function setup() {
     source $HESTIA/func/ip.sh
     source $HESTIA/func/ip.sh
 }
 }
 
 
-@test "Prepare for tests" {
-	run rm -f /usr/local/hestia/data/templates/web/nginx/php-fpm/*.*
-	run rm -f /usr/local/hestia/data/templates/web/nginx/*.*
-	run rm -f /usr/local/hestia/data/templates/web/apache2/php-fpm/*.*
-	run rm -f /usr/local/hestia/data/templates/web/apache2/*.*
-
-	run v-update-web-templates
-}
-
 @test "Setup Test domain" {
 @test "Setup Test domain" {
     run v-add-user $user $user $user@hestiacp.com default "Super Test"
     run v-add-user $user $user $user@hestiacp.com default "Super Test"
     assert_success
     assert_success