1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/tests/integration/targets/django_manage/tasks/main.yaml
patchback[bot] c0008e976f
CI: Add ArchLinux, Debian Bullseye, CentOS Stream 8, and Alpine 3 (#4222) (#4244)
* Add ArchLinux, Debian Bullseye and CentOS Stream 8 to CI.

* Add Alpine to CI matrix as well.

(cherry picked from commit a06903f33a)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-02-22 09:08:35 +00:00

68 lines
2.1 KiB
YAML

# Test code for django_manage module
#
# Copyright: (c) 2020, Alexei Znamensky <russoz@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
- name: Create temporary test directory
tempfile:
state: directory
suffix: .django_manage
register: tmp_django_root
- name: Install virtualenv
package:
name: virtualenv
state: present
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '8'
- name: Install virtualenv
package:
name: python-virtualenv
state: present
when: ansible_os_family == 'Archlinux'
- name: Install required library
pip:
name: django
state: present
virtualenv: "{{ tmp_django_root.path }}/venv"
- name: Copy files
copy:
src: base_test/
dest: "{{ tmp_django_root.path }}"
mode: preserve
- name: Create project
command:
chdir: "{{ tmp_django_root.path }}/startproj"
cmd: "{{ tmp_django_root.path }}/venv/bin/django-admin startproject test_django_manage_1"
- name: Create app
command:
chdir: "{{ tmp_django_root.path }}/startproj"
cmd: "{{ tmp_django_root.path }}/venv/bin/django-admin startapp app1"
- name: Check
community.general.django_manage:
project_path: "{{ tmp_django_root.path }}/startproj/test_django_manage_1"
command: check
virtualenv: "{{ tmp_django_root.path }}/venv"
- name: Check simple_project
community.general.django_manage:
project_path: "{{ tmp_django_root.path }}/simple_project/p1"
command: check
virtualenv: "{{ tmp_django_root.path }}/venv"
- name: Check custom project
community.general.django_manage:
project_path: "{{ tmp_django_root.path }}/1045-single-app-project/single_app_project"
pythonpath: "{{ tmp_django_root.path }}/1045-single-app-project/"
command: check
virtualenv: "{{ tmp_django_root.path }}/venv"
- name: Run collectstatic --noinput on simple project
community.general.django_manage:
project_path: "{{ tmp_django_root.path }}/simple_project/p1"
command: collectstatic --noinput
virtualenv: "{{ tmp_django_root.path }}/venv"