Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit 6298a53

Browse files
committed
Fixes #1335: Update Drupal Console Role so it works correctly with rc17 and beyond.
1 parent f1c07ee commit 6298a53

File tree

12 files changed

+67
-51
lines changed

12 files changed

+67
-51
lines changed

provisioning/requirements.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
- src: geerlingguy.drupal
2121
version: 2.2.1
2222
- src: geerlingguy.drupal-console
23-
version: 1.0.7
23+
version: 1.1.0
2424
- src: geerlingguy.drush
2525
version: 2.0.1
2626
- src: geerlingguy.elasticsearch
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.retry
2+
tests/test.sh
Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,26 @@
11
---
2-
sudo: required
3-
language: python
4-
python: "2.7"
2+
services: docker
53

64
env:
7-
- SITE=test.yml
8-
- SITE=test-self-update.yml
9-
10-
before_install:
11-
- sudo apt-get update -qq
12-
13-
install:
14-
# Install Ansible.
15-
- pip install ansible
16-
17-
# Add ansible.cfg to pick up roles path.
18-
- "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg"
19-
20-
# Install required dependencies.
21-
- ansible-galaxy install geerlingguy.php
5+
- distro: ubuntu1604
6+
playbook: test.yml
7+
- distro: ubuntu1604
8+
playbook: test-self-update.yml
229

2310
script:
24-
# Check the role/playbook's syntax.
25-
- "ansible-playbook -i tests/inventory tests/$SITE --syntax-check"
11+
# Configure test script so we can run extra tests after playbook is run.
12+
- export container_id=$(date +%s)
13+
- export cleanup=false
2614

27-
# Run the role/playbook with ansible-playbook.
28-
- "ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo"
15+
# Download test shim.
16+
- wget -O ${PWD}/tests/test.sh https://gist.githubusercontent.com/geerlingguy/73ef1e5ee45d8694570f334be385e181/raw/
17+
- chmod +x ${PWD}/tests/test.sh
2918

30-
# Run the role/playbook again, checking to make sure it's idempotent.
31-
- >
32-
ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo
33-
| grep -q 'changed=0.*failed=0'
34-
&& (echo 'Idempotence test: pass' && exit 0)
35-
|| (echo 'Idempotence test: fail' && exit 1)
19+
# Run tests.
20+
- ${PWD}/tests/test.sh
3621

37-
# Check if Drupal Console is installed and working.
38-
- drupal
22+
# Ensure Drupal Console is installed and working.
23+
- 'docker exec --tty ${container_id} env TERM=xterm drupal list || true'
3924

4025
notifications:
4126
webhooks: https://galaxy.ansible.com/api/v1/notifications/
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2017 Jeff Geerling
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

provisioning/roles/geerlingguy.drupal-console/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Installs [Drupal Console](http://drupalconsole.com/) on any Linux or UNIX system
66

77
## Requirements
88

9-
`php` (version 5.4+) should be installed and working.
9+
`php` (version 5.6+) should be installed and working.
1010

1111
## Role Variables
1212

@@ -32,7 +32,7 @@ The path to the Drupal Console configuration file.
3232

3333
- hosts: servers
3434
roles:
35-
- { role: geerlingguy.drupal-console }
35+
- role: geerlingguy.drupal-console
3636

3737
After the playbook runs, `drupal` will be placed in `/usr/local/bin/drupal` (this location is configurable), and will be accessible via normal system accounts.
3838

@@ -42,4 +42,4 @@ MIT / BSD
4242

4343
## Author Information
4444

45-
This role was created in 2015 by [Jeff Geerling](http://jeffgeerling.com/), author of [Ansible for DevOps](http://ansiblefordevops.com/).
45+
This role was created in 2015 by [Jeff Geerling](https://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).

provisioning/roles/geerlingguy.drupal-console/meta/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ galaxy_info:
77
description: Drupal Console
88
company: "Midwestern Mac, LLC"
99
license: "license (BSD, MIT)"
10-
min_ansible_version: 1.4
10+
min_ansible_version: 1.8
1111
platforms:
1212
- name: EL
1313
versions:

provisioning/roles/geerlingguy.drupal-console/tasks/main.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
path: "{{ drupal_console_path }}"
1010
mode: 0755
1111

12-
- name: Run Drupal Console init.
13-
shell: >
14-
php {{ drupal_console_path }} init
15-
creates={{ drupal_console_config }}
16-
1712
- name: Update Drupal Console to latest version (if configured).
1813
shell: >
1914
php {{ drupal_console_path }} self-update
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Ansible Role tests
2+
3+
To run the test playbook(s) in this directory:
4+
5+
1. Install and start Docker.
6+
1. Download the test shim (see .travis.yml file for the URL) into `tests/test.sh`:
7+
- `wget -O tests/test.sh https://gist.githubusercontent.com/geerlingguy/73ef1e5ee45d8694570f334be385e181/raw/`
8+
1. Make the test shim executable: `chmod +x tests/test.sh`.
9+
1. Run (from the role root directory) `distro=[distro] playbook=[playbook] ./tests/test.sh`
10+
11+
If you don't want the container to be automatically deleted after the test playbook is run, add the following environment variables: `cleanup=false container_id=$(date +%s)`

provisioning/roles/geerlingguy.drupal-console/tests/inventory

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
- src: geerlingguy.php

0 commit comments

Comments
 (0)