This repository was archived by the owner on Feb 13, 2023. It is now read-only.
File tree 4 files changed +36
-17
lines changed 4 files changed +36
-17
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,12 @@ drupal_composer_path: "{{ config_dir }}/drupal.composer.json"
47
47
drupal_composer_install_dir : " /var/www/drupalvm/drupal"
48
48
drupal_composer_dependencies : []
49
49
50
+ # Set this to 'true' and 'build_makefile' as well as 'build_composer' to
51
+ # 'false' you are using Composer's create-project as a site deployment strategy.
52
+ build_composer_project : false
53
+ drupal_composer_project_package : " "
54
+ drupal_composer_project_options : " --prefer-dist --stability dev --no-interaction"
55
+
50
56
# Set this to 'false' if you don't need to install drupal (using the drupal_*
51
57
# settings below), but instead copy down a database (e.g. using drush sql-sync).
52
58
install_site : true
Original file line number Diff line number Diff line change 100
100
- include : tasks/build-composer.yml
101
101
when : build_composer
102
102
103
+ # Build a composer project if configured.
104
+ - include : tasks/build-composer-project.yml
105
+ when : build_composer_project
106
+
103
107
# Install site if configured.
104
108
- include : tasks/install-site.yml
105
109
when : install_site
Original file line number Diff line number Diff line change
1
+ ---
2
+ - name : Generate Drupal project with composer package.
3
+ command : >
4
+ {{ composer_path }} create-project
5
+ {{ drupal_composer_project_package }} {{ drupal_composer_install_dir }}
6
+ {{ drupal_composer_project_options|default('--prefer-dist --no-interaction') }}
7
+ when : not drupal_site_exists
8
+ become : no
9
+
10
+ - name : Install dependencies with composer require.
11
+ command : >
12
+ {{ composer_path }} require {{ item }}
13
+ chdir={{ drupal_composer_install_dir }}
14
+ with_items : " {{ drupal_composer_dependencies|default([]) }}"
15
+ become : no
Original file line number Diff line number Diff line change 1
1
---
2
+ - name : Ensure drupal_composer_install_dir directory exists.
3
+ file :
4
+ path : " {{ drupal_composer_install_dir }}"
5
+ state : directory
6
+ mode : 0775
7
+ become : no
8
+ when : drupal_composer_path and not drupal_site_exists
9
+
2
10
- name : Copy composer.json into place.
3
11
copy :
4
12
src : " {{ drupal_composer_path }}"
5
13
dest : " {{ drupal_composer_install_dir }}/composer.json"
6
- when : drupal_composer_path is defined and not drupal_site_exists
14
+ when : drupal_composer_path and not drupal_site_exists
7
15
become : no
8
16
9
- - name : Check if composer.json exists.
10
- stat : " path={{ drupal_composer_install_dir }}/composer.json"
11
- register : drupal_composer_file
12
-
13
- - name : Run composer install if composer.json exists.
17
+ - name : Run composer install.
14
18
command : >
15
19
composer install
16
20
chdir={{ drupal_composer_install_dir }}
17
- when : drupal_composer_file.stat.exists and not drupal_site_exists
18
- become : no
19
-
20
- - name : Generate Drupal project with composer package.
21
- command : >
22
- {{ composer_path }} create-project
23
- {{ drupal_composer_project_package }} {{ drupal_composer_install_dir }}
24
- --prefer-dist
25
- --stability dev
26
- --no-interaction
27
- when : drupal_composer_project_package and not drupal_composer_file.stat.exists and not drupal_site_exists
21
+ when : not drupal_site_exists
28
22
become : no
29
23
30
24
- name : Install dependencies with composer require.
You can’t perform that action at this time.
0 commit comments