Skip to content

Commit ed5d307

Browse files
authored
Make minor changes to drone script to imporve stability (hestiacp#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
1 parent 2ad9599 commit ed5d307

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

.drone.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ steps:
2828
- npm ci
2929
- npm run build
3030
- ./src/hst_autocompile.sh --hestia --install '~localsrc'
31+
- name: Reset Web templates
32+
commands:
33+
- rm /usr/local/hestia/data/templates/web/nginx/php-fpm/*.*
34+
- rm /usr/local/hestia/data/templates/web/nginx/*.*
35+
- rm /usr/local/hestia/data/templates/web/apache2/php-fpm/*.*
36+
- rm /usr/local/hestia/data/templates/web/apache2/*.*
37+
- rm /usr/local/hestia/data/templates/web/php-fpm/*.*
38+
- /usr/local/hestia/bin/v-update-web-templates
3139
- name: Run system / user tests
3240
commands:
3341
- bats ./test/test.bats
@@ -44,6 +52,7 @@ trigger:
4452
- refs/heads/release
4553
- refs/heads/prerelease
4654
- refs/heads/servicing
55+
- refs/heads/tests/*
4756
- refs/heads/main
4857
- refs/pull/*/head
4958

@@ -77,6 +86,14 @@ steps:
7786
- npm ci
7887
- npm run build
7988
- ./src/hst_autocompile.sh --hestia --install '~localsrc'
89+
- name: Reset Web templates
90+
commands:
91+
- rm /usr/local/hestia/data/templates/web/nginx/php-fpm/*.*
92+
- rm /usr/local/hestia/data/templates/web/nginx/*.*
93+
- rm /usr/local/hestia/data/templates/web/apache2/php-fpm/*.*
94+
- rm /usr/local/hestia/data/templates/web/apache2/*.*
95+
- rm /usr/local/hestia/data/templates/web/php-fpm/*.*
96+
- /usr/local/hestia/bin/v-update-web-templates
8097
- name: Run system / user tests
8198
commands:
8299
- bats ./test/test.bats
@@ -97,6 +114,7 @@ trigger:
97114
- refs/heads/release
98115
- refs/heads/prerelease
99116
- refs/heads/servicing
117+
- refs/heads/tests/*
100118
- refs/heads/main
101119
- refs/pull/*/head
102120

bin/v-update-web-templates

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ done
5252

5353
versions_list=$(ls -d /etc/php/*)
5454
for php_ver in $versions_list; do
55-
[ ! -d "/etc/php/$php_ver/fpm/pool.d/" ] && continue
56-
cp -f $HESTIA_INSTALL_DIR/php-fpm/multiphp.tpl ${WEBTPL}/php-fpm/PHP-${php_ver/\./_}.tpl
55+
version=$(echo $php_ver | sed 's/.*\///')
56+
[ ! -d "/etc/php/$version/fpm/pool.d/" ] && continue
57+
cp -f $HESTIA_INSTALL_DIR/php-fpm/multiphp.tpl ${WEBTPL}/php-fpm/PHP-${version/\./_}.tpl
5758
done
5859

5960
if [ -n "$awstats_patch" ]; then

test/config-tests.bats

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,6 @@ function setup() {
3535
source $HESTIA/func/ip.sh
3636
}
3737

38-
@test "Prepare for tests" {
39-
run rm -f /usr/local/hestia/data/templates/web/nginx/php-fpm/*.*
40-
run rm -f /usr/local/hestia/data/templates/web/nginx/*.*
41-
run rm -f /usr/local/hestia/data/templates/web/apache2/php-fpm/*.*
42-
run rm -f /usr/local/hestia/data/templates/web/apache2/*.*
43-
44-
run v-update-web-templates
45-
}
46-
4738
@test "Setup Test domain" {
4839
run v-add-user $user $user $user@hestiacp.com default "Super Test"
4940
assert_success

0 commit comments

Comments
 (0)