Skip to content

Commit

Permalink
improve new repo setup, updates, and wait page
Browse files Browse the repository at this point in the history
  • Loading branch information
mapmeld committed Aug 28, 2013
1 parent e1d9437 commit 62a87ca
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 16 deletions.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ models.repos = repo_model(mongoose);

require('./routes')(app, models);

app.listen(process.env.PORT || 3000);
app.listen(process.env.PORT || 80);
6 changes: 4 additions & 2 deletions public/scripts/waitbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ if(typeof console == "undefined"){

setInterval(function(){
$.getJSON("/" + (port*1) + "/geogit/log?output=json", function(data){
window.location = "/git/" + (port*1);
if(typeof data.response != "undefined"){
window.location = "/git/" + (port*1);
}
}, function(data){
console.log('waiting');
});
}, 4000);
}, 4000);
5 changes: 4 additions & 1 deletion routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ module.exports = function(app, models){
res.redirect("/wait/" + count);

exec("mkdir ../empty/" + user + " ; mkdir ../empty/" + user + "/" + project + "" + suffix, function(err, stdout, stderr){
exec("mvn jetty:run -pl ../web/app -f /root/GeoGit/src/parent/pom.xml -Dorg.geogit.web.repository=/root/empty/" + user + "/" + project + "" + suffix + " -Djetty.port=" + count, null);
exec("(cd ../empty/" + user + "/" + project + "" + suffix + "/; geogit init )", function(err, stdout, stderr){
exec("mvn jetty:run -pl ../web/app -f /root/GeoGit/src/parent/pom.xml -Dorg.geogit.web.repository=/root/empty/" + user + "/" + project + "" + suffix + " -Djetty.port=" + count, null);
});
});
});
});
Expand Down Expand Up @@ -195,6 +197,7 @@ module.exports = function(app, models){
if(err){
return res.json({ error: err });
}
res.json({ success: "update started" });
exec(command + " " + targettask, function(err, stdout, stderr){
exec("(cd ../github/" + repo.user + "/" + repo.project + "" + repo.suffix + "/ ; python3 updatefromgithub.py)", function(err, stdout, stderr){
exec("(cd ../GeoGit/src/parent ; mvn jetty:run -pl ../web/app -f pom.xml -Dorg.geogit.web.repository=/root/github/" + repo.user + "/" + repo.project + "" + repo.suffix + " -Djetty.port=" + repo.port + ")", null);
Expand Down
26 changes: 18 additions & 8 deletions views/localrepo.jade
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,24 @@ div.container
h1 GeoGinger Projects
p Push directly to GeoGinger

.row
.span4
.row
.span6
h3 What is GeoGit?
p GeoGit is an open source tool from OpenGeo to track changes in geodata.
p Where tools such as GitHub see line-by-line changes in files, GeoGit sees points added, attributes modified, and polygons removed.
br
.span6
h3 Why add GeoGinger?
p GeoGinger captures and maps your GeoGit work in the cloud.
p Outside developers can have their apps connect to GeoGinger to keep their data in sync.
p
span GeoGinger provides 
a(href="/api") APIs
span  to download data in multiple formats and see changes over time.
br
br

.span4
.row
.span6
.well
h3 Create New Project
p BETA
Expand All @@ -39,19 +42,26 @@ div.container
br
input(type="submit", value="Add Repo")

.span4
.span6
h3 What's next
p GeoGinger will set up a server and a port on geoginger.com where you can push your data.
p
span You need to install 
a(href="http://geogit.org/") GeoGit
span  to make commits.
p Use the following commands (modeled after git) to push your data:
style(type="text/css") code{ display: block; background: #000; color: #fff; border: none; }
code geogit shp import YourShapefile.shp
code geogit add
code geogit commit -m "Initial commit!"
code geogit shp import ChangedShapefile.shp
code geogit add
code geogit commit -m "Made some changes, but how do I see them?"
code geogit commit -m "Made some changes"
code
span geogit remote add geoginger http://geoginger.com:
span geogit remote add gg http://geoginger.com:
span#port PORT
span /geogit
code geogit push geoginger
code geogit push gg

br
br
20 changes: 16 additions & 4 deletions views/wait.jade
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
style(type="text/css") body{ font-family: arial, sans-serif; }

h3 Loading...

p This page will appear until your map is ready

p
span Your map's url will be&nbsp
a(href="/git/#{port}") geoginger.com/git/#{port}
span .
ul
li
span Your map's url will be&nbsp
a(href="/git/#{port}") geoginger.com/git/#{port}
span .
li
span Is this a new repo?&nbsp
span(style="font-family:Courier, monospace;") geogit remote add gg http://geoginger.com:#{port}/geogit
li
span GitHub? Add a web hook: http://geoginger.com/refresh/#{port}

script(type="text/javascript", src="http://code.jquery.com/jquery-1.9.1.min.js")
script(type="text/javascript") var port = "#{port}";
script(type="text/javascript", src="/scripts/waitbar.js")

iframe(src="http://bl.ocks.org/mbostock/raw/1246403/cd587bd485ff362aabafe708e54044667118363e/", marginwidth="0", marginheight="0", scrolling="no", style="width: 960px; height: 300px; border: 1px solid #dedede;")
br
a(href="http://bl.ocks.org/mbostock/1246403", target="_blank") Spinny globe in D3 by Mike Bostock

0 comments on commit 62a87ca

Please sign in to comment.