From 51faf8e3371d0a1d8d58b2c260b2fc4d8158dcf1 Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Sat, 12 Apr 2008 04:10:04 -0500 Subject: [PATCH] builder.release: refactor --- extra/builder/release/branch/branch.factor | 34 ++++++++++++++++++++++ extra/builder/release/tidy/tidy.factor | 29 ++++++++++++++++++ extra/builder/release/upload/upload.factor | 24 +++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 extra/builder/release/branch/branch.factor create mode 100644 extra/builder/release/tidy/tidy.factor create mode 100644 extra/builder/release/upload/upload.factor diff --git a/extra/builder/release/branch/branch.factor b/extra/builder/release/branch/branch.factor new file mode 100644 index 0000000000..7537d5bcf9 --- /dev/null +++ b/extra/builder/release/branch/branch.factor @@ -0,0 +1,34 @@ + +USING: system sequences prettyprint io.files io.launcher bootstrap.image + builder.util ; + +IN: builder.release.branch + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +: branch-name ( -- string ) "clean-" platform append ; + +: refspec ( -- string ) "master:" branch-name append ; + +: push-to-clean-branch ( -- ) + { "git" "push" "factorcode.org:/git/factor.git" refspec } + to-strings + try-process ; + +: upload-clean-image ( -- ) + { + "scp" + my-boot-image-name + "factorcode.org:/var/www/factorcode.org/newsite/images/clean" + } + to-strings + try-process ; + +: update-clean-branch ( -- ) + "factor" + [ + push-to-clean-branch + upload-clean-image + ] + with-directory ; + diff --git a/extra/builder/release/tidy/tidy.factor b/extra/builder/release/tidy/tidy.factor new file mode 100644 index 0000000000..f8f27e75f2 --- /dev/null +++ b/extra/builder/release/tidy/tidy.factor @@ -0,0 +1,29 @@ + +USING: kernel system io.files io.launcher builder.util ; + +IN: builder.release.tidy + +: common-files ( -- seq ) + { + "boot.x86.32.image" + "boot.x86.64.image" + "boot.macosx-ppc.image" + "boot.linux-ppc.image" + "vm" + "temp" + "logs" + ".git" + ".gitignore" + "Makefile" + "unmaintained" + "build-support" + } ; + +: remove-common-files ( -- ) + { "rm" "-rf" common-files } to-strings try-process ; + +: remove-factor-app ( -- ) + os macosx? not [ { "rm" "-rf" "Factor.app" } try-process ] when ; + +: tidy ( -- ) + "factor" [ remove-factor-app remove-common-files ] with-directory ; diff --git a/extra/builder/release/upload/upload.factor b/extra/builder/release/upload/upload.factor new file mode 100644 index 0000000000..38f6dcb133 --- /dev/null +++ b/extra/builder/release/upload/upload.factor @@ -0,0 +1,24 @@ + +USING: kernel namespaces io io.files + builder.util + builder.common + builder.release.archive ; + +IN: builder.release.upload + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +: remote-location ( -- dest ) + "factorcode.org:/var/www/factorcode.org/newsite/downloads" + platform + append-path ; + +: (upload) ( -- ) + { "scp" archive-name remote-location } to-strings + [ "Error uploading binary to factorcode" print ] + run-or-bail ; + +: upload ( -- ) + upload-to-factorcode get + [ (upload) ] + when ;