Changeset 21723 for other-projects/nightly-tasks/snapshot/trunk
- Timestamp:
- 2010-02-22T14:48:36+13:00 (14 years ago)
- Location:
- other-projects/nightly-tasks/snapshot/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/nightly-tasks/snapshot/trunk/environment.pl.example
r21709 r21723 1 #where to keep snapshots 2 $ENV{'DATA_DIR'}="/data/snapshots"; 1 $ENV{'PATH'} = "/programs/release-kits/bin:$ENV{'PATH'}"; 3 2 4 #where to find release kits and ant5 $ENV{'PATH'} = "$ENV{'PATH'}:/programs/release-kits/bin";6 7 #java8 $ENV{'JAVA_HOME'} = "/usr/lib/jvm/java-1.5.0";9 $ENV{'PATH'} = "$ENV{'JAVA_HOME'}/bin:$ENV{'PATH'}";10 -
other-projects/nightly-tasks/snapshot/trunk/task.pl
r21709 r21723 2 2 do "$ENV{'TASK_HOME'}/lib.pl"; 3 3 4 #check key environment vars are set5 die "Please set a DATA_DIR in the nightly snapshot environment\n"6 if ! exists $ENV{'DATA_DIR'};7 4 die "Could not determine your operating system" 8 5 unless ( $^O =~ "linux|darwin|MSWin32" ); … … 25 22 if ( exists $ARGV[1] ) { 26 23 die "too many arguments to snapshot task\n"; 24 } 25 26 #default data dir 27 if ( ! exists $ENV{'DATA_DIR'} ) { 28 $ENV{'DATA_DIR'} = "$ENV{'HOME'}/snapshots"; 27 29 } 28 30 … … 58 60 if ( $ENV{'TASK_NAME'} =~ "caveat\$" ) { 59 61 $ENV{'UPLOAD_DIR'}="nzdl\@puka.cs.waikato.ac.nz:/greenstone/greenstone.org/base/caveat-emptor"; 60 61 if ( $major_version == 2 ) { 62 $ENV{'snapshot_id2'} = `wget -O - http://www.greenstone.org/next-release.txt 2>nul`; 63 chomp($ENV{'snapshot_id2'}); 64 } else { 65 $ENV{'snapshot_id3'} = `wget -O - http://www.greenstone.org/next-release-greenstone3.txt 2>nul`; 66 chomp($ENV{'snapshot_id3'}); 67 } 62 $ENV{'snapshot_id2'}=`ssh nzdl\@puka.cs.waikato.ac.nz cat /greenstone/greenstone.org/base/next-release.txt`; 63 64 #TODO: generalise this for all oses! 65 chomp($ENV{'snapshot_id2'}); 66 $ENV{'snapshot_id3'}=`ssh nzdl\@puka.cs.waikato.ac.nz cat /greenstone/greenstone.org/base/next-release-greenstone3.txt`; 67 chomp($ENV{'snapshot_id3'}); 68 68 69 69 #change the filenames to have the date in them … … 77 77 if ( $ENV{'TASK_NAME'} =~ "stable\$" ) { 78 78 $ENV{'BRANCH_PATH'}="stable"; 79 80 #dont proceed if main/stable is old 81 #get last changed date from svn 82 open( INFO, "svn info http://svn.greenstone.org/main/stable|" ) 83 or die "Cant determine age of stable tag"; 84 my $changed_date; 85 while ( my $line = <INFO>) { 86 chomp($line); 87 if ( $line =~ /^Last Changed Date:/ ) { 88 $changed_date = $line; 89 break; 90 } 91 } 92 close(INFO); 93 #change the format 94 $changed_date =~ s/.*: ([^ ]+) .*/\1/g; 95 if ( $changed_date !~ /^20[0-9]{2}-[0-9]{2}-[0-9]{2}$/ ) { 96 die "Cant determine age of stable tag"; 97 } 98 $changed_date =~ s/-/./g; 99 #check if main/stable is new 100 if ( $changed_date ne get_date() ) { 101 print "main/stable is old, will not create snapshot\n"; 102 exit; 103 } else { 104 print "main/stable is fresh, will create snapshot\n"; 105 } 79 106 } 80 107 $ENV{'UPLOAD_DIR'}="nzdl\@puka.cs.waikato.ac.nz:/greenstone/greenstone.org/base/release-snapshots"; … … 85 112 86 113 #always rename the log not to clash with other files on puka 87 $ENV{'munges'} = $ENV{'munges'} . " s/\.out/-" . get_date() . "-" . $^O . "-log.txt/"; 114 $ENV{'munges'} = $ENV{'munges'} . " s/\.out/-" . get_date() . "-log.txt/"; 115 116 88 117 89 118 #choose a snapshot ID
Note:
See TracChangeset
for help on using the changeset viewer.