Skip to content

Commit

Permalink
Merge pull request #71 from palantirnet/apply-fixes-from-solr-update-…
Browse files Browse the repository at this point in the history
…and-duplicity

1.x: Apply fixes from solr update and duplicity
  • Loading branch information
becw authored May 8, 2020
2 parents 4e9dac4 + 8b2ee32 commit 6532a76
Show file tree
Hide file tree
Showing 15 changed files with 70 additions and 96 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
```
3 changes: 1 addition & 2 deletions drupalbox/drupalbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,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 @@ -52,5 +52,4 @@
- { role: phpmyadmin }
- { role: nodejs }
- { role: phantomjs }
- { role: duplicity }
- { role: drupalbox }
18 changes: 0 additions & 18 deletions drupalbox/tests/duplicity_spec.rb

This file was deleted.

11 changes: 0 additions & 11 deletions provisioning/roles/duplicity/defaults/main.yml

This file was deleted.

14 changes: 0 additions & 14 deletions provisioning/roles/duplicity/tasks/configure.yml

This file was deleted.

22 changes: 0 additions & 22 deletions provisioning/roles/duplicity/tasks/install.yml

This file was deleted.

7 changes: 0 additions & 7 deletions provisioning/roles/duplicity/tasks/main.yml

This file was deleted.

5 changes: 0 additions & 5 deletions provisioning/roles/duplicity/templates/duply/conf.j2

This file was deleted.

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
8 changes: 4 additions & 4 deletions provisioning/roles/phantomjs/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
- name: PhantomJS | Install firefox
become: yes
apt: pkg=iceweasel
state=installed
state=present
update-cache=yes
tags: phantomjs

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

- name: PhantomJS | Create home directory
become: yes
Expand Down
2 changes: 1 addition & 1 deletion provisioning/vars/default/rvm.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rvm1_rubies:
- 'ruby-2.1.3'
- 'ruby-2.5.2'
16 changes: 12 additions & 4 deletions script/serverspec.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/bin/bash
export PATH="$PATH:/home/vagrant/.rvm/rubies/ruby-2.3.1/bin"
gem install bundler --no-ri --no-rdoc
cd /tmp/tests
# This script is run during the Packer build process.

# Wherever the tests are expected to live.
tests_path="/tmp/tests"
specs_path="/tmp/tests/specs/*_spec.rb"

# Load rvm into this session
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

# Run serverspec
cd "$tests_path"
bundle install --path=vendor
bundle exec rake spec
bundle exec rake spec["$specs_path"]
2 changes: 1 addition & 1 deletion tests/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ GEM
net-ssh (>= 2.6.5)
net-ssh (3.1.1)
net-telnet (0.1.1)
rake (10.1.1)
rake (12.3.3)
rspec (3.4.0)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
Expand Down
10 changes: 8 additions & 2 deletions tests/Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
require 'rake'
require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = '/tmp/tests/specs/*_spec.rb'
RSpec::Core::RakeTask.new(:spec, :spec_pattern) do |t, task_args|
if task_args[:spec_pattern].nil? || task_args[:spec_pattern].empty?
print " Missing spec file pattern. Run with:\r\n"
print " bundle exec rake spec[/path/to/*_spec.rb]\r\n"
exit
end

t.pattern = task_args[:spec_pattern]
end

0 comments on commit 6532a76

Please sign in to comment.