-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
git credential manager
in Ubuntu Server (#237)
* use `git-credential-manager` in Ubuntu Server * add test
- Loading branch information
Showing
4 changed files
with
57 additions
and
7 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
home/.chezmoiscripts/ubuntu/run_once_12-git-credential-manager.sh.tmpl
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,7 @@ | ||
{{ if eq .chezmoi.os "linux" -}} | ||
{{ if eq .chezmoi.osRelease.idLike "debian" -}} | ||
{{ if eq .system "server" -}} | ||
{{ include "../install/ubuntu/server/git_credential_manager.sh" }} | ||
{{ end -}} | ||
{{ end -}} | ||
{{ end -}} |
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
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,29 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -Eeuo pipefail | ||
|
||
if [ "${DOTFILES_DEBUG:-}" ]; then | ||
set -x | ||
fi | ||
|
||
function install_git_credential_manager() { | ||
local gcm_version="2.6.0" | ||
local gcm_deb="gcm-linux_amd64.${gcm_version}.deb" | ||
wget "https://github.com/git-ecosystem/git-credential-manager/releases/download/v${gcm_version}/${gcm_deb}" | ||
sudo dpkg -i ${gcm_deb} | ||
rm -v ${gcm_deb} | ||
git-credential-manager configure | ||
} | ||
|
||
function uninstall_git_credential_manager() { | ||
git-credential-manager unconfigure | ||
sudo dpkg -r gcm | ||
} | ||
|
||
function main() { | ||
install_git_credential_manager | ||
} | ||
|
||
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then | ||
main | ||
fi |
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,17 @@ | ||
#!/usr/bin/env bats | ||
|
||
readonly SCRIPT_PATH="./install/ubuntu/server/git_credential_manager.sh" | ||
|
||
function setup() { | ||
source "${SCRIPT_PATH}" | ||
} | ||
|
||
function teardown() { | ||
run uninstall_git_credential_manager | ||
} | ||
|
||
@test "[ubuntu-server] starship" { | ||
DOTFILES_DEBUG=1 bash "${SCRIPT_PATH}" | ||
|
||
[ -x "$(command -v git-credential-manager)" ] | ||
} |
a342a98
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible performance regression was detected for benchmark 'MacOS benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
1.50
.zsh average startup time
0.305
Second0.155
Second1.97
zsh initial startup time
1.67
Second0.83
Second2.01
This comment was automatically generated by workflow using github-action-benchmark.
CC: @shunk031