Skip to content

Instantly share code, notes, and snippets.

@colinappnovation
Created July 11, 2017 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colinappnovation/777dca8968a777e4b4be4dc567934798 to your computer and use it in GitHub Desktop.
Save colinappnovation/777dca8968a777e4b4be4dc567934798 to your computer and use it in GitHub Desktop.
Bash Script to automate D8 alongside Docker4Drupal
#!/bin/bash
# Clone into directory
git clone git@github.com:colinappnovation/drupal-project.git --depth=1 $1
# move into new folder
cd $1
# Bring in docker4drupal
wget https://raw.githubusercontent.com/wodby/docker4drupal/master/docker-sync.yml
wget https://raw.githubusercontent.com/wodby/docker4drupal/master/docker-compose.yml
# Replace strings in two files above
sed -i '' "s/docker-sync/${1}/g" ./docker-sync.yml
# Uncomment docker-sync stuff at base of file
sed -i '' '210,211 s/^#//' docker-compose.yml
sed -i '' "210 s/docker-sync/${1}/" ./docker-compose.yml
# Clean up things
rm -rf .git/
rm .travis.yml
rm LICENSE
rm README.md
rm phpunit.xml.dist
# Composer run
#composer install
@colinappnovation
Copy link
Author

colinappnovation commented Jul 11, 2017

  1. Make the bash script executable
cmod +x boot-project.sh
2) Run the script passing param/argument 1 e.g. test
./boot-project.sh test => arg 1 = "test" therefore through script is replaced accordingly i.e. ${1}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment