forked from openstreetmap/iD
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·47 lines (37 loc) · 1.38 KB
/
Copy pathdeploy.sh
File metadata and controls
executable file
·47 lines (37 loc) · 1.38 KB
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
#!/bin/bash
# This is an example script that shows how to pull the latest version
# of iD and replace the version string with a git short hash.
#
# We use this script to maintain the iD mirror at: http://preview.ideditor.com/master
# It runs via cron job every 10 minutes.
#
# To use this on your own site, you'll want to change the `cp` and `chgrp`
# lines at the end to match your web server's documentroot folder and security group.
git checkout -q develop
git remote update > /dev/null
rev=`git rev-parse --short HEAD`
orig=`git rev-parse --short origin/develop`
# pull latest code
if [[ "${rev}" != "${orig}" ]] ; then
# avoid issues with local untracked locale files
rm -f dist/locales/*.json
git reset --hard HEAD
git pull origin develop
rev=`git rev-parse --short HEAD`
sed -i "s/context.version = .*;/context.version = '${rev}';/" modules/core/context.js
npm prune
npm install > /dev/null 2>&1
fi
# pull latest imagery
rm -rf node_modules/ohm-editor-layer-index/
git clone https://github.com/openhistoricalmap/ohm-editor-layer-index.git node_modules/ohm-editor-layer-index > /dev/null 2>&1
rm -rf node_modules/ohm-editor-layer-index/.git/
# build everything
npm run imagery
npm run all
# pull latest translations
if [[ -f transifex.auth ]] ; then
npm run translations
fi
cp -Rf dist/* /var/www/openstreetmap.us/iD/master/
chgrp -R www-data /var/www/openstreetmap.us/iD/master/