Skip to content

Instantly share code, notes, and snippets.

@MarcusFelling
Created November 12, 2017 15:16
Show Gist options
  • Save MarcusFelling/1875b97b924562aab3ca1b10fd949d4c to your computer and use it in GitHub Desktop.
Save MarcusFelling/1875b97b924562aab3ca1b10fd949d4c to your computer and use it in GitHub Desktop.
#!/bin/bash
# Get encrypted password from MySQL Octopus variable set
octopus_pwd=$(get_octopusvariable "octopus_pwd")
# Use the directory where the package was pushed to in the previous deploy step
OctopusDrop=$(get_octopusvariable "Octopus.Action[Push seed script package].Output.Octopus.Action.Package.InstallationDirectoryPath")
echo "Drop: $OctopusDrop"
echo "Updating DataWarehouse DB"
mysql -h localhost -u ServiceAccountName -p$octopus_pwd DataWarehouse < "$OctopusDrop/SQLScript1.sql"
mysql -h localhost -u ServiceAccountName -p$octopus_pwd DataWarehouse < "$OctopusDrop/SQLScript2.sql"
mysql -h localhost -u ServiceAccountName -p$octopus_pwd DataWarehouse < "$OctopusDrop/SQLScript3.sql"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment