sdp_sync.sh #2

  • //
  • guest/
  • russell_jackson/
  • sdp/
  • Server/
  • Unix/
  • p4/
  • common/
  • bin/
  • sdp_sync.sh
  • Commits
# Change User Description Committed
#2 22700 Russell C. Jackson (Rusty) Added chown for the /p4/ssl dir
Removed more unncessary files and settings
#1 22693 Russell C. Jackson (Rusty) Branched a Unix only version of the SDP.
Removed extra items to create a cleaner tree.
Moved a few items around to make more sense without Windows in the mix.
//guest/perforce_software/sdp/dev/Server/Unix/p4/common/bin/sdp_sync.sh
#19 22628 C. Thomas Tyler Fixed minor order-of-processing bug resulting in a harmless error
appearing at the end of script processing as cleanTrash() was
called to clean garbage files.  The run() function was called to
clean garbage files/dirs just as a directory that function depended
on got cleaned up.

The fix was applied to scripts that used libcore.sh, including the
template.sh template script.

Also corrected comments in p4u_env.sh.

Bypassing pre-commit review as this has been well tested.

#review-22629
#18 22599 C. Thomas Tyler Enhanced sdp_sync.sh to allow per-machine configurable setting of the
SDP_STATUS_DIRS setting.  So of helix-01 has /p4/1/bin/ and /p4/abc/bin,
and helix-02 has /p4/acme/bin and /p4/fgs/bin, that can be configured
using optional per-host config file named sdp_status_dirs.<host>.cfg
in /p4/common/config.
#17 22552 C. Thomas Tyler Fixed bug in sdp_sync.sh.

Corrected number of parameters in call to rrun().

Bypassing pre-commit review; this will be a hot fix.

#review-22553
#16 22539 C. Thomas Tyler Fixed a minor typo causing text SDPInstance to show instead of
the value of $SDPInstance.

#review-22540
#15 22404 C. Thomas Tyler Routine Merge Down to dev from main for sdp.
#14 21962 C. Thomas Tyler Updated various scripts to use run() and rrun() functions in favor
of predecessor runCmd() and runRemoteCmd().  The older functions won't
be removed to avoid breaking scripts that rely on their behavior and
have no issues with them.  The newer fuctions are more scalable and
avoid erroneous "Argument list too long" from bash due to buffer
overruns when used with commands with large amounts of output.

Enhanced runRemoteCmd() to clean up after itself, as it generated files
in /tmp that didn't get automatically cleaned up.  If used in scripts
called very often (e.g. every 5 minutes in a crontab), this leads to
significant issues with /tmp filling up with garbage files over a
period of several weeks.

Enhanced test_utils.sh to test new run() and rrun() calls.
#13 19930 C. Thomas Tyler sdp_sync.sh v2.1.7:
* Enhanced to avoid P4ENVIRO hijacking.
* Enahcned to work on an HMS host.
* Fixed environment bug (unset OSUSER, SDPMAIL) that prevented 'p4 status'
checks and crontab verifications.
* Fixed error message  for case where login failure is misdiagnosed as
files being checked out.
#12 17259 C. Thomas Tyler sdp_sync.sh v2.1.5:
* Fixed bug detecting the case where there is a null crontab.
#11 16784 C. Thomas Tyler Routine Merge Down to dev from main using:
p4 -s merge -n -b perforce_software-sdp-dev
#10 16638 C. Thomas Tyler Routine merge down to dev from main using:
p4 merge -b perforce_software-sdp-dev
#9 16563 C. Thomas Tyler Routine Merge Down to dev from main using:
p4 merge -b perforce_software-sdp-dev
p4 resolve -as
#8 16029 C. Thomas Tyler Routine merge to dev from main using:
p4 merge -b perforce_software-sdp-dev
#7 15778 C. Thomas Tyler Routine Merge Down to dev from main.
#6 13906 C. Thomas Tyler Normalized P4INSTANCE to SDP_INSTANCE to get Unix/Windows
implementations in sync.

Reasons:
1. Things that interact with SDP in both Unix and Windows
environments shoudn't have to account for this obscure
SDP difference between Unix and Windows.  (I came across
this doing CBD work).

2. The Windows and Unix scripts have different variable
names for defining the same concept, the SDP instance.
Unix uses P4INSTANCE, while Windows uses SDP_INSTANCE.

3. This instance tag, a data set identifier, is an SDP concept.
I prefer the SDP_INSTANCE name over P4INSTANCE, so I prpose
to normalize to SDP_INSTANCE.

4. The P4INSTANCE name makes it look like a setting that might be
recognized by the p4d itself, which it is not.  (There are other
such things such as P4SERVER that could perhaps be renamed as
a separate task; but I'm not sure we want to totally disallow
the P4 prefix for variable names. It looks too right to be wrong
in same cases, like P4BIN and P4DBIN.  That's a discussion for
another day, outside the scope of this task).

Meanwhile:
* Fixed a bug in the Windows 2013.3 upgrade script that
was referencing undefined P4INSTANCE, as the Windows
environment defined only SDP_INSTANCE.

* Had P4INSTANCE been removed completely, this change would
likely cause trouble for users doing updates for existing
SDP installations.  So, though it involves slight technical debt,
I opted to keep a redundant definition of P4INSTANCE
in p4_vars.template, with comments indicating SDP_INSTANCE should be
used in favor of P4INSTANCE, with a warning that P4INSTANCE
may go away in a future release.  This should avoid unnecessary
upgrade pain.

* In mkdirs.sh, the varialbe name was INSTANCE rather than
SDP_INSTANCE.  I changed that as well.  That required manual
change rather than sub/replace to avoid corrupting other similar
varialbe names (e.g.  MASTERINSTANCE).

This is a trivial change technically (a substitute/replace, plus
tweaks in p4_vars.template), but impacts many files.
#5 13904 C. Thomas Tyler Routine merge down to dev from main.
#4 12169 Russell C. Jackson (Rusty) Updated copyright date to 2015

 Updated shell scripts to require an instance parameter to eliminate the need
 for calling p4master_run.    Python and Perl still need it since you have to set the
environment for them to run in.

 Incorporated comments from reviewers. Left the . instead of source as that seems
more common in the field and has the same functionality.
#3 12028 C. Thomas Tyler Refreshed SDP dev branch, merging down from main.
#2 10867 C. Thomas Tyler Merge Down: Rereshed 'dev' from 'main'.
#1 10638 C. Thomas Tyler Populate perforce_software-sdp-dev.
//guest/perforce_software/sdp/main/Server/Unix/p4/common/bin/sdp_sync.sh
#1 10148 C. Thomas Tyler Promoted the Perforce Server Deployment Package to The Workshop.