Posted By:
Leslie_Chaim
Posted On:
Wednesday, October 1, 2003 07:04 AM
I really did some arm-twisting about a year ago... Knowing noting about Ant, I wrote this Makefile to handle all the various tasks (or targets). Given all the built in tasks from Ant could have made things easier. I wonder if there's any tool/utility which can convert Makfiles to Ant build scripts? Assuming there are none, I have some questions that I will keep on adding to this post as they come up. Thanks in advance for you assistance and guidance and comments. This is a target from the Makefile: ALL_SERVERS = UnixServ1 UnixServ2 UnixServ3 UnixServ4 install2prod: test $$(whoami) = "ops" # You must be ops to do the install @echo installing p
More>>
I really did some arm-twisting about a year ago...
Knowing noting about Ant, I wrote this Makefile to handle all the various tasks (or targets). Given all the built in tasks from Ant could have made things easier. I wonder if there's any tool/utility which can convert Makfiles to Ant build scripts?
Assuming there are none, I have some questions that I will keep on adding to this post as they come up. Thanks in advance for you assistance and guidance and comments.
This is a target from the Makefile:
ALL_SERVERS = UnixServ1 UnixServ2 UnixServ3 UnixServ4
install2prod:
test $$(whoami) = "ops" # You must be ops to do the install
@echo installing prod in /ops/daemon/app_dist to ${ALL_SERVERS}
cp -r classes/ app_dist_prod/bin/
cp app_dist.pl app_dist_prod/bin/
@for sys in ${ALL_SERVERS};
do
echo Installing on $$sys;
remsh $$sys rm -r /ops/daemon/app_dist;
rcp -r app_dist_prod/ $$sys:/ops/daemon/app_dist;
done
@echo All done
I have 6 tasks for the install2prod target with task 5 having 3 nested tasks:
-
Check if the current (Unix) login id is "ops"; abort if false
-
print a message "installing prod in /ops/daemon/app_dist to UnixServ1 UnixServ2 UnixServ3 UnixServ4"
-
Copy the classes dir tree to app_dist_prod/bin/
-
Copy the app_dist.pl script to app_dist_prod/bin/
-
Install to ALL_SERVERS:
-
Print a message "Installing on
sys
"
-
Delete the dir tree /ops/daemon/app_dist on
remote
sys
-
Copy the dir tree app_dist_prod/ to ops/daemon/app_dist on
remote
sys
-
Print a message "All done"
What would be the Ant equivalent?
More specifically:
-
How do you
remsh
or
rpc
in Ant?
-
How do you (or can you:() loop over a list of values such as ${ALL_SERVERS}?
Thanks,
Leslie
<<Less