This repository has been archived by the owner on Jan 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This script is built to be executed solely on `spectrum`
- Loading branch information
1 parent
3508590
commit de73601
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |