Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
autonomy-payload
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SASC
autonomy-payload
Commits
db565e70
Commit
db565e70
authored
8 years ago
by
Kevin DeMarco
Browse files
Options
Downloads
Patches
Plain Diff
better ssh passphrase management
parent
407d5089
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
deploy/team-install.sh
+12
-7
12 additions, 7 deletions
deploy/team-install.sh
with
12 additions
and
7 deletions
deploy/team-install.sh
+
12
−
7
View file @
db565e70
...
@@ -10,7 +10,7 @@ USAGE:
...
@@ -10,7 +10,7 @@ USAGE:
OPTIONS:
OPTIONS:
-h Print this usage statement
-h Print this usage statement
-s Use SSH vice SSL to download
-s Use SSH vice SSL to download
-d Destination directory for team repo
-d Destination directory for team repo
(default:
${
HOME
}
/scrimmage)
(default:
${
HOME
}
/scrimmage)
EXAMPLES:
EXAMPLES:
...
@@ -59,27 +59,32 @@ TEAM_NAME="$1"
...
@@ -59,27 +59,32 @@ TEAM_NAME="$1"
URL_PREFIX
=
"https://gitlab.nps.edu/"
URL_PREFIX
=
"https://gitlab.nps.edu/"
if
[
"
${
USE_SSH
}
"
=
true
]
;
then
if
[
"
${
USE_SSH
}
"
=
true
]
;
then
#don't make me type my git ssh password every time:
stty
-echo
stty
-echo
eval
`
ssh-agent
`
if
[
!
-S
${
HOME
}
/.ssh/ssh_auth_sock
]
;
then
eval
`
ssh-add
`
eval
`
ssh-agent
`
ln
-sf
"
$SSH_AUTH_SOCK
"
~/.ssh/ssh_auth_sock
fi
export
SSH_AUTH_SOCK
=
${
HOME
}
/.ssh/ssh_auth_sock
ssh-add
-l
|
grep
"The agent has no identities"
&&
ssh-add
stty echo
stty echo
URL_PREFIX
=
"git@gitlab.nps.edu:"
URL_PREFIX
=
"git@gitlab.nps.edu:"
fi
fi
# Create a map that points team names to team repo urls
# Create a map that points team names to team repo urls
# bash 4 technique (associative array)
# bash 4 technique (associative array)
declare
-A
REPOS
declare
-A
REPOS
REPOS
=([
"scrimmage-templates"
]=
"
${
URL_PREFIX
}
sasc-itar/scrimmage-templates.git"
\
REPOS
=([
"scrimmage-templates"
]=
"
${
URL_PREFIX
}
sasc-itar/scrimmage-templates.git"
\
[
"usma"
]=
"
${
URL_PREFIX
}
todd.brick_usma.edu/scrimmage-templates.git"
\
[
"usma"
]=
"
${
URL_PREFIX
}
todd.brick_usma.edu/scrimmage-templates.git"
\
[
"usafa"
]=
"
${
URL_PREFIX
}
C17Alexander.Fulton_usafa.edu/scrimmage-templates.git"
\
[
"usafa"
]=
"
${
URL_PREFIX
}
C17Alexander.Fulton_usafa.edu/scrimmage-templates.git"
\
[
"usna"
]=
"
${
URL_PREFIX
}
dawkins_usna.edu/scrimmage-templates.git"
)
[
"usna"
]=
"
${
URL_PREFIX
}
dawkins_usna.edu/scrimmage-templates.git"
)
# Get the team repo url and ensure that it is valid"
# Get the team repo url and ensure that it is valid"
REPO_URL
=
"
${
REPOS
[
$TEAM_NAME
]
}
"
REPO_URL
=
"
${
REPOS
[
$TEAM_NAME
]
}
"
if
[
"
$REPO_URL
"
=
""
]
;
then
if
[
"
$REPO_URL
"
=
""
]
;
then
echo
echo
echo
"ERROR: Invalid team name."
echo
"ERROR: Invalid team name."
usage
usage
exit
-2
exit
-2
fi
fi
...
@@ -97,7 +102,7 @@ pushd ${WORK_DIR} >& /dev/null
...
@@ -97,7 +102,7 @@ pushd ${WORK_DIR} >& /dev/null
git remote set-url origin
"
${
REPO_URL
}
"
>
/dev/null 2>&1
git remote set-url origin
"
${
REPO_URL
}
"
>
/dev/null 2>&1
git fetch origin
git fetch origin
git reset
--hard
origin/master
git reset
--hard
origin/master
# Run cmake and "build" the project
# Run cmake and "build" the project
mkdir
-p
./build
mkdir
-p
./build
pushd
./build
>
& /dev/null
pushd
./build
>
& /dev/null
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment