Skip to content

Commit

Permalink
feat: content on install to environments other than dev
Browse files Browse the repository at this point in the history
We need the ability to set the environment dynamically when calling this script, so change to using a variable and fall back to dev if it isn't set.
  • Loading branch information
vinmassaro authored Jan 12, 2024
1 parent 65bd722 commit bbf67b1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/shared/content-import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ if [ "$YALESITES_IS_LOCAL" == "1" ]; then
homepage_nid=$(lando drush ev "$nid_command")
lando drush cset system.site page.front "$homepage_nid" -y
else
COMMAND=$(terminus connection:info "$SITE_MACHINE_NAME".dev --field=sftp_command)
[ -z "$env" ] && env="dev"
COMMAND=$(terminus connection:info "$SITE_MACHINE_NAME"."$env" --field=sftp_command)
eval "$COMMAND:/files/ <<< 'put $STARTERKIT_FILE'"
terminus drush "$SITE_MACHINE_NAME".dev -- content:import ../../files/"$STARTERKIT_FILE"
terminus drush "$SITE_MACHINE_NAME"."$env" -- content:import ../../files/"$STARTERKIT_FILE"
eval "$COMMAND:/files/ <<< 'rm $STARTERKIT_FILE'"
homepage_nid=$(echo "$nid_command" | terminus drush "$SITE_MACHINE_NAME".dev -- php-script - 2>/dev/null)
terminus drush "$SITE_MACHINE_NAME".dev -- cset system.site page.front "$homepage_nid" -y
homepage_nid=$(echo "$nid_command" | terminus drush "$SITE_MACHINE_NAME"."$env" -- php-script - 2>/dev/null)
terminus drush "$SITE_MACHINE_NAME"."$env" -- cset system.site page.front "$homepage_nid" -y
fi

0 comments on commit bbf67b1

Please sign in to comment.