beautypg.com

Changing the default deploy target name – HP Integrity NonStop J-Series User Manual

Page 119

background image

Figure 80 Changing the default deploy target name

5.

Select OK to save your change and close the Properties dialog.

6.

Create a top-level file named makefile.targets. (For details, see

“Creating a

makefile.targets file for managed builds” (page 114)

).

7.

Add text similar to the following to makefile.targets (Remember to use a hard tab before
the echo command):

custom_deploy: all
echo -e "put ./Car.txe $(NSDEE_DEPLOY_DEST)/$(NSDEE_DEPLOY_FILENAME)\n \
chmod 754 $(NSDEE_DEPLOY_DEST)/$(NSDEE_DEPLOY_FILENAME)\n \
ls -l $(NSDEE_DEPLOY_DEST)/$(NSDEE_DEPLOY_FILENAME)\n \
exit" | sftp -b - $(NSDEE_DEPLOY_USER)@$(NSDEE_DEPLOY_SYSTEM)

The above custom_deploy target uses echo -e to pipe a series of commands to the
standard input of sftp instead of passing sftp a batch file. This allows the custom_deploy
target to take advantage of the environment variables set based on project properties in the
Settings (Remote) property page. For details on environment variables, see

“Environment

variables and build variables” (page 44)

.

Setting all as a dependency for custom_deploy, above, ensures that the project has been
built before the sftp command runs.

8.

Select Save from the File menu or select the Save icon

in the main tool bar to save your

changes to makefile.targets.

9.

Select the Car project in the NonStop Project Explorer view, then select Deploy Project from
the context menu to deploy the file Car.txe from the Car project. The Console view shows
output similar to the following:

**** Build of configuration Debug for project Car ****

make custom_deploy
echo -e "put ./Car.txe /home/chloe/test/car\n \
chmod 754 /home/chloe/test/car\n \
ls -l /home/chloe/test/car\n \
exit" | sftp -b - [email protected]
sftp> put ./Car.txe /home/chloe/test/car
Uploading ./Car.txe to /home/chloe/test/car
sftp> chmod 754 /home/chloe/test/car
Changing mode on /home/chloe/test/car
sftp> ls -l /home/chloe/test/car
-rwxr-xr-- 0 26143 102 3010816 Apr 4 16:43 /home/chloe/test/car
sftp> exit

Adding and customizing build targets

119

This manual is related to the following products: