webapps.mason: add action to update docs
parent
a67c7c5739
commit
9b6db6b0e3
|
@ -0,0 +1 @@
|
|||
Slava Pestov
|
|
@ -0,0 +1,29 @@
|
|||
! Copyright (C) 2010 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors continuations furnace.actions help.html
|
||||
http.server.responses io.directories io.directories.hierarchy
|
||||
io.launcher io.files io.pathnames kernel memoize
|
||||
webapps.mason.utils ;
|
||||
IN: webapps.mason.docs-update
|
||||
|
||||
: update-docs ( -- )
|
||||
home [
|
||||
"newdocs" make-directory
|
||||
"newdocs" [ { "tar" "xvf" "../docs.tar.gz" } try-process ] with-directory
|
||||
|
||||
"docs" exists? [ "docs" "docs.old" move-file ] when
|
||||
"newdocs/docs" "docs" move-file
|
||||
|
||||
"newdocs" delete-directory
|
||||
"docs.old" exists? [ "docs.old" delete-tree ] when
|
||||
|
||||
\ load-index reset-memoized
|
||||
] with-directory ;
|
||||
|
||||
: <docs-update-action> ( -- action )
|
||||
<action>
|
||||
[ validate-secret ] >>validate
|
||||
[
|
||||
update-docs
|
||||
"OK" "text/plain" <content>
|
||||
] >>submit ;
|
|
@ -4,8 +4,9 @@ USING: accessors furnace.actions furnace.auth furnace.db
|
|||
http.server.dispatchers mason.server webapps.mason.grids
|
||||
webapps.mason.package webapps.mason.release webapps.mason.report
|
||||
webapps.mason.downloads webapps.mason.counter
|
||||
webapps.mason.status-update webapps.mason.dashboard
|
||||
webapps.mason.make-release webapps.mason.increment-counter ;
|
||||
webapps.mason.status-update webapps.mason.docs-update
|
||||
webapps.mason.dashboard webapps.mason.make-release
|
||||
webapps.mason.increment-counter ;
|
||||
IN: webapps.mason
|
||||
|
||||
TUPLE: mason-app < dispatcher ;
|
||||
|
@ -39,6 +40,9 @@ build-engineer? define-capability
|
|||
<status-update-action>
|
||||
"status-update" add-responder
|
||||
|
||||
<docs-update-action>
|
||||
"docs-update" add-responder
|
||||
|
||||
<counter-action>
|
||||
"counter" add-responder
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors calendar combinators db.tuples furnace.actions
|
||||
furnace.redirection html.forms http.server.responses io kernel
|
||||
mason.config mason.server namespaces validators ;
|
||||
mason.server namespaces validators webapps.mason.utils ;
|
||||
IN: webapps.mason.status-update
|
||||
|
||||
: find-builder ( -- builder )
|
||||
|
@ -59,7 +59,7 @@ IN: webapps.mason.status-update
|
|||
{ "secret" [ v-one-line ] }
|
||||
} validate-params
|
||||
|
||||
"secret" value status-secret get = [ validation-failed ] unless
|
||||
validate-secret
|
||||
] >>validate
|
||||
|
||||
[
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
! Copyright (C) 2010 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors arrays assocs db.tuples furnace.actions
|
||||
furnace.utilities html.forms kernel mason.server
|
||||
mason.version.data sequences validators xml.syntax urls ;
|
||||
furnace.utilities html.forms kernel mason.config mason.server
|
||||
mason.version.data namespaces sequences validators xml.syntax
|
||||
urls ;
|
||||
IN: webapps.mason.utils
|
||||
|
||||
: link ( url label -- xml )
|
||||
|
@ -53,3 +54,7 @@ IN: webapps.mason.utils
|
|||
[ os>> "os" set-query-param ]
|
||||
[ cpu>> "cpu" set-query-param ] bi
|
||||
adjust-url ;
|
||||
|
||||
: validate-secret ( -- )
|
||||
"secret" value status-secret get =
|
||||
[ validation-failed ] unless ;
|
||||
|
|
Loading…
Reference in New Issue