Compare commits

...

58 commits

Author SHA1 Message Date
769f1da8a5 hotfix(1/n): enable error logging
All checks were successful
continuous-integration/drone/push Build is passing
2024-08-06 18:52:21 +02:00
4fbf104d74 cicd: fix build naming
Some checks reported errors
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build was killed
2024-08-06 16:12:01 +02:00
e7108f75ff fix: avoid timeout during install (php + httpd)
Some checks reported errors
continuous-integration/drone/push Build was killed
2024-08-06 16:01:21 +02:00
85de3324a5 Merge branch 'develop' of code.apps.glenux.net:glenux-opencontainers/service-dolibarr into develop
Some checks reported errors
continuous-integration/drone/push Build was killed
2024-08-06 15:52:39 +02:00
6f7c494d14 Bump dolibarr version to 19.0.2 2024-08-06 15:49:54 +02:00
77b5f112d4 Update Dockerfile
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2024-06-15 16:04:00 +00:00
b5c4f8fbc0 Merge pull request 'develop' (#2) from develop into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #2
2024-04-28 10:21:18 +00:00
72d5bd938c Update Dockerfile
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2024-04-27 22:31:26 +00:00
70763feb6d Update Dockerfile
Some checks failed
continuous-integration/drone/push Build is failing
2024-04-27 21:39:28 +00:00
a9d934f08a fix: change curl line
Some checks failed
continuous-integration/drone/push Build is failing
2024-02-05 16:23:49 +01:00
5f1de8cc30 refactor: follow best-practices in Dockerfile
Some checks failed
continuous-integration/drone/push Build is failing
2024-02-05 16:08:29 +01:00
fe18d27f18 Merge pull request 'Bump version to 18.0.4' (#1) from develop into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #1
2024-02-05 14:54:55 +00:00
d1e81d12be Bump version to 18.0.4
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2024-02-05 15:32:03 +01:00
83bb0658c5 Update Dockerfile
All checks were successful
continuous-integration/drone/push Build is passing
2024-02-05 14:26:55 +00:00
0ad4ab4472 Bump dolibarr version to 17.0.2
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-06 09:54:37 +00:00
4719fe9e62 Bump version again
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-15 11:06:54 +01:00
0632220a79 Unbump version to 16.0.4
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-15 10:52:00 +01:00
71e2ce8db5 Revert to php 7.4
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-15 10:35:14 +01:00
984598ec33 docker: Disable composer execution
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-05 14:55:39 +01:00
45e0948b92 Update 'Dockerfile'
Some checks failed
continuous-integration/drone Build is failing
2023-03-05 12:49:48 +00:00
eb6f15efaf feat: Add dockerignore for ci file
Some checks reported errors
continuous-integration/drone/push Build was killed
continuous-integration/drone Build is passing
2023-02-21 13:44:05 +01:00
9998bfe548 ci: Add deploy step
Some checks reported errors
continuous-integration/drone/push Build was killed
2023-02-21 13:41:38 +01:00
eec4543953 docker: Bump version
All checks were successful
continuous-integration/drone/push Build is passing
2023-02-14 15:51:00 +01:00
f95b7ff10e ci: Distribute env var to avoid bugs
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-16 02:35:29 +01:00
ddcac30b89 ci: Do not purge (reuse cache)
Some checks failed
continuous-integration/drone/push Build is failing
2023-01-16 02:17:38 +01:00
f10eb465b2 ci: play with yaml references
Some checks reported errors
continuous-integration/drone/push Build was killed
2023-01-16 02:11:50 +01:00
19062e486c ci: try to use pipeline env
Some checks failed
continuous-integration/drone/push Build is failing
2023-01-16 02:01:25 +01:00
dcaa4e1a9c ci: Add debugush
Some checks reported errors
continuous-integration/drone/push Build was killed
2023-01-16 01:53:09 +01:00
97b8c096fc ci: Add debug
Some checks failed
continuous-integration/drone/push Build is failing
2023-01-16 01:44:47 +01:00
c2aa144483 ci: Add debug
Some checks reported errors
continuous-integration/drone/push Build was killed
2023-01-16 01:42:24 +01:00
ccbed63d42 ci: Add debug
Some checks reported errors
continuous-integration/drone/push Build was killed
2023-01-16 01:41:15 +01:00
e47e667fc6 ci: Add debug
Some checks reported errors
continuous-integration/drone/push Build was killed
2023-01-16 01:40:47 +01:00
ce0a5ba5e8 ci: Add debug 2023-01-16 01:36:17 +01:00
56ff8e2a0c ci: try to fix the repo name
Some checks failed
continuous-integration/drone/push Build is failing
2023-01-16 01:21:07 +01:00
e47f9c1e82 fix: make unzip quiet
Some checks failed
continuous-integration/drone/push Build is failing
2023-01-16 01:15:08 +01:00
b35ce6e142 ci: Initial import
Some checks failed
continuous-integration/drone Build is failing
2023-01-16 00:58:43 +01:00
fdd09cc808 doc: Add readme 2023-01-16 00:58:16 +01:00
44a540febf Fix configuration to prepare for the next version 2022-12-09 15:19:22 +01:00
de01e459f1 Revert to PHP 7.4 due to incompatibilities with dependencies 2022-04-13 15:23:29 +02:00
667c98ea3c Update compose.lock if needed 2022-04-13 15:09:06 +02:00
4f51237e2a Bump Dolibarr version to 15.0.1 2022-04-13 14:25:24 +02:00
97a08ec973 Bump PHP base image version to PHP 8.0 2022-04-13 14:25:04 +02:00
a12dfd4f52 Bump to 14.0.5 2022-02-28 16:34:55 +01:00
382603d2e3 Bump version to 14.0.1 & re-organize for better caching. 2021-09-09 21:18:14 +02:00
b466e8e4b4 CI/CD: fix duplicate argument 2021-07-01 13:03:24 +02:00
6a43b24044 CI/CD: fix duplicate argument 2021-07-01 13:01:50 +02:00
2d65ae1fb7 CI/CD: add alternative version tag 2021-07-01 12:56:28 +02:00
7147f1019d Update .gitlab-ci.yml file 2021-07-01 12:41:06 +02:00
b123b2eec7 Update .gitlab-ci.yml file 2021-07-01 10:36:51 +00:00
64060b1588 fix: add missing libzip-dev 2021-04-19 19:42:28 +02:00
180e0e8cd7 fix: remove useless option 2021-04-19 19:31:41 +02:00
be3de753c3 fix: change gd build options for PHP 7.4 2021-04-19 19:25:23 +02:00
04430d40ab Bump PHP & Dolibarr version 2021-04-19 19:14:32 +02:00
e21f508b8a Merge branch 'master' of github.com:glenux/glenuxnet-service-dolibarr 2021-04-08 00:39:29 +02:00
0f64c6f6d9 Revert php to 7.2 2021-02-01 00:23:30 +01:00
90f573d53f Revert php to 7.3 2021-02-01 00:14:59 +01:00
5c14290480 Bump version to v13 2021-02-01 00:10:41 +01:00
9bb279f7dc Bump to 12.0.1 2020-07-14 17:07:22 +02:00
7 changed files with 242 additions and 25 deletions

1
.dockerignore Normal file
View file

@ -0,0 +1 @@
.drone.yml

100
.drone.yml Normal file
View file

@ -0,0 +1,100 @@
---
kind: pipeline
type: docker
name: default
steps:
- name: debug
image: alpine
environment:
commands:
- 'echo "Repository: glenux/service-dolibarr"'
- 'echo "Git commit: ${DRONE_COMMIT_SHA:0:8}"'
- name: publish:commit_sha
image: plugins/docker
# pull: never
# volumes:
# - name: cache
# path: /stupid
environment:
DOCKER_REPO: glenux/service-dolibarr
settings:
username:
from_secret: DOCKERHUB_USERNAME
password:
from_secret: DOCKERHUB_PASSWORD
cache_from: "glenux/service-dolibarr:latest_${DRONE_BRANCH/\\//-}"
repo: glenux/service-dolibarr
tags: "${DRONE_COMMIT_SHA:0:8}"
purge: false
- name: publish:commit_branch
image: plugins/docker
# volumes:
# - name: cache
# path: /stupid
settings:
username:
from_secret: DOCKERHUB_USERNAME
password:
from_secret: DOCKERHUB_PASSWORD
cache_from: "glenux/service-dolibarr:${DRONE_BRANCH/\\//-}_latest"
repo: glenux/service-dolibarr
tags:
- "${DRONE_BRANCH/\\//-}_latest"
- "${DRONE_BRANCH/\\//-}_${DRONE_COMMIT_SHA:0:8}"
purge: false
when:
branch:
- "master"
- "develop"
- "feature/*"
- name: publish:latest
image: plugins/docker
settings:
username:
from_secret: DOCKERHUB_USERNAME
password:
from_secret: DOCKERHUB_PASSWORD
cache_from: "glenux/service-dolibarr:${DRONE_BRANCH/\\//-}_latest"
repo: glenux/service-dolibarr
tags: latest
purge: false
when:
branch:
- master
- name: deploy:dokku
image: alpine
when:
branch:
- master
environment:
SSH_USER:
from_secret: SSH_USER
SSH_HOST:
from_secret: SSH_HOST
SSH_PRIVATE_KEY:
from_secret: SSH_PRIVATE_KEY
commands:
- echo $SSH_USER
- echo $SSH_HOST
- echo $SSH_PRIVATE_KEY
- apk update && apk add openssh-client
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
- echo "$SSH_PRIVATE_KEY" | base64 -d > ~/.ssh/deploy_key
- chmod 600 ~/.ssh/deploy_key
- |
ssh -o StrictHostKeyChecking=no \
-i ~/.ssh/deploy_key \
"$SSH_USER@$SSH_HOST" \
git:from-image erp \
"glenux/service-dolibarr:${DRONE_COMMIT_SHA:0:8}"
# volumes:
# - name: cache
# temp: {}
#

86
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,86 @@
---
# This file is a template, and might need editing before it works on your
# project. To contribute improvements to CI/CD templates, please follow the
# Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
#
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml
# This is a sample GitLab CI/CD configuration file that should run without any
# modifications. It demonstrates a basic 3 stage CI/CD pipeline. Instead of
# real tests or scripts, it uses echo commands to simulate the pipeline
# execution.
#
# A pipeline is composed of independent jobs that run scripts, grouped into
# stages. Stages run in sequential order, but jobs within stages run in
# parallel.
#
# For more information, see:
# https://docs.gitlab.com/ee/ci/yaml/README.html#stages
# List of stages for jobs, and their order of execution
stages:
- build
- test
- deploy
build-docker-image: # This job runs in the build stage, which runs first.
stage: build
image: docker:latest
services:
- docker:dind
before_script:
- docker login
-u "$CI_REGISTRY_USER"
-p "$CI_REGISTRY_PASSWORD"
$CI_REGISTRY
- export VERSION="$(echo
"${CI_COMMIT_BRANCH}_$(date +%Y%m%dT%H%M%S)_${CI_COMMIT_SHA:0:8}"
|sed 's,/,--,g')"
# Default branch leaves tag empty (= latest tag)
# All other branches are tagged with the escaped branch name (commit ref slug)
script:
- |
if [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]; then
tag=""
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
else
tag=":$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
fi
- docker build
--pull
--file Dockerfile
--tag "$CI_REGISTRY_IMAGE${tag}"
--tag "$CI_REGISTRY_IMAGE:$VERSION"
.
- docker push "$CI_REGISTRY_IMAGE${tag}"
- docker push "$CI_REGISTRY_IMAGE:$VERSION"
# Run this job in a branch where a Dockerfile exists
rules:
- if: $CI_COMMIT_BRANCH
exists:
- Dockerfile
# This job runs in the test stage.
# unit-test-job:
# # It only starts when the job in the build stage completes successfully.
# stage: test
# script:
# - echo "Running unit tests... This will take about 60 seconds."
# - sleep 60
# - echo "Code coverage is 90%"
# lint-test-job: # This job also runs in the test stage.
# stage: test # It can run at the same time as unit-test-job (in parallel).
# script:
# - echo "Linting code... This will take about 10 seconds."
# - sleep 10
# - echo "No lint issues found."
# deploy-job: # This job runs in the deploy stage.
# stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
# script:
# - echo "Deploying application..."
# - echo "Application successfully deployed."

View file

@ -1,49 +1,67 @@
FROM php:7.2-apache-buster FROM php:8.1-apache-bookworm
# FROM php:7.4-apache-buster
MAINTAINER Glenn ROLLAND <glenux@glenux.net> MAINTAINER Glenn ROLLAND <glenux@glenux.net>
ENV DOLIBARR_VERSION=12.0.1
RUN apt-get update \ RUN apt-get update \
&& apt-cache search lib mysql dev$ \ && apt-cache search lib mysql dev$ \
&& apt-get install -y \ && apt-get install -y \
wget unzip curl \ unzip curl \
libfreetype6-dev \ libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libmariadb-dev \
zlib1g-dev \
libicu-dev \ libicu-dev \
libjpeg62-turbo-dev \
libmariadb-dev \
libpng-dev \
libzip-dev \
libc-client-dev \
libkrb5-dev \
zlib1g-dev \
&& apt-get autoremove -y \ && apt-get autoremove -y \
&& docker-php-ext-install -j$(nproc) iconv \ && docker-php-ext-install -j$(nproc) iconv \
&& docker-php-ext-configure intl \ && docker-php-ext-configure intl \
&& docker-php-ext-install -j$(nproc) intl \ && docker-php-ext-install -j$(nproc) intl \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ && docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd \ && docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-install pdo pdo_mysql mysqli \ && docker-php-ext-install pdo pdo_mysql mysqli \
&& docker-php-ext-install calendar \ && docker-php-ext-install calendar \
&& docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
&& docker-php-ext-install imap \
&& docker-php-ext-install zip && docker-php-ext-install zip
COPY php-uploads.ini /usr/local/etc/php/conf.d/glenux-uploads.ini
COPY php-performance.ini /usr/local/etc/php/conf.d/glenux-performance.ini
COPY php-errors.ini /usr/local/etc/php/conf.d/glenux-errors.ini
RUN curl -sS https://getcomposer.org/installer \ RUN curl -sS https://getcomposer.org/installer \
| php -- --install-dir=/usr/local/bin --filename=composer | php -- --install-dir=/usr/local/bin --filename=composer
RUN wget \ ENV DOLIBARR_VERSION=19.0.2
-O /tmp/dolibarr-${DOLIBARR_VERSION}.zip \ # ENV DOLIBARR_VERSION=18.0.4
https://github.com/Dolibarr/dolibarr/archive/${DOLIBARR_VERSION}.zip # ENV DOLIBARR_VERSION=17.0.2
# ENV DOLIBARR_VERSION=16.0.4
# https://github.com/Dolibarr/dolibarr/archive/${DOLIBARR_VERSION}.zip
# https://freefr.dl.sourceforge.net/project/dolibarr/Dolibarr%20ERP-CRM/${DOLIBARR_VERSION}/dolibarr-${DOLIBARR_VERSION}.zip
RUN curl -sS \
https://freefr.dl.sourceforge.net/project/dolibarr/Dolibarr%20ERP-CRM/${DOLIBARR_VERSION}/dolibarr-${DOLIBARR_VERSION}.zip \
-o /tmp/dolibarr-${DOLIBARR_VERSION}.zip
RUN unzip -d /usr/src /tmp/dolibarr-${DOLIBARR_VERSION}.zip \ RUN unzip -q -d /usr/src /tmp/dolibarr-${DOLIBARR_VERSION}.zip \
&& chown -R www-data:www-data /usr/src/dolibarr-${DOLIBARR_VERSION} \ && chown -R www-data:www-data /usr/src/dolibarr-${DOLIBARR_VERSION} \
&& rm -fr /var/www/html \ && rm -fr /var/www/html \
&& cp -a /usr/src/dolibarr-${DOLIBARR_VERSION} /var/www/html && cp -a /usr/src/dolibarr-${DOLIBARR_VERSION} /var/www/html
ADD php-uploads.ini /usr/local/etc/php/conf.d/glenux-uploads.ini
ADD php-performance.ini /usr/local/etc/php/conf.d/glenux-performance.ini
ADD php-errors.ini /usr/local/etc/php/conf.d/glenux-errors.ini
RUN sed \
-i 's|/var/www/html|/var/www/html/htdocs|' \
/etc/apache2/sites-enabled/000-default.conf
WORKDIR /var/www/html WORKDIR /var/www/html
CMD composer install && apache2-foreground # RUN pwd \
# && ls -lh \
# && mv composer.json.disabled composer.json \
# && composer install
# Fix configuration
RUN sed -i 's|/var/www/html|/var/www/html/htdocs|' \
/etc/apache2/sites-enabled/000-default.conf \
&& sed -i 's|^Timeout .*|Timeout 1200|' \
/etc/apache2/apache2.conf
CMD ["apache2-foreground"]

7
README.md Normal file
View file

@ -0,0 +1,7 @@
Ref: https://wiki.dolibarr.org/index.php?title=Setup_Other
PROJECT_ALLOW_COMMENT_ON_TASK
PROJECT_ALLOW_COMMENT_ON_PROJECT

View file

@ -1,6 +1,11 @@
error_reporting = E_ALL & ~E_WARNING & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED error_reporting = E_ALL & ~E_WARNING & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
display_errors = Off
log_errors = On log_errors = On
error_log = /dev/stderr
## For production
# display_errors = Off
# error_log = /dev/stderr
## For debugging
display_errors = On
error_log = /var/log/php-errors.log

View file

@ -1,5 +1,5 @@
file_uploads = On file_uploads = On
upload_max_filesize = 128M upload_max_filesize = 128M
post_max_size = 128M post_max_size = 128M
max_execution_time = 600 max_execution_time = 1200
max_input_time = 120 max_input_time = 120