Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
Create nxram_git_build.sh
Browse files Browse the repository at this point in the history
This script is built to be executed solely on `spectrum`
  • Loading branch information
darynwhite committed Oct 23, 2023
1 parent 3508590 commit de73601
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions nxram_git_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
# Script to intiialize a Git repository inside a previously processed site needing RH review
# Author: Daryn A. White, [email protected] -> Only for use w/in GTMBA

## About this script if fed nothing
if [ -z "$1" ]; then
echo '
nxram_git_build: Initialize an existing NextGen Atlas deployment directory
This script is solely to convert an untracked data directory into a git tracked
data directory for ongoing use.
Usage: nxram_git_build [depid] [commit msg]
Example: nxram_git_build pm308 "Initial commit. Git added for RH reprocessing."
'
exit
fi
## Test deployment ID
valid="[a-zA-Z][a-zA-Z][0-9]{3}$"

## Actually go get things done
if [[ ! "$1" =~ $valid ]]; then
echo "BUOYID should be in the form aa### not $1"
elif [ -z "$2" ]; then
echo 'Need the commit message!'
exit
elif [[ "$1" =~ $valid ]]; then
echo "depid is '$1' and commit message is '$2'"
cd /home/data/nxram/"$1" || echo "$1 was not found" && exit 2
git init --shared
touch GIT
git add .
git commit -m "$2"
git branch processing
echo "Ok, ${1} is converted"
else
echo "The script failed!" && exit 200
fi

0 comments on commit de73601

Please sign in to comment.