Enable uploading.
[goaljobs-goals.git] / libguestfs_upstream.ml
index 6180989..4c32dfd 100644 (file)
@@ -67,19 +67,19 @@ let rec goal website_updated version =
 
 (* Goal: website has been rsync'd. *)
 and website_rsync_done version =
-  let key = sprintf "libguestfs_website_rsync_done_%s" version.version in
-  target (memory_exists key);
+  target (url_contains_string "http://libguestfs.org" version.version &&
+          url_exists version.url);
 
   sh "
     cd %s
-    echo NOT RUNNING: . .rsync
-  " libguestfs_website_cvs;
-  memory_set key "1"
+    ./.rsync
+  " libguestfs_website_cvs
 
 (* Goal: Tarball added to CVS and CVS checked in. *)
 and website_cvs_checked_in version =
   let key = sprintf "libguestfs_website_cvs_checked_in_%s" version.version in
   target (memory_exists key);
+  onrun (fun () -> memory_set key "1");
 
   require (tarball_created version);
   require (tarball_tested version);
@@ -87,8 +87,8 @@ and website_cvs_checked_in version =
   sh "
     cd %s
     cp %s/tarballs/%s %s
-    echo NOT RUNNING: cvs add -kb %s
-    echo NOT RUNNING: cvs ci -m \"Version %s\"
+    cvs add -kb %s
+    cvs ci -m \"Version %s\"
   " libguestfs_website_cvs
     buildtmp version.tarball version.urlpath
     version.urlpath
@@ -127,6 +127,7 @@ and website_built version =
 and tarball_tested version =
   let key = sprintf "libguestfs_tarball_tested_%s" version.version in
   target (memory_exists key);
+  onrun (fun () -> memory_set key "1");
 
   require (tarball_created version);
 
@@ -183,6 +184,7 @@ and commit_tested branch commit =
 
   let key = sprintf "libguestfs_commit_tested_%s" commit in
   target (memory_exists key);
+  onrun (fun () -> memory_set key "1");
 
   let repodir = sprintf "%s/repos/%s-%s" buildtmp package branch in
   require (directory_exists repodir);
@@ -202,9 +204,7 @@ and commit_tested branch commit =
   " repodir
     commit
     (quote (libguestfs_localconfigure `Git))
-    (quote libguestfs_localenv);
-
-  memory_set key "1"
+    (quote libguestfs_localenv)
 
 (* Helper function to make a full 'info' object from a version
  * number.
@@ -289,3 +289,19 @@ let () =
       let version = git_latest_version "master" in
       require (website_updated version)
   )
+
+(* Allow these jobs to run from the command line. *)
+let () =
+  publish "commit" (
+    function
+    | [commit] -> require (commit_tested "master" commit)
+    | [branch; commit] -> require (commit_tested branch commit)
+    | _ ->
+      failwith "use './libguestfs_upstream commit [<branch>] <commit>'"
+  );
+  publish "release" (
+    function
+    | [version] -> require (website_updated (vernames version))
+    | _ ->
+      failwith "use './libguestfs_upstream release <version>'"
+  )