Update to 2021-08-05 18:00

master
Daniel Berteaud 3 years ago
parent 0f30a53140
commit 46ba09dfc1
  1. 10
      roles/akeneo_pim/tasks/archive_post.yml
  2. 11
      roles/akeneo_pim/tasks/archive_pre.yml
  3. 8
      roles/akeneo_pim/tasks/cleanup.yml
  4. 24
      roles/akeneo_pim/tasks/conf.yml
  5. 16
      roles/akeneo_pim/tasks/install.yml
  6. 3
      roles/akeneo_pim/tasks/main.yml

@ -0,0 +1,10 @@
---
- name: Compress previous version
command: tar cf {{ pim_root_dir }}/archives/{{ pim_current_version }}.tar.zst ./ --use-compress-program=zstd
args:
chdir: "{{ pim_root_dir }}/archives/{{ pim_current_version }}"
warn: False
environment:
ZSTD_CLEVEL: 10
tags: pim

@ -4,6 +4,17 @@
file: path={{ pim_root_dir }}/archives/{{ pim_current_version }} state=directory
tags: pim
- name: Stop jobs and event API services
service: name={{ item }} state=stopped
loop:
- akeneo-pim_{{ pim_id }}-jobs
- akeneo-pim_{{ pim_id }}-events-api
tags: pim
- name: Disable cron jobs
file: path=/etc/cron.d/akeneopim_{{ pim_id }} state=absent
tags: pim
- name: Archive current version
synchronize:
src: "{{ pim_root_dir }}/app"

@ -0,0 +1,8 @@
---
- name: Remove tmp and obsolete files
file: path={{ item }} state=absent
loop:
- "{{ pim_root_dir }}/archives/{{ pim_current_version }}"
tags: pim

@ -11,16 +11,36 @@
- php_fpm_pool: "{{ pim_php_fpm_pool | default('') }}"
tags: pim
- name: Build assets
command: scl enable php{{ pim_php_version }} -- make prod
- name: Build and update frontend components
command: scl enable php{{ pim_php_version }} -- make upgrade-front
args:
chdir: "{{ pim_root_dir }}/app"
environment:
NO_DOCKER: true
APP_ENV: prod
become_user: "{{ pim_user }}"
when: pim_install_mode != 'none'
tags: pim
- name: Initialize the database
command: scl enable php{{ pim_php_version }} -- make database O="--catalog vendor/akeneo/pim-community-dev/src/Akeneo/Platform/Bundle/InstallerBundle/Resources/fixtures/minimal"
args:
chdir: "{{ pim_root_dir }}/app"
environment:
NO_DOCKER: true
APP_ENV: prod
become_user: "{{ pim_user }}"
when: pim_install_mode == 'install'
tags: pim
- name: Upgrade database
command: /bin/php{{ pim_php_version }} {{ pim_root_dir }}/app/bin/console doctrine:migrations:migrate --no-interaction
args:
chdir: "{{ pim_root_dir }}/app"
become_user: "{{ pim_user }}"
when: pim_install_mode == 'upgrade'
tags: pim
- name: Deploy permission script
template: src=perms.sh.j2 dest={{ pim_root_dir }}/perms.sh mode=755
register: pim_perm_script

@ -4,25 +4,21 @@
package:
name:
- make
- ghostscript
- aspell
tags: pim
- when: pim_install_mode == 'upgrade'
block:
- name: Stop jobs and event API services
service: name={{ item }} state=stopped
loop:
- akeneo-pim_{{ pim_id }}-jobs
- akeneo-pim_{{ pim_id }}-events-api
- name: Disable cron jobs
file: path=/etc/cron.d/akeneopim_{{ pim_id }} state=absent
- name: Wipe install on upgrades
file: path={{ pim_root_dir }}/app state=absent
- name: Create app subdir
file: path={{ pim_root_dir }}/app state=directory owner={{ pim_user }} group={{ pim_user }}
- name: Link the var directory
file: src={{ pim_root_dir }}/data dest={{ pim_root_dir }}/app/var state=link
tags: pim
- when: pim_install_mode != 'none'
@ -43,12 +39,14 @@
name: yarn
path: "{{ pim_root_dir }}/app"
global: True
state: latest
- name: Install typescript globaly
npm:
name: typescript
path: "{{ pim_root_dir }}/app"
global: True
state: latest
tags: pim

@ -8,3 +8,6 @@
- include: install.yml
- include: conf.yml
- include: write_version.yml
- include: archive_post.yml
when: pim_install_mode == 'upgrade'
- include: cleanup.yml

Loading…
Cancel
Save