Browse code

Improve asset version debugging, lock Gemfile

Jordan Liggitt authored on 2014/10/04 00:43:44
Showing 5 changed files
... ...
@@ -4,4 +4,3 @@ dist
4 4
 .sass-cache
5 5
 .bundle
6 6
 bower_components
7
-Gemfile.lock
8 7
new file mode 100644
... ...
@@ -0,0 +1,16 @@
0
+GEM
1
+  remote: https://rubygems.org/
2
+  specs:
3
+    chunky_png (1.3.1)
4
+    compass (0.12.7)
5
+      chunky_png (~> 1.2)
6
+      fssm (>= 0.2.7)
7
+      sass (~> 3.2.19)
8
+    fssm (0.2.10)
9
+    sass (3.2.19)
10
+
11
+PLATFORMS
12
+  ruby
13
+
14
+DEPENDENCIES
15
+  compass (= 0.12.7)
0 16
new file mode 100755
... ...
@@ -0,0 +1,11 @@
0
+#!/bin/bash
1
+
2
+set -e
3
+
4
+hackdir=$(CDPATH="" cd $(dirname $0); pwd)
5
+
6
+pushd ${hackdir}/../assets > /dev/null
7
+  rm -f debug.zip
8
+  zip -r debug .tmp/ dist/
9
+popd > /dev/null
10
+
... ...
@@ -30,7 +30,11 @@ fi
30 30
 
31 31
 pushd ${hackdir}/../assets > /dev/null
32 32
   npm install
33
+
34
+  # In case upstream components change things without incrementing versions
35
+  bower cache clean
33 36
   bower install
37
+
34 38
   bundle install --path ${hackdir}/../assets/.bundle
35 39
 popd > /dev/null
36 40
 
... ...
@@ -15,13 +15,43 @@ pushd ${hackdir}/../assets > /dev/null
15 15
   bundle exec grunt build
16 16
 popd > /dev/null
17 17
 
18
-pushd ${hackdir}/../ > /dev/null
19
-  echo "Calculating asset checksums..."
20
-  find assets/dist -type f | sort | xargs md5sum
18
+pushd ${hackdir}/../assets > /dev/null
19
+  echo ""
20
+  echo "Source asset checksums..."
21
+  find .tmp -type f | sort | xargs md5sum
21 22
 
22
-  Godeps/_workspace/bin/go-bindata -prefix "assets/dist" -pkg "assets" -o "_output/test/assets/bindata.go" assets/dist/...
23
+  echo ""
24
+  echo "Built asset checksums..."
25
+  find dist -type f | sort | xargs md5sum
26
+popd > /dev/null  
23 27
 
28
+pushd ${hackdir}/../ > /dev/null
29
+  Godeps/_workspace/bin/go-bindata -prefix "assets/dist" -pkg "assets" -o "_output/test/assets/bindata.go" assets/dist/...
24 30
   echo "Validating checked in bindata.go is up to date..."
25
-  # TODO remove the pipe to head as it messes up the exit code
26
-  diff _output/test/assets/bindata.go pkg/assets/bindata.go
31
+  if ! diff _output/test/assets/bindata.go pkg/assets/bindata.go ; then
32
+
33
+    pushd ${hackdir}/../assets > /dev/null
34
+
35
+      if [ -f debug.zip ]; then
36
+        unzip debug.zip -d debug
37
+        diff -r .tmp debug/.tmp
38
+        diff -r dist debug/dist
39
+      fi
40
+
41
+      echo ""
42
+      echo "Bundler versions..."
43
+      bundle list
44
+
45
+      echo ""
46
+      echo "Bower versions..."
47
+      bower list -o
48
+
49
+      echo ""
50
+      echo "NPM versions..."
51
+      npm list
52
+
53
+    popd > /dev/null  
54
+
55
+    exit 1
56
+  fi
27 57
 popd > /dev/null
28 58
\ No newline at end of file