diff --git a/Makefile b/Makefile index 3defea951..580a0a450 100644 --- a/Makefile +++ b/Makefile @@ -46,3 +46,7 @@ lessc: # `sudo dpkg -i drone.deb` deb: dpkg-deb --build debian/drone + +deploy: + scp -i $$DRONE_STAGING_KEY debian/drone.deb $$DRONE_STAGING_USER@$$DRONE_STAGING_HOST:/tmp + ssh -i $$DRONE_STAGING_KEY $$DRONE_STAGING_USER@$$DRONE_STAGING_HOST -- dpkg -i /tmp/drone.deb \ No newline at end of file diff --git a/debian/drone/etc/init/drone.conf b/debian/drone/etc/init/drone.conf index 8940bfea5..fda2a5862 100644 --- a/debian/drone/etc/init/drone.conf +++ b/debian/drone/etc/init/drone.conf @@ -1,9 +1,11 @@ start on (filesystem and net-device-up) -chdir /root/.drone console log script + mkdir -p /root/.drone + cd /root/.drone + DRONED_OPTS="--port=:80" if [ -f /etc/default/$UPSTART_JOB ]; then . /etc/default/$UPSTART_JOB diff --git a/server/app/scripts/app.js b/server/app/scripts/app.js index fe4502c5e..8167238e6 100644 --- a/server/app/scripts/app.js +++ b/server/app/scripts/app.js @@ -139,10 +139,14 @@ app.config(['$routeProvider', '$locationProvider', function($routeProvider, $loc $locationProvider.html5Mode(true); }]); -/* Directives */ - /* also see https://coderwall.com/p/vcfo4q */ -app.run(['$location', '$rootScope', '$routeParams', function($location, $rootScope, $routeParams) { +app.run(['$location', '$rootScope', '$routeParams', 'feed', 'stdout', function($location, $rootScope, $routeParams, feed, stdout) { + + $rootScope.$on('$routeChangeStart', function (event, next) { + feed.unsubscribe(); + stdout.unsubscribe(); + }); + $rootScope.$on('$routeChangeSuccess', function (event, current, previous) { document.title = current.$$route.title + ' ยท drone.io'; }); diff --git a/server/app/scripts/services/feed.js b/server/app/scripts/services/feed.js index cee9da0a4..a12090cf2 100644 --- a/server/app/scripts/services/feed.js +++ b/server/app/scripts/services/feed.js @@ -19,6 +19,6 @@ angular.module('app').service('feed', ['$http', '$window', function($http, $wind }; this.unsubscribe = function() { - ws.close(); + wsCallback = undefined; }; }]); diff --git a/server/app/views/branch.html b/server/app/views/branch.html deleted file mode 100644 index c98ed984d..000000000 --- a/server/app/views/branch.html +++ /dev/null @@ -1,48 +0,0 @@ -

{{ repo.name }}

-Back -Settings - -
-
- What to show here? -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
StatusBranchShaPRAuthorMessageStartedFinished
- - {{ commit.status }} - - - - {{ commit.branch }} - - - - {{ commit.sha | shortHash }} - - {{ commit.pull_request }}{{ commit.author }}{{ commit.message }}{{ commit.started_at | fromNow }}{{ commit.finished_at | fromNow }}
-
-
\ No newline at end of file diff --git a/server/worker/worker.go b/server/worker/worker.go index 84dfd5f61..cc21160de 100644 --- a/server/worker/worker.go +++ b/server/worker/worker.go @@ -119,16 +119,8 @@ func (w *worker) Execute(r *Request) { builder.Timeout = time.Duration(r.Repo.Timeout) * time.Minute builder.Privileged = r.Repo.Privileged - //err := builder.Run() - var err error - buf.WriteString("THIS\n") - time.Sleep(3 * time.Second) - buf.WriteString("IS\n") - time.Sleep(3 * time.Second) - buf.WriteString("A\n") - time.Sleep(3 * time.Second) - buf.WriteString("TEST\n") - time.Sleep(3 * time.Second) + // run the build + err := builder.Run() // update the build status based on the results // from the build runner.