Changeset 4193 for trunk/tools


Ignore:
Timestamp:
Sep 5, 2000, 7:36:22 PM (25 years ago)
Author:
bird
Message:

Updated daily build macros:

  • better cleanup.
  • not so many directories. Logs are now moved to be a child of the dailybuild-script directory. so are database backups.
  • more flexible database backup.
Location:
trunk/tools/DailyBuild
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/DailyBuild/job.cmd

    r3842 r4193  
    1 /* $Id: job.cmd,v 1.2 2000-07-18 11:18:13 bird Exp $
     1/* $Id: job.cmd,v 1.3 2000-09-05 17:36:21 bird Exp $
    22 *
    33 * Main job for building OS/2.
     
    1313    call SysloadFuncs;
    1414
    15     sLogFile = '..\logs\' || Date(S) || '.log';
    16     sTree    = 'tree' || Date(S);
     15    /*
     16     * Get source directory of this script
     17     */
     18    parse source sd1 sd2 sScript
     19    sScriptDir = filespec('drive', sScript) || filespec('path', sScript);
     20    sLogFile = sScriptDir || '\logs\' || Date('S') || '.log';
     21    sTree    = sScriptDir || '..\tree' || Date('S');
    1722
    1823    /*
    1924     * Clean tree, get it and build it.
    2025     */
    21     'mkdir ..\'||sTree
    22     'cd ..\'||sTree
     26    'mkdir' sTree
     27    filespec('drive', sScript);
     28    'cd' sTree;
    2329    if (rc <> 0) then call failure rc, 'cd ..\'sTree 'failed.';
    24     'call ..\scripts\odin32env.cmd'
     30    'call' sScriptDir || 'odin32env.cmd'
    2531    if (rc <> 0) then call failure rc, 'Env failed.';
    26     'call ..\scripts\odin32clean.cmd'
     32    'call' sScriptDir || 'odin32clean.cmd'
    2733    if (rc <> 0) then call failure rc, 'Clean failed.';
    28     'call ..\scripts\odin32get.cmd'
     34    'call' sScriptDir || 'odin32get.cmd'
    2935    if (rc <> 0) then call failure rc, 'Get failed.';
    30     'call ..\scripts\odin32build.cmd 2>&1 | tee /a ' || sLogFile; /* 4OS/2 tee command. */
     36    'call' sScriptDir || 'odin32build.cmd 2>&1 | tee /a ' || sLogFile; /* 4OS/2 tee command. */
    3137    if (rc <> 0) then call failure rc, 'Build failed.';
    3238
     
    3440     * Pack and upload it.
    3541     */
    36     'call ..\scripts\odin32pack.cmd  2>&1 | tee /a ' || sLogFile; /* 4OS/2 tee command. */
     42    'call' sScriptDir || 'odin32pack.cmd  2>&1 | tee /a ' || sLogFile; /* 4OS/2 tee command. */
    3743    if (rc <> 0) then call failure rc, 'Packing failed.';
    38     'start /BG "Uploading Odin..." nice -f cmd /C ..\scripts\odin32ftp2.cmd';
     44    'start /BG "Uploading Odin..." nice -f cmd /C' sScriptDir || 'odin32ftp2.cmd';
    3945    if (rc <> 0) then say 'rc='rc' FTPing failed. i = ' || i;
    4046
     
    4248     * database update
    4349     */
    44     '..\scripts\odin32db.cmd  2>&1 | tee /a ' || sLogFile; /* 4OS/2 tee command. */
     50    sScriptDir || 'odin32db.cmd  2>&1 | tee /a ' || sLogFile; /* 4OS/2 tee command. */
    4551    if (rc <> 0) then call failure rc, 'db failed.';
    4652
     
    5258    'cd c:\odin32';
    5359    if (rc <> 0) then call failure rc, 'cd c:\odin32 failed.';
    54     'unzip -o d:\odin32\tree\*debug.zip';
     60    'unzip -o ' || sTree || '*debug.zip';
    5561    if (rc <> 0) then call failure rc, 'unzip failed.';
    5662    'd:'
     
    6874    say 'rc='rc sText
    6975    exit(rc);
     76
  • trunk/tools/DailyBuild/odin32clean.cmd

    r3451 r4193  
    1 /* $Id: odin32clean.cmd,v 1.1 2000-04-27 11:32:24 bird Exp $
     1/* $Id: odin32clean.cmd,v 1.2 2000-09-05 17:36:22 bird Exp $
    22 *
    3  * Deletes the tree (current directory and all subdirectories).
     3 * Removes trees. WARNING!!!!! All tree<date> directories are removed
     4 * if .nodelete is not found in the root of them.
    45 *
    5  * (assumes that rd is equal to "deltree"  (which it is in my installation).
     6 * (Delpath is a "deltree" clone I've made, use your own.)
    67 *
    78 * Copyright (c) 1999-2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     
    1011 *
    1112 */
    12     'echo y > %temp%\y_odin32';
    13     'rd . < %temp%\y_odin32';
    14     if RC <> 0 then call failure rc, 'Del failed.';
    15     'del %temp%\y_odin32';
     13
     14    call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs';
     15    call SysloadFuncs;
     16
     17    sTree    = 'tree' || Date(S);
     18
     19    /*
     20     * We assume currentdirectory is the current tree.
     21     */
     22    rc = SysFileTree('..\tree'||substr(Date('S'),1,4)||'*.', 'asTrees', 'DO');
     23    if (rc = 0) then
     24    do
     25        do i = 1 to asTrees.0
     26            if (stream(asTrees.i||'\.nodelete', 'c', 'query exists') = '') then
     27            do
     28                'echo y | delpath' asTrees.i;
     29            end
     30            say asTrees.i
     31        end
     32    end
     33
    1634    exit(0);
    1735
  • trunk/tools/DailyBuild/odin32db.cmd

    r3451 r4193  
    1 /* $Id: odin32db.cmd,v 1.1 2000-04-27 11:32:25 bird Exp $
     1/* $Id: odin32db.cmd,v 1.2 2000-09-05 17:36:22 bird Exp $
    22 *
    33 * Updates the Odin32 API database.
     
    1111    call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs';
    1212    call SysloadFuncs;
     13
     14    /*
     15     * Get source directory of this script
     16     */
     17    parse source sd1 sd2 sScript
     18    sScriptDir = filespec('drive', sScript) || filespec('path', sScript);
    1319
    1420    'cd tools\database';
     
    2632
    2733    /* create database backup */
    28     'c:'
     34    filespec('drive', getMySqlDataDir());
    2935    if rc <> 0 then call failure rc, 'c: failed';
    30     'cd c:\emx\mysql\data\odin32'
     36    'cd' getMySqlDataDir()||'\odin32';
    3137    if rc <> 0 then call failure rc, 'cd <> failed';
    3238    'mysqladmin refresh';
    33     'rar a -m5 d:\temp\db'||date(S)||'.rar *'
     39    'rar a -m5 ' || sScriptDir || 'dbbackup\db'||date(S)||'.rar *'
    3440    if rc <> 0 then call failure rc, 'rar db failed';
    3541    'cd \';
     
    4349    exit(rc);
    4450
     51
     52/*
     53 * Get the MySql data directory.
     54 */
     55getMySqlDataDir: procedure
     56
     57    /* Get mysql variables */
     58    '@mysqladmin variables | rxqueue /lifo'
     59
     60    /* Get datadir */
     61    sDataDir = '';
     62    do queued()
     63        pull s;
     64        if (pos(' DATADIR ', s) > 0) then
     65        do
     66            sDataDir = strip( substr( s, pos('|',s,3) + 1 ) );
     67            sDataDir = strip( substr(sDataDir, 1, length(sDataDir)-1) );
     68            leave;
     69        end
     70    end
     71
     72    /* Drain queue */
     73    do queued()
     74        pull s
     75    end
     76    drop s;
     77
     78    /* If failure set default directory. */
     79    if (sDataDir = '') then
     80        sDataDir = 'd:\knut\Apps\MySql\data\';
     81    return sDataDir;
     82
  • trunk/tools/DailyBuild/readme.txt

    r3452 r4193  
    1 /* $Id: readme.txt,v 1.1 2000-04-27 12:00:10 bird Exp $ */
     1/* $Id: readme.txt,v 1.2 2000-09-05 17:36:22 bird Exp $ */
    22
    33This is a short readme for the daily builder scripts. These are all the
     
    77Directory structure
    88-------------------
    9 The build scripts assumes that the scripts are found in ..\scripts and
    10 that the Odin32 CVS tree checkout is to be placed in ..\tree (relative to
    11 the starting directory). The job.cmd is normally started from the scripts
    12 directory, and starts out changing the to ..\tree.
     9The build scripts assumes that the scripts are found in ..\DailyBuild and
     10that the Odin32 CVS tree checkout is to be placed in ..\tree<date> (relative
     11to the start directory). The job.cmd is normally started from the
     12DailyBuild directory, and starts out changing the to ..\tree<date>.
    1313Logs are placed in ..\logs.
    1414
    15     <basedir>\scripts   - All these scripts.
    16     <basedir>\tree      - The CVS tree (don't work on this, tree it's delete every night...).
    17     <basedir>\logs      - Logs.
     15    <basedir>\DailyBuild        - All these scripts.
     16    <basedir>\tree<date>        - The CVS tree (don't work on this, tree it's delete every night...).
     17    <basedir>\DailyBuild\logs   - Logs.
     18    <basedir>\DailyBuild\dbbackup   - Database backups.
    1819
    1920
     
    5051      (I have a very simple one if needed.)
    5152
    52 Thu 27.04.2000
     53Tue 05.09.2000
    5354  knut
Note: See TracChangeset for help on using the changeset viewer.