Last active
January 5, 2017 15:03
-
-
Save johnnyicarus/c2a79cc0bb4d1a96001ada6c872f5aca to your computer and use it in GitHub Desktop.
Create a new roots/trellis and roots/bedrock project in a subfolder named with the -n option; usage: sh trellis_project.sh -n foldername
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 | |
| while getopts ":n:" opt; do | |
| case $opt in | |
| n) | |
| echo "Trellis project will be put into directory: $OPTARG" >&2; | |
| mkdir $OPTARG; | |
| cd $OPTARG; | |
| git clone --depth=1 [email protected]:roots/trellis.git; | |
| rm -rf trellis/.git; | |
| git clone --depth=1 [email protected]:roots/bedrock.git site; | |
| rm -rf site/.git; | |
| git init; | |
| cd trellis; | |
| ansible-galaxy install -r requirements.yml; | |
| ;; | |
| \?) | |
| echo "Invalid option: -$OPTARG" >&2 | |
| exit 1 | |
| ;; | |
| :) | |
| echo "Option -$OPTARG requires an argument." >&2 | |
| exit 1 | |
| ;; | |
| esac | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment