Compare commits
No commits in common. "d1e81d12be9d8330a9273dbeef72163db977655d" and "f059fb76f9a5e8c27cb8ca22a352f4760e1950e8" have entirely different histories.
d1e81d12be
...
f059fb76f9
6 changed files with 19 additions and 232 deletions
|
@ -1 +0,0 @@
|
||||||
.drone.yml
|
|
98
.drone.yml
98
.drone.yml
|
@ -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: {}
|
|
||||||
#
|
|
|
@ -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."
|
|
57
Dockerfile
57
Dockerfile
|
@ -1,63 +1,42 @@
|
||||||
FROM php:8.1-apache-buster
|
FROM php:7.1-apache
|
||||||
# FROM php:7.4-apache-buster
|
|
||||||
MAINTAINER Glenn ROLLAND <glenux@glenux.net>
|
MAINTAINER Glenn ROLLAND <glenux@glenux.net>
|
||||||
|
|
||||||
|
|
||||||
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 \
|
wget unzip curl \
|
||||||
libfreetype6-dev \
|
libfreetype6-dev \
|
||||||
libicu-dev \
|
|
||||||
libjpeg62-turbo-dev \
|
libjpeg62-turbo-dev \
|
||||||
libmariadb-dev \
|
|
||||||
libpng-dev \
|
libpng-dev \
|
||||||
libzip-dev \
|
libmysql++-dev \
|
||||||
libc-client-dev \
|
|
||||||
libkrb5-dev \
|
|
||||||
zlib1g-dev \
|
zlib1g-dev \
|
||||||
&& apt-get autoremove -y \
|
&& apt-get autoremove \
|
||||||
&& docker-php-ext-install -j$(nproc) iconv \
|
&& docker-php-ext-install -j$(nproc) iconv \
|
||||||
&& docker-php-ext-configure intl \
|
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
|
||||||
&& docker-php-ext-install -j$(nproc) intl \
|
|
||||||
&& 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-configure imap --with-kerberos --with-imap-ssl \
|
|
||||||
&& docker-php-ext-install imap \
|
|
||||||
&& docker-php-ext-install zip
|
&& docker-php-ext-install zip
|
||||||
|
|
||||||
|
RUN curl -sS https://getcomposer.org/installer \
|
||||||
|
| php -- --install-dir=/usr/local/bin --filename=composer
|
||||||
|
|
||||||
|
RUN wget \
|
||||||
|
-O /tmp/dolibarr-8.0.4.zip \
|
||||||
|
https://github.com/Dolibarr/dolibarr/archive/8.0.4.zip
|
||||||
|
|
||||||
|
RUN unzip -d /usr/src /tmp/dolibarr-8.0.4.zip \
|
||||||
|
&& chown -R www-data:www-data /usr/src/dolibarr-8.0.4 \
|
||||||
|
&& rm -fr /var/www/html \
|
||||||
|
&& cp -a /usr/src/dolibarr-8.0.4 /var/www/html
|
||||||
|
|
||||||
ADD php-uploads.ini /usr/local/etc/php/conf.d/glenux-uploads.ini
|
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-performance.ini /usr/local/etc/php/conf.d/glenux-performance.ini
|
||||||
ADD php-errors.ini /usr/local/etc/php/conf.d/glenux-errors.ini
|
ADD 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=18.0.4
|
|
||||||
# ENV DOLIBARR_VERSION=17.0.2
|
|
||||||
# ENV DOLIBARR_VERSION=16.0.4
|
|
||||||
RUN wget -q \
|
|
||||||
-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 \
|
|
||||||
&& 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
|
|
||||||
|
|
||||||
RUN sed \
|
RUN sed \
|
||||||
-i 's|/var/www/html|/var/www/html/htdocs|' \
|
-i 's|/var/www/html|/var/www/html/htdocs|' \
|
||||||
/etc/apache2/sites-enabled/000-default.conf
|
/etc/apache2/sites-enabled/000-default.conf
|
||||||
|
|
||||||
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
CMD apache2-foreground
|
CMD composer install && apache2-foreground
|
||||||
|
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
Ref: https://wiki.dolibarr.org/index.php?title=Setup_Other
|
|
||||||
|
|
||||||
PROJECT_ALLOW_COMMENT_ON_TASK
|
|
||||||
PROJECT_ALLOW_COMMENT_ON_PROJECT
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ services:
|
||||||
networks:
|
networks:
|
||||||
- backend
|
- backend
|
||||||
volumes:
|
volumes:
|
||||||
- dolibar-config:/var/www/html/htdocs/conf
|
- dolibar-config:/var/www/html/conf
|
||||||
- dolibar-documents:/var/www/html/documents
|
- dolibar-documents:/var/www/html/documents
|
||||||
|
|
||||||
adminer:
|
adminer:
|
||||||
|
|
Loading…
Reference in a new issue