summaryrefslogtreecommitdiff
path: root/zuul/web/static/README
blob: f17ea5f01f94eb2c3ca2125c88c1ba6c08c0a1e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
External requirements needs to be installed in these locations
* /static/js/angular.min.js
* /static/js/jquery.min.js
* /static/js/jquery-visibility.min.js
* /static/js/jquery.graphite.min.js
* /static/bootstrap/css/bootstrap.min.css


Use python2-rjsmin or another js minifier:
```
DEST_DIR=/var/www/html/static/
mkdir -p $DEST_DIR/js
echo "Fetching angular..."
curl -L --silent https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js > $DEST_DIR/js/angular.min.js

echo "Fetching jquery..."
curl -L --silent http://code.jquery.com/jquery.min.js > $DEST_DIR/js/jquery.min.js

echo "Fetching jquery-visibility..."
curl -L --silent https://raw.githubusercontent.com/mathiasbynens/jquery-visibility/master/jquery-visibility.js > $DEST_DIR/js/jquery-visibility.js
python2 -mrjsmin < $DEST_DIR/js/jquery-visibility.js > $DEST_DIR/js/jquery-visibility.min.js

echo "Fetching bootstrap..."
curl -L --silent https://github.com/twbs/bootstrap/releases/download/v3.1.1/bootstrap-3.1.1-dist.zip > bootstrap.zip
unzip -q -o bootstrap.zip -d $DEST_DIR/
mv $DEST_DIR/bootstrap-3.1.1-dist $DEST_DIR/bootstrap
rm -f bootstrap.zip

echo "Fetching jquery-graphite..."
curl -L --silent https://github.com/prestontimmons/graphitejs/archive/master.zip > jquery-graphite.zip
unzip -q -o jquery-graphite.zip -d $DEST_DIR/
python2 -mrjsmin < $DEST_DIR/graphitejs-master/jquery.graphite.js > $DEST_DIR/js/jquery.graphite.min.js
rm -Rf jquery-graphite.zip $DEST_DIR/graphitejs-master
```


Here is an example apache vhost configuration:
<VirtualHost zuul-web.example.com:80>
  DocumentRoot /var/www/zuul-web

  LogLevel warn

  Alias "/static" "/var/www/zuul-web"
  AliasMatch "^/.*/(.*).html" "/var/www/zuul-web/$1.html"
  AliasMatch "^/.*.html" "/var/www/zuul-web/index.html"
  <Directory /var/www/zuul-web>
      Require all granted
      Order allow,deny
      Allow from all
  </Directory>

  # Console-stream needs a special proxy-pass for websocket
  ProxyPass /console-stream ws://localhost:9000/console-stream nocanon retry=0
  ProxyPassReverse /console-stream ws://localhost:9000/console-stream

  # Then only the json calls are sent to the zuul-web endpoints
  ProxyPassMatch ^/(.*.json)$ http://localhost:9000/$1 nocanon retry=0
  ProxyPassReverse / http://localhost:9000/
</VirtualHost>

Then copy the zuul/web/static/ files and external requirements to
/var/www/zuul-web