Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add run script for easier setup #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ Basic starter kit to create your own provisioning

## Quick start

1. Clone this repo `git clone https://github.com/personal-provisioning/starterkit.git`
2. Delete the git folder `rm -rf .git/`
3. Init git again `git init`
4. Run `setup.sh`
1. Setup the directory strucutre: `mkdir -p ~/.personal_provisioning`
2. Clone this repo `git clone https://github.com/personal-provisioning/starterkit.git ~/.personal_provisioning/config`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't really have to specify this. You can clone it anywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, will change it 👍

3. Delete the git folder `rm -rf .git/`
4. Init git again `git init`
5. Have a look at `base.yml` and adjust it to your needs
6. Start the provisioning by running `ansible-playbook -i inventory base.yml`
6. Start the provisioning by running `./run.sh`

## How does this work?

`setup.sh` will create a few folders, install Ansible and pull our generic
`run.sh` will install dependencies such as Ansible and pull our generic
roles.

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

set -e

if [ ! -d ~/.personal_provisioning/roles ]; then
echo 'Cloning roles'
git clone git@github.com:personal-provisioning/roles.git ~/.personal_provisioning/roles
else
echo "Updating roles"
CURRENT_DIR=$(pwd)
cd ~/.personal_provisioning/roles && git pull --rebase && cd $CURRENT_DIR
fi

echo 'Installing XCode CLI Tools'
xcode-select --install || echo 'XCode CLI Tools are already installed'

which -s brew


if which -s brew
then
echo 'Updating Homebrew'
brew update --all && brew upgrade && brew cleanup
else
echo 'Installing Homebrew'
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi

echo 'Installing Ansible'
brew install ansible


echo 'Running Ansible'

ansible-playbook -i "localhost," -c local base.yml

6 changes: 0 additions & 6 deletions setup.sh

This file was deleted.