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.
|
2014-11-15 19:20:49 -05:00
|
|
|
USING: hashtables http.client io.files.temp io.pathnames kernel
|
2012-06-18 15:26:02 -04:00
|
|
|
mason.common mason.config namespaces sequences ;
|
2010-09-07 00:43:51 -04:00
|
|
|
IN: mason.docs
|
2008-11-16 12:29:35 -05:00
|
|
|
|
2010-09-07 00:43:51 -04:00
|
|
|
: make-docs-archive ( -- )
|
2012-06-19 13:08:14 -04:00
|
|
|
[
|
|
|
|
{ "tar" "cfz" }
|
|
|
|
"docs.tar.gz" temp-file suffix
|
|
|
|
"docs" suffix
|
|
|
|
short-running-process
|
|
|
|
] with-cache-directory ;
|
2008-11-16 12:29:35 -05:00
|
|
|
|
2010-09-07 00:43:51 -04:00
|
|
|
: upload-docs-archive ( -- )
|
2012-06-18 15:26:02 -04:00
|
|
|
"docs.tar.gz" temp-file
|
2010-09-07 00:43:51 -04:00
|
|
|
docs-username get
|
|
|
|
docs-host get
|
2012-06-18 15:26:02 -04:00
|
|
|
docs-directory get "docs.tar.gz" append-path
|
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
|
2012-06-18 15:26:02 -04:00
|
|
|
] when ;
|