aboutsummaryrefslogtreecommitdiffstats
path: root/Vagrantfile
diff options
context:
space:
mode:
authorSam Pearson <sam@sgp.me.uk>2018-11-05 13:18:50 +0000
committerSam Pearson <sam@sgp.me.uk>2018-11-05 13:27:02 +0000
commit3d93af8e8f3c1686d1ba027da8d89184df180d51 (patch)
tree35ca4b24964c5d63c561614514ce905ff0be1178 /Vagrantfile
parent94c761fc5eb91fa7b558f0c8e8bdbff4f34e2ac7 (diff)
[Vagrant] Only add development port to BASE_URL when required
The addition of `:3000` to `BASE_URL` is now only made when not using the FixMyStreet box as this will be supplied in by the `setup` script in that case. This should also only be applied when not already present to prevent it being added repeatedly. [skip ci]
Diffstat (limited to 'Vagrantfile')
-rw-r--r--Vagrantfile10
1 files changed, 5 insertions, 5 deletions
diff --git a/Vagrantfile b/Vagrantfile
index 0fc6f29cf..6ac85c163 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -50,6 +50,11 @@ $full_setup = <<-EOS
else
rm -f /tmp/success 2>/dev/null
fi
+ # Even if it failed somehow, we might as well update the port if possible
+ if [ -e fixmystreet/conf/general.yml ] && ! grep -q "^ *BASE_URL.*:3000'$" conf/general.yml; then
+ # We want to be on port 3000 for development
+ sed -i -r -e "s,^( *BASE_URL: .*)',\\1:3000'," fixmystreet/conf/general.yml
+ fi
EOS
# This just runs our update script, used on our offical box.
@@ -65,11 +70,6 @@ EOS
# This will ensure that bits of config are set right.
$configure = <<-EOS
- # Even if it failed somehow, we might as well update the port if possible
- if [ -e fixmystreet/conf/general.yml ]; then
- # We want to be on port 3000 for development
- sed -i -r -e "s,^( *BASE_URL: .*)',\\1:3000'," fixmystreet/conf/general.yml
- fi
# Create a superuser for the admin
su vagrant -c 'fixmystreet/bin/createsuperuser superuser@example.org password'
if [ -e /tmp/success ]; then