diff --git a/.gitignore b/.gitignore index c698ad6..bf0c3bd 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ build/vulnerabilities* Vagrant/Vagrantfile Vagrant/data Vagrant/.vagrant +contents +contents/* diff --git a/build/fetchDatabase.sh b/build/fetchDatabase.sh new file mode 100644 index 0000000..c53a961 --- /dev/null +++ b/build/fetchDatabase.sh @@ -0,0 +1,25 @@ +#!/bin/sh + + +DB_WORLD_URL="https://downloads.mysql.com/docs/world.sql.zip" +DB_WORLDX_URL="https://downloads.mysql.com/docs/world_x-db.zip" +DB_SAKILA_URL="https://downloads.mysql.com/docs/sakila-db.zip" +DB_MESSAGERIE_URL="https://downloads.mysql.com/docs/menagerie-db.zip" +DB_TESTDB_URL="https://github.com/datacharmer/test_db/archive/master.zip" + +getVal() +{ + local vari=$1 + eval "echo \$$vari" +} +case "$1" in + "fetch") + mkdir -p ./contents + wget -O contents/$(basename $(getVal "DB_$2_URL")) $(getVal "DB_$2_URL") + ;; + "load") + ;; + *) + echo "Unknown operation: $1" + ;; +esac \ No newline at end of file diff --git a/build/manageSamples.sh b/build/manageSamples.sh new file mode 100644 index 0000000..888b19f --- /dev/null +++ b/build/manageSamples.sh @@ -0,0 +1,26 @@ +#!/bin/sh + + +DB_WORLD_URL="https://downloads.mysql.com/docs/world.sql.zip" +DB_WORLDX_URL="https://downloads.mysql.com/docs/world_x-db.zip" +DB_SAKILA_URL="https://downloads.mysql.com/docs/sakila-db.zip" +DB_MESSAGERIE_URL="https://downloads.mysql.com/docs/menagerie-db.zip" +DB_TESTDB_URL="https://github.com/datacharmer/test_db/archive/master.zip" + +getVal() +{ + local vari=$1 + eval "echo \$$vari" +} +case "$1" in + "fetch") + set -x + mkdir -p ./contents + wget -O contents/$(basename $(getVal "DB_$2_URL")) $(getVal "DB_$2_URL") + ;; + "load") + ;; + *) + echo "Unknown operation: $1" + ;; +esac \ No newline at end of file