@@ -35,14 +35,14 @@ jobs:
35
35
--health-timeout 5s
36
36
--health-retries 5
37
37
ports:
38
- - 5432:5432
38
+ - 5432:5432
39
39
40
40
steps:
41
41
# git clone dolibarr into GITHUB_WORKSPACE = /home/runner/work/dolibarr/dolibarr
42
42
- uses: actions/checkout@v3
43
43
with:
44
44
fetch-depth: 1
45
-
45
+
46
46
- name: Version PHP
47
47
run: |
48
48
php -i | head -
59
59
sudo apt install apache2 php7.1 php7.1-cli php7.1-curl php7.1-mysql php7.1-pgsql php7.1-gd php7.1-imap php7.1-intl php7.1-ldap php7.1-xml php7.1-mbstring php7.1-xml php7.1-zip libapache2-mod-php7.1
60
60
sudo update-alternatives --set php /usr/bin/php7.1
61
61
php -i | head -
62
-
62
+
63
63
cd $GITHUB_WORKSPACE
64
64
ls $GITHUB_WORKSPACE
65
65
composer -n require --ignore-platform-reqs phpunit/phpunit ^7.5 \
76
76
sudo rm -fr htdocs/includes/phpunit/php-code-coverage/src/Report/Html
77
77
78
78
- name: Adding path of binaries tools installed by composer to the PATH
79
- run: |
79
+ run: |
80
80
export PATH="$GITHUB_WORKSPACE/htdocs/includes/bin:$PATH"
81
81
echo $PATH
82
82
# We must have a directory bin created by the previous composer call
@@ -107,32 +107,32 @@ jobs:
107
107
psql --version
108
108
echo "Check pgloader version"
109
109
pgloader --version
110
-
110
+
111
111
- name: Create database
112
112
run: |
113
113
pwd
114
- echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE
114
+ echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE
115
115
sudo apt-get install -y mysql-client
116
116
mysql --version | head -
117
117
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e "SELECT VERSION();" | head -
118
118
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e "SHOW DATABASES"
119
-
119
+
120
120
echo "Drop and create database"
121
121
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e 'DROP DATABASE IF EXISTS travis;'
122
122
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e "CREATE DATABASE IF NOT EXISTS travis CHARACTER SET = 'utf8';"
123
123
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e "CREATE USER 'travis'@'127.0.0.1' IDENTIFIED BY 'password';"
124
124
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e 'GRANT ALL PRIVILEGES ON travis.* TO
[email protected] ;'
125
125
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e 'FLUSH PRIVILEGES;'
126
-
127
- mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
128
-
129
- mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -D travis -e "UPDATE llx_const set value = '0666' WHERE name = 'MAIN_UMASK';"
130
126
131
- echo "Init postgresql database"
127
+ mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
128
+
129
+ mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -D travis -e "UPDATE llx_const set value = '0666' WHERE name = 'MAIN_UMASK';"
130
+
131
+ echo "Init postgresql database"
132
132
ps fauxww | grep postgres
133
133
ls /etc/postgresql/14/main/
134
134
sudo chmod -R a+rwx /etc/postgresql/14/main/pg_hba.conf
135
-
135
+
136
136
sudo sed -i -e '/local.*peer/s/postgres/all/' -e 's/peer\|md5/trust/g' /etc/postgresql/14/main/pg_hba.conf
137
137
sudo cat /etc/postgresql/14/main/pg_hba.conf
138
138
@@ -144,7 +144,7 @@ jobs:
144
144
145
145
sudo mkdir -p /tmp/pgloader
146
146
sudo chmod -R a+rwx /tmp/pgloader/
147
-
147
+
148
148
echo sudo pgloader mysql://root:
[email protected] :32574/travis postgresql://postgres:
[email protected] :5432/travis
149
149
sudo pgloader mysql://root:
[email protected] :32574/travis postgresql://postgres:
[email protected] :5432/travis
150
150
echo 'ALTER SEQUENCE llx_accountingaccount_rowid_seq RENAME TO llx_accounting_account_rowid_seq' | psql postgresql://postgres:
[email protected] :5432/travis
@@ -190,7 +190,7 @@ jobs:
190
190
echo '$'force_install_mainforcehttps=false';' >> $INSTALL_FORCED_FILE
191
191
echo '$'force_install_main_data_root=\'/var/www/html\'';' >> $INSTALL_FORCED_FILE
192
192
cat $INSTALL_FORCED_FILE
193
-
193
+
194
194
- name: Create document directory
195
195
run: |
196
196
echo "Create documents directory and set permissions"
@@ -199,9 +199,9 @@ jobs:
199
199
sudo chmod -R a+rwx /var/www/html/documents
200
200
sudo echo "***** First line of dolibarr.log" > /var/www/html/documents/dolibarr.log
201
201
sudo chmod a+rwx /var/www/html/documents/dolibarr.log
202
-
202
+
203
203
- name: Copy app into /var/www
204
- run: |
204
+ run: |
205
205
sudo cp -r $GITHUB_WORKSPACE/htdocs/. /var/www/html
206
206
sudo mv /var/www/html/index.html /var/www/html/index.disabled.html
207
207
sudo ln -fs /var/www/html /var/www/htdocs
@@ -217,7 +217,7 @@ jobs:
217
217
a2query -s
218
218
a2query -m
219
219
ls /etc/apache2/sites-available
220
- #sudo cp -f $GITHUB_WORKSPACE/build/travis-ci/apache-githubaction.conf /etc/apache2/sites-available/000-default.conf
220
+ #sudo cp -f $GITHUB_WORKSPACE/dev/ build/travis-ci/apache-githubaction.conf /etc/apache2/sites-available/000-default.conf
221
221
#sudo sed -e "s?%GITHUB_WORKSPACE%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf
222
222
a2ensite 000-default
223
223
a2enmod php7.1
@@ -245,7 +245,7 @@ jobs:
245
245
# The wget should return a page with line '<meta name="generator" content="Dolibarr installer">
246
246
wget -O - --debug http://127.0.0.1 > $GITHUB_WORKSPACE/test.html 2>&1
247
247
head -n 200 $GITHUB_WORKSPACE/test.html
248
-
248
+
249
249
echo Logs are...
250
250
#sudo cat /tmp/install.log
251
251
sudo cat /var/log/apache2/access.log
@@ -287,7 +287,7 @@ jobs:
287
287
php upgrade.php 6.0.0 7.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade600700.log
288
288
php upgrade2.php 6.0.0 7.0.0 > $GITHUB_WORKSPACE/upgrade600700-2.log
289
289
php step5.php 6.0.0 7.0.0 > $GITHUB_WORKSPACE/upgrade600700-3.log
290
-
290
+
291
291
echo "\dt llx_c_paiement" | psql 'postgresql://postgres:
[email protected] :5432/travis'
292
292
echo "\dt llx_c_payment_term" | psql 'postgresql://postgres:
[email protected] :5432/travis'
293
293
@@ -324,17 +324,17 @@ jobs:
324
324
php upgrade.php 17.0.0 18.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade17001800.log
325
325
php upgrade2.php 17.0.0 18.0.0 > $GITHUB_WORKSPACE/upgrade17001800-2.log
326
326
php step5.php 17.0.0 18.0.0 > $GITHUB_WORKSPACE/upgrade17001800-3.log
327
-
327
+
328
328
- name: Result of migration scripts
329
329
if: always()
330
330
run: |
331
331
ls -alrt $GITHUB_WORKSPACE/
332
-
332
+
333
333
echo Show content of last file
334
334
cat "$(ls -rt $GITHUB_WORKSPACE/ | tail -n1)"
335
335
336
336
- name: Enabling new modules
337
- run: |
337
+ run: |
338
338
# Enable modules not enabled into original dump
339
339
set -e
340
340
cd /var/www/html/install
@@ -361,5 +361,4 @@ jobs:
361
361
includes/bin/phpunit -d memory_limit=-1 -c /var/www/test/phpunit/phpunittest.xml /var/www/test/phpunit/AllTests.php
362
362
phpunitresult=$?
363
363
echo "Phpunit return code = $phpunitresult"
364
- set +e
365
-
364
+ set +e
0 commit comments