Skip to content

Commit

Permalink
IT-5368 Updated installCCS.sh script to work on the summit
Browse files Browse the repository at this point in the history
  • Loading branch information
mxturri committed May 20, 2024
1 parent 2c7145e commit 4a5cc9c
Showing 1 changed file with 82 additions and 4 deletions.
86 changes: 82 additions & 4 deletions files/install/installCCS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ if [ $# -eq 0 ]; then
exit 1
fi

ENVIRONMENT=$1
NODE_NAME=$2
TAG=$1
ENVIRONMENT=$2
NODE_NAME=$3

BASEDIR=$(dirname "$0")
DEV_PACKAGE_DIR="/lsst/ccsadm/dev-package-lists"
DEV_PACKAGE_DIR="/home/ccs/dev-package-lists"
RELEASE_INSTALL_SCRIPT="/lsst/ccsadm/release/bin/install.py"
CCS_INSTALL_DIR="/lsst/ccs/"$(date +%Y%m%d)

Expand All @@ -28,13 +29,90 @@ then

# Check that the dev-package-lists github project is up to date.
# If not abort.
if [ ! -d $DEV_PACKAGE_DIR ]; then
git clone https://github.com/lsst-camera-dh/dev-package-lists.git $DEV_PACKAGE_DIR
fi
cd $DEV_PACKAGE_DIR || exit
if ! gitCheckout=$(git checkout $TAG) ;then
echo "Tag $TAG does not exist"
exit
fi

if ! gitPull=$(git pull); then
echo "Something went wrong when updating $DEV_PACKAGE_DIR: $?: $gitPull"
exit
fi

gitStatus=$(git status)
if [[ $gitStatus != *"nothing to commit, working tree clean"* ]]; then
echo Directory $DEV_PACKAGE_DIR is not up to date. Exiting.
exit
fi

# Check that the install script exists. If not abort.
if [ ! -f "$RELEASE_INSTALL_SCRIPT" ]; then
echo "The release package install script is not available at $RELEASE_INSTALL_SCRIPT"
exit
fi

echo "Performing new installation of CCS software in $CCS_INSTALL_DIR"

if [ -z "$NODE_NAME" ]; then
echo recalculating node name
IN=$(uname -n)
NODE_NAME=${IN%%.*}
fi

$RELEASE_INSTALL_SCRIPT --ccs_inst_dir "$CCS_INSTALL_DIR" "$DEV_PACKAGE_DIR/$ENVIRONMENT/$NODE_NAME/ccsApplications.txt"

else
echo "$VERIFY_USER"
fi
#The first argument must be the environment IR2|ATS|IR2-Simulated
if [ $# -eq 0 ]; then
echo One argument must be provided: the environment
exit 1
fi

TAG=$1
ENVIRONMENT=$2
NODE_NAME=$3

BASEDIR=$(dirname "$0")
DEV_PACKAGE_DIR="/home/ccs/dev-package-lists"
RELEASE_INSTALL_SCRIPT="/lsst/ccsadm/release/bin/install.py"
CCS_INSTALL_DIR="/lsst/ccs/"$(date +%Y%m%d)

# Check if there is already an installation directory, in which case abort.
# What should be done in this case? Remove the directory or run the update script?
if [ -d "$CCS_INSTALL_DIR" ]; then
echo "Installation directory $CCS_INSTALL_DIR already exists. Exiting."
exit
fi

VERIFY_USER=$("$BASEDIR/verifyUser.sh" ccs)

if [ "$VERIFY_USER" == 1 ]
then

# Check that the dev-package-lists github project is up to date.
# If not abort.
if [ ! -d $DEV_PACKAGE_DIR ]; then
git clone https://github.com/lsst-camera-dh/dev-package-lists.git $DEV_PACKAGE_DIR
fi
cd $DEV_PACKAGE_DIR || exit
if ! gitCheckout=$(git checkout $TAG) ;then
echo "Tag $TAG does not exist"
exit
fi

if ! gitPull=$(git pull); then
echo "Something went wrong when updating $DEV_PACKAGE_DIR: $?: $gitPull"
exit
fi

gitStatus=$(git status)
if [[ $gitStatus != *"nothing to commit, working directory clean"* ]]; then
if [[ $gitStatus != *"nothing to commit, working tree clean"* ]]; then
echo Directory $DEV_PACKAGE_DIR is not up to date. Exiting.
exit
fi
Expand Down

0 comments on commit 4a5cc9c

Please sign in to comment.