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
|
http.server.dispatchers mason.server webapps.mason.grids
|
||||||
webapps.mason.package webapps.mason.release webapps.mason.report
|
webapps.mason.package webapps.mason.release webapps.mason.report
|
||||||
webapps.mason.downloads webapps.mason.counter
|
webapps.mason.downloads webapps.mason.counter
|
||||||
webapps.mason.status-update webapps.mason.dashboard
|
webapps.mason.status-update webapps.mason.docs-update
|
||||||
webapps.mason.make-release webapps.mason.increment-counter ;
|
webapps.mason.dashboard webapps.mason.make-release
|
||||||
|
webapps.mason.increment-counter ;
|
||||||
IN: webapps.mason
|
IN: webapps.mason
|
||||||
|
|
||||||
TUPLE: mason-app < dispatcher ;
|
TUPLE: mason-app < dispatcher ;
|
||||||
|
@ -39,6 +40,9 @@ build-engineer? define-capability
|
||||||
<status-update-action>
|
<status-update-action>
|
||||||
"status-update" add-responder
|
"status-update" add-responder
|
||||||
|
|
||||||
|
<docs-update-action>
|
||||||
|
"docs-update" add-responder
|
||||||
|
|
||||||
<counter-action>
|
<counter-action>
|
||||||
"counter" add-responder
|
"counter" add-responder
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors calendar combinators db.tuples furnace.actions
|
USING: accessors calendar combinators db.tuples furnace.actions
|
||||||
furnace.redirection html.forms http.server.responses io kernel
|
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
|
IN: webapps.mason.status-update
|
||||||
|
|
||||||
: find-builder ( -- builder )
|
: find-builder ( -- builder )
|
||||||
|
@ -59,7 +59,7 @@ IN: webapps.mason.status-update
|
||||||
{ "secret" [ v-one-line ] }
|
{ "secret" [ v-one-line ] }
|
||||||
} validate-params
|
} validate-params
|
||||||
|
|
||||||
"secret" value status-secret get = [ validation-failed ] unless
|
validate-secret
|
||||||
] >>validate
|
] >>validate
|
||||||
|
|
||||||
[
|
[
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
! Copyright (C) 2010 Slava Pestov.
|
! Copyright (C) 2010 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors arrays assocs db.tuples furnace.actions
|
USING: accessors arrays assocs db.tuples furnace.actions
|
||||||
furnace.utilities html.forms kernel mason.server
|
furnace.utilities html.forms kernel mason.config mason.server
|
||||||
mason.version.data sequences validators xml.syntax urls ;
|
mason.version.data namespaces sequences validators xml.syntax
|
||||||
|
urls ;
|
||||||
IN: webapps.mason.utils
|
IN: webapps.mason.utils
|
||||||
|
|
||||||
: link ( url label -- xml )
|
: link ( url label -- xml )
|
||||||
|
@ -53,3 +54,7 @@ IN: webapps.mason.utils
|
||||||
[ os>> "os" set-query-param ]
|
[ os>> "os" set-query-param ]
|
||||||
[ cpu>> "cpu" set-query-param ] bi
|
[ cpu>> "cpu" set-query-param ] bi
|
||||||
adjust-url ;
|
adjust-url ;
|
||||||
|
|
||||||
|
: validate-secret ( -- )
|
||||||
|
"secret" value status-secret get =
|
||||||
|
[ validation-failed ] unless ;
|
||||||
|
|
Loading…
Reference in New Issue