Skip to content

Commit

Permalink
Merge pull request #68 from palantirnet/solr-7
Browse files Browse the repository at this point in the history
Update from Solr 4.5.1 to 7.7.2
  • Loading branch information
becw authored Feb 12, 2020
2 parents 4e9dac4 + 0e6117e commit 9badcca
Show file tree
Hide file tree
Showing 54 changed files with 4,586 additions and 124 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ Devkit is a framework to build Vagrant boxes for our projects' development envir
Build the current box with:

```
$> make drupalbox
make drupalbox
```

Test the current box with:

```
$> cd dev
$> vagrant up
cd dev
vagrant up
```

## Development Requirements
Expand Down
40 changes: 39 additions & 1 deletion docs/Development-Workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,42 @@ vagrant reload --provision-with test
# Rebuild the box from scratch
vagrant destroy
vagrant up
```
```

There are a few things that are different between running the provisioning against a vagrant box and running the provisioning as part of the Packer workflow. The full Packer workflow can be run with Make:

```
make drupalbox
```

If this is successful, you can dd the resulting box to your local list of Vagrant boxes:

```
vagrant box add --name=test-drupalbox drupalbox_virtualbox.box
```

To spin up a Vagrant environment using this box:

1. `cd` to the directory where you want to use the box (either an existing project, or a new, empty directory)
2. If you've run Vagrant here before, destroy the existing environment:

```
vagrant destroy
```
2. If there's an existing `Vagrantfile`, update these lines:
```
box.vm.box = "test-drupalbox"
box.vm.box_version = "*"
```
3. Otherwise, create a new Vagrantfile:
```
vagrant init test-drupalbox
```
4. Spin up the box and ssh in:
```
vagrant up
vagrant ssh
```
2 changes: 2 additions & 0 deletions drupalbox/CHANGELOG-0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Changed

- Updated from Solr 4.5.1 to Solr 7.7.2

## [1.4.0] - 2019-09-25

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions drupalbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Mailhog's smtp service listens on port `1025`, and its http service listens on p

### Solr

This box runs Solr v4.5.1, to match one of the versions available on [Acquia](https://docs.acquia.com/article/how-test-custom-solr-schema-file-locally).
This box runs Solr v7.7, to match one of the versions available on [Acquia](https://docs.acquia.com/acquia-search/modules/move-to-solr7/). Note that there is no Solr 7 support for Drupal 7 at this time.

Solr is installed to `/opt/solr` with two default cores, `drupal7` and `drupal8`. Solr runs on port `8983`, and the web UI can be found at `http://yoursite.local:8983/solr`.
Solr is installed to `/opt/solr` with one default core, `drupal8`. Solr runs on port `8983`, and the web UI can be found at `http://yoursite.local:8983/solr`.

The Solr service runs by default; when you're using [palantirnet/the-vagrant](https://github.com/palantirnet/the-vagrant), this can be managed in the `Vagrantfile`.
13 changes: 4 additions & 9 deletions drupalbox/drupalbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@
hostname: drupalbox
php_xdebug_enabled: true
php_ini_sendmail_path: "/usr/local/bin/mhsendmail"
solr_cores:
- name: drupal7
module: search_api_solr-7.x-1.12
subdir: solr-conf/4.x
- name: drupal8
module: search_api_solr-8.x-1.2
subdir: solr-conf/4.x
vars_files:
- vars/default/common.yml
- vars/dev/mysql.yml
Expand All @@ -28,7 +21,7 @@
rvm1_user: vagrant
rvm1_install_path: /home/vagrant/.rvm
rvm1_rubies:
- 'ruby-2.3.1'
- 'ruby-2.5.2'
- { role: memcached }
- { role: mailhog }
- {
Expand All @@ -37,7 +30,9 @@
}
- {
role: geerlingguy.solr,
solr_version: "4.5.1",
solr_version: "7.7.2",
solr_cores: ['example'],
solr_user: vagrant,
become: yes
}
- {
Expand Down
4 changes: 2 additions & 2 deletions drupalbox/requirements.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---

- src: geerlingguy.java
version: 1.7.7
version: 1.9.6

- src: geerlingguy.solr
version: 4.0.2
version: 5.0.0

- src: rvm.ruby
version: v2.1.2
22 changes: 17 additions & 5 deletions drupalbox/tests/solr_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,22 @@
it { should be_directory }
end

describe file("/var/log/solr.log") do
describe file("/var/solr/data/example") do
it { should be_directory }
end

describe file("/var/solr/data/drupal8") do
it { should be_directory }
end

describe file("/var/solr/data/drupal7") do
it { should be_directory }
end

describe file("/var/solr/logs/solr.log") do
it { should be_file }
it { should be_owned_by 'solr' }
it { should be_grouped_into 'adm' }
it { should be_owned_by 'vagrant' }
it { should be_grouped_into 'vagrant' }
end

describe service('solr') do
Expand All @@ -19,6 +31,6 @@
it { should be_listening }
end

describe command('curl http://127.0.0.1:8983/solr/admin/info/system?wt=json') do
its(:stdout) { should match /"solr-spec-version":"4\.5\.1"/ }
describe command('curl http://127.0.0.1:8983/solr/admin/info/system') do
its(:stdout) { should match /"solr-spec-version":"7\.7\.2"/ }
end
2 changes: 1 addition & 1 deletion provisioning/roles/duplicity/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
- duplicity
- duply
- python-boto
state: installed
state: present
tags: duplicity
2 changes: 1 addition & 1 deletion provisioning/roles/mysql-server/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: MySQL | Install Server
become: yes
apt: pkg=mysql-server state=installed
apt: pkg=mysql-server state=present
tags: mysql-server

- name: MySQL | Update my.cnf
Expand Down
4 changes: 2 additions & 2 deletions provisioning/roles/phantomjs/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
- name: PhantomJS | Install firefox
become: yes
apt: pkg=iceweasel
state=installed
state=present
update-cache=yes
tags: phantomjs

- name: PhantonJS | Install fontconfig
become: yes
apt: pkg=fontconfig
state=installed
state=present
tags: phantonjs

- name: PhantomJS | Create home directory
Expand Down
51 changes: 0 additions & 51 deletions provisioning/roles/solr-configuration/tasks/cores.yml

This file was deleted.

43 changes: 17 additions & 26 deletions provisioning/roles/solr-configuration/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
---
- name: Solr Cleanup | Replace systemd script for Solr 4
template:
src: solr4.unit.j2
dest: /etc/systemd/system/solr.service
owner: root
group: root
mode: 0755

- name: Solr Cleanup | Fix log permissions
file:
path: /var/log/solr.log
owner: solr
group: adm
- name: Solr Configuration | Copy Solr config
copy:
src: templates/
dest: /tmp/

- name: Solr Cleanup | Reload daemon
shell: systemctl daemon-reload
- name: Solr Configuration | Install 'drupal8' Solr core
command:
cmd: /opt/solr/bin/solr create_core -c drupal8 -d /tmp/solr_7.x_config-drupal8
creates: /var/solr/data/drupal8
become: yes
become_user: vagrant

- name: Solr Cleanup | Restart Solr
service:
name: solr
state: restarted
enabled: no

- name: Solr Cleanup | Enable Solr start on boot
service:
name: solr
enabled: yes

- include: cores.yml
# Drupal 7 support requires different Lucene configuration.
- name: Solr Configuration | Install 'drupal7' Solr core
command:
cmd: /opt/solr/bin/solr create_core -c drupal7 -d /tmp/solr_7.x_config-drupal7
creates: /var/solr/data/drupal7
become: yes
become_user: vagrant

This file was deleted.

13 changes: 0 additions & 13 deletions provisioning/roles/solr-configuration/templates/solr4.unit.j2

This file was deleted.

Loading

0 comments on commit 9badcca

Please sign in to comment.