Skip to content

Commit

Permalink
feat: merge setup script
Browse files Browse the repository at this point in the history
Signed-off-by: Hayato Mizushima <[email protected]>
  • Loading branch information
hayato-m126 committed Jan 5, 2025
1 parent 7745b75 commit ed3f13b
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 38 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sudo apt install usb-creator-gtk
事前にgithub_rsaをコピーしておく

```shell
./setup-localhost.sh
./setup.sh
```

## known issue for 24.04
Expand Down
9 changes: 0 additions & 9 deletions ansible-play.sh

This file was deleted.

14 changes: 0 additions & 14 deletions setup-mac.sh

This file was deleted.

14 changes: 0 additions & 14 deletions setup-ubuntu.sh

This file was deleted.

36 changes: 36 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# export .env
set -o allexport
# shellcheck disable=SC1091
source "$(dirname "$0")/.env"
set +o allexport

PLAYBOOK="ansible/ubuntu.yml"

if [[ $OSTYPE == 'darwin'* ]]; then
PLAYBOOK="ansible/mac.yml"
if ! (command -v brew >/dev/null 2>&1); then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
elif [[ $OSTYPE == 'linux'* ]]; then
if ! (command -v curl >/dev/null 2>&1); then
sudo apt -y update
sudo apt -y install curl
fi
else
echo "This OS is not supported"
exit 1
fi

if ! (command -v uv >/dev/null 2>&1); then
curl -LsSf https://astral.sh/uv/install.sh | sh
export PATH="$HOME/.local/bin"
fi
if ! (command -v ansible-playbook >/dev/null 2>&1); then
uv tool install ansible-core
ansible-galaxy collection install community.general
fi

ansible-playbook $PLAYBOOK --ask-become-pass

0 comments on commit ed3f13b

Please sign in to comment.