Last active
January 10, 2026 15:50
-
-
Save ytnobody/5d0b553de30852eb05aa4da10633bfb4 to your computer and use it in GitHub Desktop.
ytnobody用セットアップスクリプト(プライベートレポジトリを見に行くので完全に自分用)
This file contains hidden or 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
| #!/bin/bash | |
| set -e | |
| echo "Starting bootstrap process..." | |
| # 1. Install GitHub CLI | |
| if ! command -v gh &> /dev/null; then | |
| echo "Installing GitHub CLI..." | |
| curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg | |
| sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg | |
| echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null | |
| sudo apt-get update | |
| sudo apt-get install gh -y | |
| fi | |
| # 2. Login to GitHub with GitHub CLI | |
| if ! gh auth status &> /dev/null; then | |
| echo "Please login to GitHub:" | |
| gh auth login --web --git-protocol https | |
| fi | |
| # Add settings GitHub CLI Credential helper to git | |
| gh auth setup-git | |
| GIT_TOKEN=$(gh auth token) | |
| # 3. Install Ansible | |
| echo "Installing Ansible..." | |
| sudo apt-get install -y ansible git | |
| # 4. Execute ansible-pull | |
| echo "Running Ansible-pull..." | |
| ansible-pull -U "https://x-access-token:${GIT_TOKEN}@github.com/ytnobody/ansible-belike-ytnobody.git" local.yml | |
| echo "--------------------------------------------------" | |
| echo "All set! Please run 'claude auth login' to finish." | |
| echo "--------------------------------------------------" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment