Compare commits

..

No commits in common. "develop" and "master-v12" have entirely different histories.

5 changed files with 15 additions and 224 deletions

View file

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

View file

@ -1,98 +0,0 @@
---
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:latest_${DRONE_BRANCH/\\//-}"
repo: glenux/service-dolibarr
tags: "latest_${DRONE_BRANCH/\\//-}"
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:latest_${DRONE_BRANCH/\\//-}"
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: {}
#

View file

@ -1,86 +0,0 @@
---
# 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,66 +1,49 @@
FROM php:8.1-apache-buster
# FROM php:7.4-apache-buster
FROM php:7.2-apache-buster
MAINTAINER Glenn ROLLAND <glenux@glenux.net>
ENV DOLIBARR_VERSION=12.0.1
RUN apt-get update \
&& apt-cache search lib mysql dev$ \
&& apt-get install -y \
unzip curl \
wget unzip curl \
libfreetype6-dev \
libicu-dev \
libjpeg62-turbo-dev \
libmariadb-dev \
libpng-dev \
libzip-dev \
libc-client-dev \
libkrb5-dev \
libmariadb-dev \
zlib1g-dev \
libicu-dev \
&& apt-get autoremove -y \
&& docker-php-ext-install -j$(nproc) iconv \
&& docker-php-ext-configure intl \
&& docker-php-ext-install -j$(nproc) intl \
&& docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-install pdo pdo_mysql mysqli \
&& 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
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 \
| php -- --install-dir=/usr/local/bin --filename=composer
ENV DOLIBARR_VERSION=19.0.1
# ENV DOLIBARR_VERSION=18.0.4
# 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 wget \
-O /tmp/dolibarr-${DOLIBARR_VERSION}.zip \
https://github.com/Dolibarr/dolibarr/archive/${DOLIBARR_VERSION}.zip
RUN unzip -q -d /usr/src /tmp/dolibarr-${DOLIBARR_VERSION}.zip \
RUN unzip -d /usr/src /tmp/dolibarr-${DOLIBARR_VERSION}.zip \
&& chown -R www-data:www-data /usr/src/dolibarr-${DOLIBARR_VERSION} \
&& rm -fr /var/www/html \
&& cp -a /usr/src/dolibarr-${DOLIBARR_VERSION} /var/www/html
WORKDIR /var/www/html
# RUN pwd \
# && ls -lh \
# && mv composer.json.disabled composer.json \
# && composer install
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
CMD ["apache2-foreground"]
CMD composer install && apache2-foreground

View file

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