• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Shell script, anyone?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shell script, anyone?


  • Subject: Re: Shell script, anyone?
  • From: Art Isbell <email@hidden>
  • Date: Fri, 1 Aug 2003 15:15:14 -1000

On Friday, August 1, 2003, at 01:31  PM, Goodbye Bill wrote:

I would like to create a simply shell script to execute a few commands in
terminal to compile my project for deployment and to copy all of the
resources (images, etc.) to the target server. Could someone give me a
quick 1-2-3 tutorial for creating such a shell script?

The following is a shell script that will install a WO app. It must be run with the project directory as the current directory by a user with sudo privileges; an admin user qualifies.


#! /bin/sh

sudo pbxbuild install -buildstyle Deployment DSTROOT=/
sudo pbxbuild install -buildstyle WebServer DSTROOT=/

You could then add commands that create tar archives of the installed files (assuming OS X as the development platform):

proj_path=`pwd`
proj_name=`basename $proj_path`
cd /Library/WebObjects/Applications
sudo gnutar -zcf /tmp/${proj_name}-Deployment.tgz ${proj_name}.woa
cd /Library/WebServer/Documents/WebObjects
sudo gnutar -zcf /tmp/${proj_name}-WebServer.tgz ${proj_name}.woa

At this point you'd have two files in /tmp that would have to be moved to the application and Web servers for installation. Doing this using a shell script would likely buck up against Unix' security restrictions, something you may not be familiar with coming from the Windows world. (Sorry :-) This is because these tar archives would need to be unarchived with root privileges; doing so over a network is asking for trouble.

So depending on your application and Web server platforms, you'd need to move these files to them in an appropriate manner. You could use scp for any system with SSH installed. Then on the application and Web servers (assuming Unix), you'd need to execute as root something like:

cd installation_directory
gnutar -zxpf path_to_tar_archive

	None of this is tested, so consider it pseudo-code.

Aloha,
Art
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Shell script, anyone?
      • From: Goodbye Bill <email@hidden>
References: 
 >Shell script, anyone? (From: Goodbye Bill <email@hidden>)

  • Prev by Date: Re: two one-to-one relations between two tables
  • Next by Date: Re: Saving entities problem [SOLVED]
  • Previous by thread: Re: Shell script, anyone?
  • Next by thread: Re: Shell script, anyone?
  • Index(es):
    • Date
    • Thread