Permalink
Browse files

switch cdn

  • Loading branch information...
gojko committed Dec 30, 2014
1 parent 9651ab6 commit 8dccf5f0f21848a2243870840a6e2f041cbe0a56
Showing with 7 additions and 5 deletions.
  1. +1 −1 compiled_ts.rb
  2. +5 −3 upload.sh
  3. +1 −1 web.rb
View
@@ -1 +1 @@
set :compiled_ts,"20141219153357"
set :compiled_ts,"20141230104629"
View
@@ -1,14 +1,16 @@
#!/bin/bash
# run with --dryrun to see what will happen
DISTRO=`grep PUBLIC_HOST .env | sed 's/^.*\///'`
echo using distro $DISTRO
rm -rf compiled
mkdir compiled
cat `grep 'src="/' views/embedded_scripts.erb | sed 's/.*"\/\([^"]*\)".*/public\/\1/'` > compiled/mm-embedded.js
mkdir compiled/e
cp public/e/* compiled/e/
grunt compile $2
if [[ $1 != "--static" ]]; then
for c in compiled/*.css; do gsed s/static.mindmup.com/d23c2zpg6dm0n.cloudfront.net/g $c -i; done
for c in compiled/e/*.css; do gsed s/static.mindmup.com/d23c2zpg6dm0n.cloudfront.net/g $c -i; done
for c in compiled/*.css; do gsed s/static.mindmup.com/$DISTRO/g $c -i; done
for c in compiled/e/*.css; do gsed s/static.mindmup.com/$DISTRO/g $c -i; done
else
for c in compiled/*.css; do gsed s/\\/\\/static.mindmup.com/..\\/static/g $c -i; done
for c in compiled/e/*.css; do gsed s/\\/\\/static.mindmup.com/..\\/..\\/static/g $c -i; done
@@ -20,7 +22,7 @@ if [[ $rc != 0 ]] ; then
else
if [[ $1 != "--static" ]]; then
ts=`date +%Y%m%d%H%M%S`
aws s3 sync $1 --acl public-read compiled s3://static.mindmup.com/compiled/$ts
aws s3 sync $1 --acl public-read compiled s3://cdn.mindmup.com/compiled/$ts
echo 'set :compiled_ts,"'$ts'"' > compiled_ts.rb
fi
fi
View
2 web.rb
@@ -20,7 +20,7 @@ def cache_last_news
end
end
configure do
static_ts = '20140912202404'
static_ts = '20141230102849'
public_host = ENV['PUBLIC_HOST'] || 'http://static.mindmup.net'
set :earliest_supported_ios_version, (ENV["EARLIEST_IOS_VERSION"] && ENV["EARLIEST_IOS_VERSION"].to_f) || 1
set :static_host, "#{public_host}/#{static_ts}"

0 comments on commit 8dccf5f

Please sign in to comment.