Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIM-10185 #1702

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
35 changes: 1 addition & 34 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM debian:buster-slim
FROM akeneo/pim-php-dev:5.0
WORKDIR /home/akeneo/pim-docs/
ENV DEBIAN_FRONTEND=noninteractive

RUN echo 'APT::Install-Recommends "0" ; APT::Install-Suggests "0" ;' > /etc/apt/apt.conf.d/01-no-recommended && \
echo 'path-exclude=/usr/share/man/*' > /etc/dpkg/dpkg.cfg.d/path_exclusions && \
echo 'path-exclude=/usr/share/doc/*' >> /etc/dpkg/dpkg.cfg.d/path_exclusions && \
Expand All @@ -15,40 +14,8 @@ RUN echo 'APT::Install-Recommends "0" ; APT::Install-Suggests "0" ;' > /etc/apt/
python ssh rsync curl \
python-jinja2 \
python-sphinx && \
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \
sh -c 'echo "deb https://packages.sury.org/php/ buster main" > /etc/apt/sources.list.d/php.list' && \
apt-get update && \
apt-get install -y --no-install-recommends \
php7.4-apcu php7.4-bcmath php7.4-cli php7.4-curl php7.4-fpm \
php7.4-gd php7.4-intl php7.4-mysql php7.4-xml php7.4-zip php7.4-mbstring && \
echo "memory_limit = 1024M" >> /etc/php/7.4/cli/php.ini && \
echo "date.timezone = UTC" >> /etc/php/7.4/cli/php.ini && \
apt-get clean && apt-get --yes --quiet autoremove --purge && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/* && \
rm -rf /usr/share/locale/* && \
rm -rf /var/log/*

COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
RUN chmod +x /usr/local/bin/composer

# Install Akeneo PIM Assets
RUN \
#
# Get PIM CE edition
#
wget https://github.com/akeneo/pim-community-dev/archive/master.zip -P /home/akeneo/pim-docs/ && \
unzip /home/akeneo/pim-docs/master.zip -d /home/akeneo/pim-docs/ && \
cd /home/akeneo/pim-docs/pim-community-dev-master/ && \
#
# Install dependencies
#
php -d memory_limit=3G /usr/local/bin/composer install --no-suggest --ignore-platform-reqs && \
cd /home/akeneo/pim-docs/pim-community-dev-master/ && php bin/console pim:installer:assets --env=prod && \
mkdir /home/akeneo/pim-docs/pim-community-dev-master/public/css && \
wget http://demo.akeneo.com/css/pim.css -P /home/akeneo/pim-docs/pim-community-dev-master/public/css && \
#
# Cleanup
#
rm -rf /root/.composer/cache && \
cd /home/akeneo/pim-docs/pim-community-dev-master/ && ls | grep -v "vendor\|public" | xargs rm -rf
27 changes: 19 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
UID = $(shell id -u)
GID = $(shell id -g)
DOCKER_IMAGE = pim-docs
DOCKER_RUN = docker run -it --rm -u $(UID):$(GID) -v $(PWD):/home/akeneo/pim-docs/data
DOCKER_RSYNC = $(DOCKER_RUN) -v /etc/passwd:/etc/passwd:ro -v $${SSH_AUTH_SOCK}:/ssh-auth.sock:ro -e SSH_AUTH_SOCK=/ssh-auth.sock $(DOCKER_IMAGE) rsync -e "ssh -q -p $${DEPLOY_PORT} -o StrictHostKeyChecking=no" -qarz --delete
DOCKER_PIM_DOCS_RUN = docker run -it --rm -u $(UID):$(GID) -v $(PWD):/home/akeneo/pim-docs/data
DOCKER_PIM_CE_RUN= docker run -it --rm -u $(UID):$(GID) -v $(PWD)/_build:/home/akeneo/ce
DOCKER_RSYNC = $(DOCKER_PIM_DOCS_RUN) -v /etc/passwd:/etc/passwd:ro -v $${SSH_AUTH_SOCK}:/ssh-auth.sock:ro -e SSH_AUTH_SOCK=/ssh-auth.sock $(DOCKER_IMAGE) rsync -e "ssh -q -p $${DEPLOY_PORT} -o StrictHostKeyChecking=no" -qarz --delete

.DEFAULT_GOAL := build
.PHONY: build, deploy, docker-build, update-versions
Expand All @@ -13,22 +14,32 @@ build: lint
# -W Turn warnings into errors. This means that the build stops at the first warning and sphinx-build exits with exit status 1.
# -T Displays the full stack trace if an unhandled exception occurs.
# -b Linkcheck builder checks for broken links.
$(DOCKER_RUN) $(DOCKER_IMAGE) sphinx-build -nWT -b html /home/akeneo/pim-docs/data /home/akeneo/pim-docs/data/pim-docs-build
$(DOCKER_RUN) $(DOCKER_IMAGE) cp -L -r /home/akeneo/pim-docs/pim-community-dev-master/public /home/akeneo/pim-docs/data/pim-docs-build/
$(DOCKER_PIM_DOCS_RUN) $(DOCKER_IMAGE) sphinx-build -nWT -b html /home/akeneo/pim-docs/data /home/akeneo/pim-docs/data/pim-docs-build
cp -L -r ./_build/pim-community-dev/public ./pim-docs-build/
@echo "\nYou are now ready to check the documentation locally in the directory \"pim-docs-build/\" and to deploy it with \"DEPLOY_HOSTNAME=foo.com DEPLOY_PORT=1985 VERSION=bar make deploy\"."

deploy: build update-versions
$(DOCKER_RUN) -v /etc/passwd:/etc/passwd:ro -v $${SSH_AUTH_SOCK}:/ssh-auth.sock:ro -e SSH_AUTH_SOCK=/ssh-auth.sock $(DOCKER_IMAGE) rsync -e "ssh -q -p $${DEPLOY_PORT} -o StrictHostKeyChecking=no" -qarz --delete /home/akeneo/pim-docs/data/pim-docs-build/ akeneo@$${DEPLOY_HOSTNAME}:/var/www/${VERSION}
$(DOCKER_PIM_DOCS_RUN) -v /etc/passwd:/etc/passwd:ro -v $${SSH_AUTH_SOCK}:/ssh-auth.sock:ro -e SSH_AUTH_SOCK=/ssh-auth.sock $(DOCKER_IMAGE) rsync -e "ssh -q -p $${DEPLOY_PORT} -o StrictHostKeyChecking=no" -qarz --delete /home/akeneo/pim-docs/data/pim-docs-build/ akeneo@$${DEPLOY_HOSTNAME}:/var/www/${VERSION}

lint: docker-build
lint: dependencies
rm -rf pim-docs-build && mkdir pim-docs-build
rm -rf pim-docs-lint && mkdir pim-docs-lint
$(DOCKER_RUN) -v $(PWD):/home/akeneo/pim-docs/data $(DOCKER_IMAGE) sphinx-build -nWT -b linkcheck /home/akeneo/pim-docs/data /home/akeneo/pim-docs/data/pim-docs-lint
$(DOCKER_PIM_DOCS_RUN) -v $(PWD):/home/akeneo/pim-docs/data $(DOCKER_IMAGE) sphinx-build -nWT -b linkcheck /home/akeneo/pim-docs/data /home/akeneo/pim-docs/data/pim-docs-lint

dependencies: docker-build
rm -rf _build && mkdir _build
$(DOCKER_PIM_CE_RUN) $(DOCKER_IMAGE) wget https://github.com/akeneo/pim-community-dev/archive/5.0.zip -P /home/akeneo/ce
$(DOCKER_PIM_CE_RUN) -w /home/akeneo/ce $(DOCKER_IMAGE) unzip /home/akeneo/ce/5.0.zip
mv _build/pim-community-dev-5.0 _build/pim-community-dev
$(DOCKER_PIM_CE_RUN) -w /home/akeneo/ce/pim-community-dev $(DOCKER_IMAGE) php -d memory_limit=3G /usr/local/bin/composer install --no-suggest --ignore-platform-reqs
$(DOCKER_PIM_CE_RUN) -w /home/akeneo/ce/pim-community-dev $(DOCKER_IMAGE) php bin/console pim:installer:assets --env=prod
mkdir $(PWD)/_build/pim-community-dev/public/css
$(DOCKER_PIM_CE_RUN) $(DOCKER_IMAGE) wget http://demo.akeneo.com/css/pim.css -P /home/akeneo/ce/pim-community-dev/public/css

docker-build:
docker build . --tag $(DOCKER_IMAGE)

update-versions:
$(DOCKER_RSYNC) akeneo@$${DEPLOY_HOSTNAME}:/var/www/versions.json /home/akeneo/pim-docs/data
$(DOCKER_RUN) -w /home/akeneo/pim-docs/data $(DOCKER_IMAGE) php scripts/update-doc-versions.php $(CIRCLE_BRANCH) versions.json
$(DOCKER_PIM_DOCS_RUN) -w /home/akeneo/pim-docs/data $(DOCKER_IMAGE) php scripts/update-doc-versions.php $(CIRCLE_BRANCH) versions.json
$(DOCKER_RSYNC) /home/akeneo/pim-docs/data/versions.json akeneo@$${DEPLOY_HOSTNAME}:/var/www/
2 changes: 1 addition & 1 deletion cloud_edition/flexibility_mode/docs/disk_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ This command will not remove thumbnails generated for preview, if you also want

.. code-block:: bash

php bin/console akeneo:asset-manager:thumbnail-cache:clear
php bin/console akeneo:asset-manager:thumbnail-cache:clear --all


.. warning::
Expand Down
2 changes: 1 addition & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['vendor/**/*', 'ee_dev/**/*']
exclude_patterns = ['vendor/**/*', 'ee_dev/**/*','_build/**/*']

# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
Expand Down
3 changes: 3 additions & 0 deletions maintain_pim/first_aid_kit/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ Clear the PIM cache (also known as "Symfony cache") by running the following com
cd /path/to/your/pim/
php bin/console cache:clear --env=prod --no-warmup


You could use the command `partners_clear_cache` if you are on a Akeneo Cloud Offer. You can find more commands in our `_System Administration & Services Management page <https://docs.akeneo.com/4.0/cloud_edition/flexibility_mode/docs/system_administration.html>`__.

Step 9: did you consider the volume of your catalog?
----------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,4 @@ If you want to add your own format, you have to configure it in your `app/config
- { value: 'dd/MM/yyyy', label: 'dd/mm/yyyy' }
- { value: 'dd.MM.yyyy', label: 'dd.mm.yyyy' }


The key "value" has to contain characters defined in https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/classicu_1_1SimpleDateFormat.html#details .
The key "value" has to contain characters defined in https://unicode-org.github.io/icu/userguide/format_parse/datetime/ .