Skip to content

Instantly share code, notes, and snippets.

@sewmyheadon
Created July 2, 2018 19:47
Show Gist options
  • Save sewmyheadon/09238c0189c9c3a3d1b4de2bd127edaa to your computer and use it in GitHub Desktop.
Save sewmyheadon/09238c0189c9c3a3d1b4de2bd127edaa to your computer and use it in GitHub Desktop.
Pantheon / Lando New Site Bash Script - run script locally to create Pantheon WordPress site and clone locally into new Lando environment
#!/bin/bash
# siteslug="SITE_SLUG"
read -p "Enter site slug: " siteslug
# sitename="SITE_NAME"
read -p "Enter site name: " sitename
read -p "Continue? (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1
# assign variables
export SITE_SLUG=$siteslug
export SITE_NAME=$sitename
# spin up new site on Pantheon
terminus site:create $SITE_SLUG "$SITE_NAME" XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX --org MYORGNAME
terminus dashboard:view $SITE_SLUG
terminus wp $SITE_SLUG.dev -- core install --url=https://dev-$SITE_SLUG.pantheonsite.io --title="$SITE_NAME" --admin_user=ivycat --admin_password=changemelater --admin_email=wp@ivycat.com
mkdir $SITE_SLUG && cd $SITE_SLUG
# create local site
lando init pantheon
lando start
lando pull
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment