2010-09-07 00:43:51 -04:00
|
|
|
! Copyright (C) 2008, 2010 Slava Pestov.
|
2008-11-16 12:29:35 -05:00
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2010-09-07 00:43:51 -04:00
|
|
|
USING: arrays hashtables help.html http.client io.directories
|
|
|
|
io.files io.launcher kernel make mason.common mason.config
|
|
|
|
namespaces sequences ;
|
|
|
|
IN: mason.docs
|
2008-11-16 12:29:35 -05:00
|
|
|
|
2010-09-07 00:43:51 -04:00
|
|
|
: make-docs-archive ( -- )
|
2008-11-16 12:29:35 -05:00
|
|
|
"factor/temp" [
|
2009-05-12 17:52:43 -04:00
|
|
|
{ "tar" "cfz" "docs.tar.gz" "docs" } short-running-process
|
2008-11-16 12:29:35 -05:00
|
|
|
] with-directory ;
|
|
|
|
|
2010-09-07 00:43:51 -04:00
|
|
|
: upload-docs-archive ( -- )
|
2008-11-16 12:29:35 -05:00
|
|
|
"factor/temp/docs.tar.gz"
|
2010-09-07 00:43:51 -04:00
|
|
|
docs-username get
|
|
|
|
docs-host get
|
|
|
|
docs-directory get "/docs.tar.gz" append
|
2008-11-16 12:29:35 -05:00
|
|
|
upload-safely ;
|
|
|
|
|
2010-09-07 00:43:51 -04:00
|
|
|
: notify-docs ( -- )
|
|
|
|
status-secret get "secret" associate
|
|
|
|
docs-update-url get
|
|
|
|
http-post
|
|
|
|
2drop ;
|
|
|
|
|
|
|
|
: upload-docs ( -- )
|
|
|
|
upload-docs? get [
|
|
|
|
make-docs-archive
|
|
|
|
upload-docs-archive
|
|
|
|
notify-docs
|
2009-04-17 21:59:59 -04:00
|
|
|
] when ;
|