|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: S T
Length: 16975 (0x424f)
Types: TextFile
Names: »STEPS«
└─⟦25882cbde⟧ Bits:30000536 8mm tape, Rational 1000, RCI_RS6000_AIX_IBM 2_0_2
└─⟦b8efda8ac⟧ »DATA«
└─⟦this⟧
INSTALL_CUSTOMIZATION => (
Do_Step
(Step => "AUTHORIZATION_CHECK,
RELEASE_RESTORE,
INSTALL_PRODUCT,
REGISTER_TARGET,
RECORD_INSTALLATION");
)
AUTHORIZATION_CHECK => (
declare
package Pp is new Parameter_Parser (Boolean);
use Directory_Tools;
Product : constant string := Naming.Simple_Name (Naming.Full_Name ("^"));
Customization : constant string := Product (Product'First + 4..Product'Last);
Iter : Pp.Iterator := Pp.Parse ("CMVC, CMVC.Source_Control, RCI, " & Customization);
Token_Iter : Pp.Iterator := Pp.Parse ("RCI");
Error : Natural := 0;
function Product_Name (Iter : Pp.Iterator) return String is
begin
if String_Utilities.Equal (Pp.Name (Iter), "NAME") then
return Pp.Get_Image (Iter);
else
return Pp.Name (Iter);
end if;
end Product_Name;
begin
while not Pp.Done (Iter) loop
declare
Name : constant String := Product_Name (Iter);
begin
if "!Implementation".Product_Authorization.Is_Registered
(Name) then
Log.Put_Line (Name & " is authorized", Profile.Positive_Msg);
else
Log.Put_Line ("Need to Authorize " & Name,
Profile.Error_Msg);
Error := Error + 1;
end if;
end;
Pp.Next (Iter);
end loop;
if Error /= 0 then
Log.Put_Line
("Do not proceed until all these products have been authorized",
Profile.Error_Msg);
end if;
if Get_Site /= "" and then not Pp.Done (Token_Iter) then
Error := 0;
Log.Put_Line ("Checking Token Count");
declare
Limit, Current, Buy_Out : Natural;
begin
while not Pp.Done (Token_Iter) loop
"Command_Data".
Token_Information
(Product_Name (Token_Iter), Limit, Buy_Out, Current);
if Limit = 0 then
Error := Error + 1;
Log.Put_Line
("No tokens (sessions) for " &
Product_Name (Token_Iter) &
" have been authorized. Do not proceed until you have authorized tokens for this product",
Profile.Error_Msg);
elsif (Buy_Out /= Current) and Current = Limit then
Log.Put_Line
("Tokens (Sessions) have been authorized for " &
Product_Name (Token_Iter) & ", but all are in use",
Profile.Error_Msg);
Log.Put_Line
("Have users which are using these tokens log off (and then back on) before continuing",
Profile.Error_Msg);
Show_Tokens (Product_Filter =>
Product_Name (Token_Iter));
else
Log.Put_Line (Product_Name (Token_Iter) &
" has available tokens",
Profile.Positive_Msg);
end if;
Pp.Next (Token_Iter);
end loop;
end;
else
Log.Put_Line
("Machine has not been configured for per session pricing (product tokens)." &
" Skipping product token check");
end if;
end;
)
RELEASE_RESTORE => (
Io.Set_Output ("Logs.Release_Restore_Log");
Archive.Restore (Options => "Promote, Replace", Device => "Release");
if Directory_Tools.Object.Is_Ok (The_Objects =>
Directory_Tools.Naming.Resolution
("Release_Notes.[Data,Index]")) then
Archive.Restore (Options => "promote, replace",
Device => "Release_Notes");
end if;
Io.Reset_Output;
Log.Filter_Errors (Log_File => "Logs.Release_Restore_Log",
Destination => "Logs.Release_Restore_Log_Summary",
Auxiliaries => False,
Warnings => False,
Exceptions => True);
Common.Definition ("Logs.Release_Restore_Log_Summary");
)
INSTALL_PRODUCT => (
declare
use Directory_Tools;
Starting_Context : constant string := Naming.Default_Context;
Product : constant string := Naming.Simple_Name (Naming.Full_Name ("^"));
Customization : constant string := Product (Product'First + 4..Product'Last);
Release : constant string := Naming.Simple_Name (Naming.Full_Name ("$"));
Version : constant string := Release (Release'First + 7..Release'last);
Install_Lib : constant string := "!Targets.Implementation.Release_" & Customization & "_" & Version;
Found : Boolean := False;
function Rci_Target_File return String is
use Directory_Tools;
begin
if Object.Is_Ok (The_Object =>
Naming.Resolution
("!Machine.Initialization.Rational")) then
return "!Machine.Initialization.Site.RCI_Configuration";
else
return "!Machine.RCI_Targets";
end if;
end Rci_Target_File;
begin
Io.Set_Output ("!Machine.Temporary.RCI_Targets");
Io.Set_Input (Rci_Target_File);
while not Io.End_Of_File loop
declare
Name : constant String := String_Utilities.Strip (Io.Get_Line);
begin
Found := Found or (String_Utilities.Locate (Name, Customization) /= 0);
Io.Put_Line (Name);
end;
end loop;
if not Found then
Io.Put_Line (Customization);
end if;
Io.Reset_Output;
Io.Reset_Input;
Lib.Move (From => "!Machine.Temporary.RCI_Targets",
To => Rci_Target_File,
Response => "<ERRORS>");
Io.Set_Output ("Logs.Install_Product_Log");
Library.Context (To_Be => Install_Lib);
System_Utilities.Set_Page_Limit (16_000);
Program.Run (S => "Install_Customization (""" & Customization & """);",
Context => Install_Lib,
Response => "<PROFILE>");
Library.Context (To_Be => Starting_Context);
Io.Reset_Output;
Log.Filter_Errors
(Log_File => "Logs.Install_Product_Log",
Destination => "Logs.Install_Product_Log_Summary",
Warnings => False,
Auxiliaries => False,
Exceptions => True);
Common.Definition ("Logs.Install_Product_Log_Summary");
end;
)
REGISTER_TARGET => (
declare
J : Program.Job_Id;
Stat : Program.Condition;
begin
Kill_Rci_Main;
Program.Create_Job (S => "Compilation_Integrator",
Job => J,
Status => Stat,
Debug => False,
Context => "!Machine.Initialization.Rational",
After => 0.0,
Options => "",
Response => "<PROFILE>");
if Program.Started_Successfully (Stat) then
Program.Wait_For (J);
else
Log.Put_Line ("Failure executing Compilation_Integrator: " &
Simple_Status.Display_Message (Stat), Profile.Error_Msg);
end if;
end;
)
TEST_RELEASE => (
Do_Step
(Step => "TEST_RESTORE,
TEST_EXECUTION");
)
TEST_RESTORE => (
declare
use Directory_Tools;
Starting_Context : constant String := Naming.Default_Context;
Product : constant String := Naming.Simple_Name (Naming.Full_Name ("^"));
Customization : constant String := Product
(Product'First + 4 .. Product'Last);
Release : constant String := Naming.Simple_Name (Naming.Full_Name ("$"));
Version : constant String := Release (Release'First + 7 .. Release'Last);
Install_Lib : constant String :=
"!Targets.Implementation.Release_" & Customization & "_" & Version;
type Ptr_String is access String;
Username, Password, Machine, Directory_Name : Ptr_String;
function Get_Line
(Prompt : String; Min_Length : Natural := 1) return String is
S : String (1 .. 80);
Last : Natural := 0;
begin
loop
Io.Put (Prompt);
Io.Get_Line (S, Last);
exit when Last >= Min_Length;
Io.Put_Line ("ERROR: Must enter a value with" &
Natural'Image (Min_Length) & " characters");
end loop;
return (S (1 .. Last));
end Get_Line;
function Build_Lib_Name (Lib : String; Dir : String) return String is
Index : Natural := String_Utilities.Reverse_Locate ('/', Lib);
begin
if Index = 0 then
return "~/" & Dir;
else
return Lib (Lib'First .. Index - 1) & '/' & Dir;
end if;
end Build_Lib_Name;
begin
Machine := new String'(Get_Line ("Enter Remote Machine Name : ", 1));
Io.Put_Line ("Resolved " &
Transport_Name.Host_Id_To_Host
(Transport_Name.Host_To_Host_Id (Machine.all)) &
" successfully.");
Username := new String'(Get_Line ("Enter Remote Username : ", 0));
Password := new String'(Get_Line ("Enter Remote Password : ", 0));
Directory_Name :=
new String'
(Get_Line
("Enter Remote USER directory name (ex. /usr/sam ): ", 1) &
'/' & Customization & Version);
Switches.Set (Spec =>
"Session_Ftp.Username:=""" & Username.all &
""";Session_FTP.Password:=""" & Password.all & """",
File => "<SESSION>",
Response => "<ERRORS>");
Io.Set_Output ("Logs.Test_Restore_Log");
Archive.Restore (Options => "Promote,Replace", Device => "Tests");
Library.Context
(To_Be => "!TESTS.STAGING.INSTALL_VERIFICATIONS.RCI.TEST_SUBSYSTEM");
Rci_Cmvc.Make_Path (From_Path => "R1000_Working",
New_Path_Name => Customization,
Remote_Machine => Machine.all,
Remote_Directory => Directory_Name.all,
View_To_Import => "",
Model => "!Model." & Customization,
Goal => Compilation.Coded,
Response => "<PROFILE>");
Library.Context (To_Be => Customization & "_Working.Units",
Response => "<PROFILE>");
Rci.Link (Main_Unit => "hello",
Make_Uncoded_Units => False,
Executable_Name => "hello",
Response => "~---,<PROGRESS>");
Library.Context (To_Be => Starting_Context);
Io.Reset_Output;
Log.Filter_Errors (Log_File => "Logs.Test_Restore_Log",
Destination => "Logs.Test_Restore_Log_Summary",
Auxiliaries => False,
Warnings => False,
Exceptions => True);
Common.Definition ("Logs.Test_Restore_Log_Summary");
exception
when Transport_Name.Undefined =>
Log.Put_Line
("Cannot resolve the machine name, please enter this into the Transport_Name_Map and rerun this step",
Profile.Error_Msg);
end;
)
TEST_EXECUTION => (
declare
use Directory_Tools;
Starting_Context : constant String := Naming.Default_Context;
Product : constant String := Naming.Simple_Name (Naming.Full_Name ("^"));
Customization : constant String := Product
(Product'First + 4 .. Product'Last);
begin
Io.Set_Output ("Logs.Test_Execution_Log");
Library.Context
(To_Be => "!TESTS.STAGING.INSTALL_VERIFICATIONS.RCI.TEST_SUBSYSTEM." &
Customization & "_Working.Units",
Response => "<PROFILE>");
Rci.Execute_Remote_Command (Remote_Command => "./hello");
Library.Context (To_Be => Starting_Context);
Io.Reset_Output;
Log.Filter_Errors (Log_File => "Logs.Test_Execution_Log",
Destination => "Logs.Test_Execution_Log_Summary",
Auxiliaries => False,
Warnings => False,
Exceptions => True);
Common.Definition ("Logs.Test_Execution_Log_Summary");
end;
)
RECORD_INSTALLATION => (
declare
Product : constant String := Directory_Tools.Naming.Simple_Name
(Directory_Tools.Naming.Full_Name ("^"));
Release : constant String := Directory_Tools.Naming.Simple_Name
(Directory_Tools.Naming.Full_Name ("$"));
Product_Info : constant String :=
"(RELEASE => " & Release & ", DATE => (" &
Time_Utilities.Image (Time_Utilities.Get_Time,
Time_Utilities.Year_Month_Day) &
"), USER => " & System_Utilities.User_Name &
'.' & System_Utilities.Session_Name & ")";
Product_Filename : constant String := "!Machine.Release.Current.Products";
F : Io.File_Type;
begin
Io.Append (F, Name => Product_Filename);
Io.Put_Line (F, Product & " => " & Product_Info);
Io.Close (F);
Log.Put_Line ("Recording product " & Product &
" current release as " & Release,
Profile.Positive_Msg);
end;
)
DESTROY_OLD_RELEASES => (
Io.Set_Output
("!Machine.Release.Archive.RCF_RS6000_AIX_IBM.Release1_0_2.Logs.Destroy_Old_Releases_Log");
Cmvc.Destroy_View
(What_View =>
"!Targets.Implementation.Release_Rs6000_Aix_Ibm_1_0_2.[[_install_activity]$$^.@'C(Spec_View,Load_View),~[_install_activity]]",
Demote_Clients => False,
Destroy_Configuration_Also => True,
Comments => "",
Work_Order => "<DEFAULT>",
Response => "<PROFILE>");
Compilation.Destroy
(Unit => "!Targets.Implementation.[Release_Rs6000_Aix_IBM@,~Release_Rs6000_Aix_IBM_1_0_2]",
Threshold => 999,
Limit => "<ALL_WORLDS>",
Response => "<PROFILE>");
Io.Reset_Output;
Log.Filter_Errors
(Log_File =>
"!Machine.Release.Archive.RCF_RS6000_AIX_IBM.Release1_0_2.Logs.Destroy_Old_Releases_Log",
Destination =>
"!Machine.Release.Archive.RCF_RS6000_AIX_IBM.Release1_0_2.Logs.Destroy_Old_Releases_Log_Summary",
Auxiliaries => False,
Warnings => False,
Exceptions => True);
Common.Definition
("!Machine.Release.Archive.RCF_RS6000_AIX_IBM.Release1_0_2.Logs.Destroy_Old_Releases_Log_Summary");
)
CLEANUP => (
declare
use Directory_Tools;
Starting_Context : constant string := Naming.Default_Context;
Product : constant string := Naming.Simple_Name (Naming.Full_Name ("^"));
Customization : constant string := Product (Product'First + 4..Product'Last);
Release : constant string := Naming.Simple_Name (Naming.Full_Name ("$"));
Version : constant string := Release (Release'First + 7..Release'last);
Install_Lib : constant string := "!Targets.Implementation.Release_" & Customization & "_" & Version;
begin
Library.Context
(To_Be =>
"!Tests.Staging.Install_Verifications.RCI.Test_Subsystem",
Response => "<ERRORS>");
Cmvc.Destroy_View (What_View => "R1000_Working",
Demote_Clients => False,
Destroy_Configuration_Also => False,
Comments => "",
Work_Order => "<DEFAULT>",
Response => "<ERRORS>");
Rci_Cmvc.Destroy_View (What_View => Customization & "_Working",
Demote_Clients => True,
Destroy_Configuration_Also => False,
Destroy_Remote_Library => True,
Comments => "",
Work_Order => "<DEFAULT>",
Response => "<ERRORS>");
Library.Context
(To_Be =>
"!Tests.Staging.Install_Verifications.RCI",
Response => "<ERRORS>");
Cmvc.Destroy_Subsystem (What_Subsystem => "Test_Subsystem",
Comments => "",
Work_Order => "<DEFAULT>",
Response => "<ERRORS>");
Library.Context (To_Be => Starting_Context, Response => "<ERRORS>");
Switches.Set (Spec =>
"Session_Ftp.Username:="""";Session_FTP.Password:=""""",
File => "<SESSION>",
Response => "<ERRORS>");
Compilation.Destroy
(Unit => "[$" & "," & Install_Lib & ".[@,~Install_Activity]]",
Threshold => 999,
Limit => "<ALL_WORLDS>",
Response => "<ERRORS>");
end;
)
STEP_CHECK => (
-- This must remain the last step in the step file and is used
-- as a first level verification of the step file parse and
-- tape load.
Log.Put_Line ("Step File parses correctly", Profile.Positive_Msg);
)