mirror of https://github.com/rwf2/Rocket.git
Fixed todo example. Testing script now bootstraps when needed.
This commit is contained in:
parent
b767c1bdec
commit
d16d9bd0d7
|
@ -10,6 +10,9 @@
|
||||||
# Generated by Cargo
|
# Generated by Cargo
|
||||||
target
|
target
|
||||||
|
|
||||||
|
# Generated databases
|
||||||
|
db.sql
|
||||||
|
|
||||||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
||||||
# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock
|
# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
|
|
|
@ -7,7 +7,7 @@ authors = ["Sergio Benitez <sb@sergio.bz>"]
|
||||||
rocket = { path = "../../lib" }
|
rocket = { path = "../../lib" }
|
||||||
rocket_macros = { path = "../../macros" }
|
rocket_macros = { path = "../../macros" }
|
||||||
lazy_static = "*"
|
lazy_static = "*"
|
||||||
tera = "*"
|
tera = { git = "https://github.com/Keats/tera" }
|
||||||
serde = "0.8"
|
serde = "0.8"
|
||||||
serde_json = "0.8"
|
serde_json = "0.8"
|
||||||
serde_macros = "0.8"
|
serde_macros = "0.8"
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
SCRIPTPATH=$(cd "$(dirname "$0")" ; pwd -P)
|
||||||
|
DATABASE_URL=${SCRIPTPATH}/db/db.sql
|
||||||
|
|
||||||
|
pushd $SCRIPTPATH
|
||||||
|
# install the diesel CLI tools
|
||||||
|
cargo install diesel_cli
|
||||||
|
|
||||||
|
# create db/db.sql
|
||||||
|
diesel migration --database-url=$DATABASE_URL run
|
||||||
|
popd $SCRIPTPATH
|
|
@ -1,9 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
EXAMPLES_DIR="examples/"
|
EXAMPLES_DIR="examples"
|
||||||
LIB_DIR="lib/"
|
LIB_DIR="lib"
|
||||||
MACROS_DIR="macros/"
|
MACROS_DIR="macros"
|
||||||
|
|
||||||
function build_and_test() {
|
function build_and_test() {
|
||||||
local dir=$1
|
local dir=$1
|
||||||
|
@ -26,8 +26,18 @@ build_and_test $LIB_DIR
|
||||||
build_and_test $MACROS_DIR
|
build_and_test $MACROS_DIR
|
||||||
|
|
||||||
for file in ${EXAMPLES_DIR}/*; do
|
for file in ${EXAMPLES_DIR}/*; do
|
||||||
echo "${file}"
|
|
||||||
if [ -d "${file}" ]; then
|
if [ -d "${file}" ]; then
|
||||||
|
bootstrap_script="${file}/bootstrap.sh"
|
||||||
|
if [ -x "${bootstrap_script}" ]; then
|
||||||
|
echo ":: Bootstrapping ${file}..."
|
||||||
|
|
||||||
|
if ! ./${bootstrap_script}; then
|
||||||
|
echo ":: Running bootstrap script (${bootstrap_script}) failed!"
|
||||||
|
echo ":: Skipping ${file}."
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
build_and_test "${file}"
|
build_and_test "${file}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue