Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop_new-stocka…
Browse files Browse the repository at this point in the history
…bleproduct_3
  • Loading branch information
thomas-Ngr committed Nov 13, 2024
2 parents fc48a39 + 2eb5bca commit 57b91c9
Show file tree
Hide file tree
Showing 626 changed files with 23,280 additions and 13,108 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ trim_trailing_whitespace = false
indent_style = tab
trim_trailing_whitespace = true
indent_size = 4
[*.yml]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
10 changes: 8 additions & 2 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

# Get PHP and addons
- name: Setup PHP
id: setup-php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: phpstan, cs2pr
coverage: none # disable xdebug, pcov
tools: phpstan:2.0, cs2pr
extensions: calendar, json, imagick, gd, zip, mbstring, intl, opcache, imap,
mysql, pgsql, sqlite3, ldap, xml, mcrypt

Expand Down Expand Up @@ -86,3 +86,9 @@ jobs:
name: phpstan-srcrt
path: ${{ github.workspace }}/_stan.xml
retention-days: 2
# Run PHPStan generate baseline
# - name: Run PHPStan generate baseline
# id: phpstan-baseline
# if: ${{ success() }}
# run: |
# phpstan -vv analyse --memory-limit 7G -a build/phpstan/bootstrap_action.php --generate-baseline build/phpstan/phpstan-baseline.neon
73 changes: 73 additions & 0 deletions .github/workflows/phpstan_baseline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: 'PHPStan'

on:
# Every Monday we want to refresh the baseline
schedule:
- cron: '0 6 * * 1'

# We want to be able to manually refresh the baseline too
workflow_dispatch:

workflow_call:
inputs:
gh_event:
required: true
type: string
# Run PHPStan analyse on pull requests
pull_request:

env:
PHP_VERSION: '8.2'
gh_event: ${{ inputs.gh_event || github.event_name }}
CACHE_KEY_PART: ${{ ( inputs.gh_event == 'pull_request' || github.event_name == 'pull_request' ) && format('{0}-{1}', github.base_ref, github.head_ref) || github.ref_name }}
jobs:
phpstan:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
coverage: none # disable xdebug, pcov
tools: phpstan:2.0, cs2pr
extensions: calendar, json, imagick, gd, zip, mbstring, intl, opcache, imap,
mysql, pgsql, sqlite3, ldap, xml, mcrypt
env:
fail-fast: true
# Restore old cache
- name: Restore phpstan cache
id: cache
uses: actions/cache/restore@v4
with:
path: ./.github/tmp
key: phpstan-cache-${{ env.PHP_VERSION }}-${{ env.CACHE_KEY_PART }}-${{
github.run_id }}
restore-keys: |
phpstan-cache-${{ env.PHP_VERSION }}-${{ env.CACHE_KEY_PART }}-
phpstan-cache-${{ env.PHP_VERSION }}-${{ github.head_ref }}-
phpstan-cache-${{ env.PHP_VERSION }}-${{ github.base_ref }}-
phpstan-cache-${{ env.PHP_VERSION }}-
- uses: ruudk/phpstan-baseline-refresh-create-pr-action@main
with:
github_token: ${{ secrets.PAT_GITHUB_TOKEN }}
phpstan_path: phpstan
configuration_path: phpstan.neon.dist
phpstan_additional_arguments: --memory-limit 7G -a build/phpstan/bootstrap_action.php
baseline_path: build/phpstan/phpstan-baseline.neon
commit_name: Dolibot
commit_email: [email protected]
commit_message: PHPStan > Update baseline
target_branch: develop
pr_create: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') && 1 || 0 }}
pr_title: PHPStan > Update baseline
pr_reviewer: eldy
pr_body: |
This PR is automatically created to cleanup our baseline.
Since the last refresh of the baseline we have fixed {0} ignored errors.
Keep it up all! :muscle:
There are only {1} ignored errors left :sweat_smile:
440 changes: 436 additions & 4 deletions ChangeLog

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ If you have low technical skills and you're looking to install Dolibarr ERP/CRM
- [DoliWamp for Windows](https://wiki.dolibarr.org/index.php/Dolibarr_for_Windows_(DoliWamp))
- [DoliDeb for Debian](https://wiki.dolibarr.org/index.php/Dolibarr_for_Ubuntu_or_Debian)
- DoliRpm for Red Hat, Fedora, OpenSuse, Mandriva or Mageia
- The Docker image (see next chapter)

Releases can be downloaded from [official website](https://www.dolibarr.org/).

### Using the generic step by step setup (recommended)
### Using the generic step by step setup (recommended for IT users)

You can use any web server supporting PHP (Apache, Nginx, ...) and a supported database (MariaDB, MySQL or PostgreSQL) to install the standard version:

Expand Down Expand Up @@ -69,7 +70,7 @@ You can use any web server supporting PHP (Apache, Nginx, ...) and a supported d

`http://yourdolibarrvirtualhost/install/`

- Follow the installer instructions;;;
- Follow the installer instructions

### Using Docker images

Expand Down
20 changes: 13 additions & 7 deletions build/docker/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# How to use it ?
# How to use run Dolibarr with docker ?

This directory is experimental. Scope of its used is not clear and not documented.
If you are looking for a process to run Dolibarr as an official Docker image, you can find it on https://hub.docker.com/r/dolibarr/dolibarr


# For experimental dev - TO REMOVE.
## For a fast run of a demo of the local version, you can build the docker image from this current repository by running

But if you want to execute the version of Dolibarr that is into this current directory as a docker process, you can do it with this commands.

sudo docker-compose build

sudo -s

export HOST_USER_ID=$(id -u)
export HOST_GROUP_ID=$(id -g)
export MYSQL_ROOT_PWD=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 13; echo)

docker-compose up -d

Warning: There is no persistency of data. If you need so, you should use instead the official Docker image that you can find on https://hub.docker.com/r/dolibarr/dolibarr

Warning: There is no persistency of data. This process is for dev purpose only.


## For a more robust or a production usage

If you want to execute an official Docker package, you can find it and read the doc on ihttps://hub.docker.com/r/dolibarr/dolibarr
18 changes: 13 additions & 5 deletions build/docker/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,26 @@
# Script used by the Dockerfile.
# See README.md to know how to create a Dolibarr env with docker

if [ "${PHP_INI_DIR}" == "" ]; then
echo
echo This script must not be run directly. It is used by the Dockerfile
echo See README.md
echo
exit
fi

usermod -u "${HOST_USER_ID}" www-data
groupmod -g "${HOST_GROUP_ID}" www-data

chgrp -hR www-data /var/www/html
chmod g+rwx /var/www/html/conf

if [ ! -d /var/documents ]; then
echo "[docker-run] => create volume directory /var/documents ..."
mkdir -p /var/documents
if [ ! -d /var/www/documents ]; then
echo "[docker-run] => create volume directory /var/www/documents ..."
mkdir -p /var/www/documents
fi
echo "[docker-run] => Set Permission to www-data for /var/documents"
chown -R www-data:www-data /var/documents
echo "[docker-run] => Set Permission to www-data for /var/www/documents"
chown -R www-data:www-data /var/www/documents

echo "[docker-run] => update '${PHP_INI_DIR}/conf.d/dolibarr-php.ini'"
cat <<EOF > "${PHP_INI_DIR}/conf.d/dolibarr-php.ini"
Expand Down
Loading

0 comments on commit 57b91c9

Please sign in to comment.