dev_env.sh #2

  • //
  • test-install_sdp/
  • dev/
  • dev_env.sh
  • View
  • Commits
  • Open Download .zip Download (2 KB)
# For Battle School Workshop usage only, change the DEV_HOME
# to /opt/perforce/.dev/bin, to obsure teh .dev directory
# in the lab environment. This is because the 'dev' tree is
# part of the BSW lab infrastructure, not something that
# customers/students should expect to see in /opt/perforce
# in any real-world server.
if [[ "$HOSTNAME" == p4c-bos-01.p4demo.com ]]; then
   export DEV_HOME=/opt/perforce/.dev/bin
else
   export DEV_HOME=/opt/perforce/dev/bin
fi

export P4CONFIG=.p4config.local
export P4IGNORE=.p4ignore.local

[[ "$PATH" == *"$DEV_HOME"* ]] || export PATH="$DEV_HOME:$PATH"

# Deliberately NOT exporting P4PORT/P4USER here. Each of /opt/perforce/dev/bin
# and /opt/perforce/dev/sdp is its own 'p4 clone'-managed DVCS repo with its
# own .p4config.local (P4CONFIG, set above) carrying the right P4USER/P4PORT/
# P4CLIENT for whatever source it's currently cloned from -- via swap_source.sh,
# that source can vary per machine and change over time. P4CONFIG settings
# take precedence over shell environment variables, so hardcoding a value here
# wouldn't even take effect once inside either repo -- better to just not
# imply a fixed identity that isn't accurate for every setup.
export P4TICKETS=${DEV_HOME%/*}/.p4tickets

# Alias to Load Development Environment
alias lde='source $DEV_HOME/dev_env.sh'

alias cls=clear
alias md='mkdir -p'
alias o'=p4 opened ...'

alias cdd="cd $DEV_HOME"
alias cds="cd ${DEV_HOME%/bin}/sdp/Server/Unix/setup"
alias cdu="cd ${DEV_HOME%/bin}/sdp/Server/Unix/p4/common/sdp_upgrade"
alias cdb="cd ${DEV_HOME%/bin}/sdp/Server/Unix/p4/common/bin"
alias ec2id=/opt/perforce/dev/sdp/Server/Unix/p4/common/cloud/aws/bin/ec2id

# Alias to fetch latest from the Public Depot, check that we're clean with
# test_preflight.sh, and if so, run the full test suite.  If the
# test_preflight.sh isn't happy, don't kick off the test suite.
# 'uat' is short for "update and test."
alias uat='cds; p4 fetch; cdd; p4 fetch; ./test_preflight.sh && r'

# Enable VI command line editing.
set -o vi
if command -v nvim > /dev/null; then
   alias vi=nvim
elif command -v vim > /dev/null; then
   alias vi=vim
fi

[[ ! -d ~/.config/nvim ]] && mkdir -p ~/.config.nvim
[[ ! -r ~/.config/nvim/init.lua ]] && ( cd ~/.config/nvim; ln -s $DEV_HOME/nvim.init.lua init.lua; )

# Test Support

alias r="$DEV_HOME/r"
# Change User Description Committed
#2 33158 Claude (AI Agent by Anthropic) Task 1.2: SDP Installer Test Suite source-swapping capability.
Adds swap_source.sh (park/restore or fresh-clone via p4-sdp_*/test-install_sdp_* remote specs) and bootstrap_test_machine.sh (self-contained, curl-bootstrappable machine-join script, SDP Bash Coding Standard style with documented deviations, ShellCheck-clean). Fixes dev_env.sh's hardcoded P4USER/P4PORT, and init_root_dirs_for_local_installs.sh's stale r25.1 P4D default and a real bin.aarch64 URL bug (404; should be bin.linux26aarch64). Restructures InstallSDP-TestServerSetup.md around the new bootstrap script and adds a "Qualifying a New Platform" section.

Agent: Claude Code, Model: Claude Sonnet 5 (claude-sonnet-5), operating as bot_Claude_Anthropic.
#1 33144 C. Thomas Tyler Initialized //test-install_sdp/dev with p4 populate -b test-install_sdp_Classic_to_Streams
//guest/tom_tyler/sw/main/install_sdp/dev/bin/dev_env.sh
#11 32969 C. Thomas Tyler Added ec2id alias.
#10 32967 C. Thomas Tyler Added uat alias.
#9 31971 C. Thomas Tyler Enhanced neovim setup, and made it optional in case nvim isn't installed.
#8 31907 C. Thomas Tyler Added neovim config bits.
#7 31849 C. Thomas Tyler Added alias to cd to bin dir.
#6 31754 C. Thomas Tyler Corrected P4TICKETS value for BSW environment.
#5 31693 C. Thomas Tyler For BSW usage only, change the DEV_HOME from
/opt/perforce/dev to /opt/perforce/.dev.
#4 30983 C. Thomas Tyler Added another alias.
#3 30703 C. Thomas Tyler Refactored so repo is moved outside /opt/perforce/helix-sdp
so that folder can be cleaned up between test runs for a
clean test.
#2 30696 C. Thomas Tyler Added alias 'r'.
#1 30693 C. Thomas Tyler Added dev utils and tests.