Merge branch 'sequelize-support'

This commit is contained in:
Sameer Naik
2017-01-16 11:22:09 +05:30
2 changed files with 10 additions and 1 deletions

View File

@@ -11,7 +11,7 @@ ENV PATH=/opt/bitnami/node/bin:/opt/bitnami/python/bin:$PATH \
NODE_PATH=/opt/bitnami/node/lib/node_modules
RUN bitnami-pkg install express-generator-4.13.4-1 --checksum 937c865650282fa55c0e543166b95b0aab9e4cf891782cee056037697b2b64e3
RUN npm install -g bower@1.8.0
RUN npm install -g bower@1.8.0 sequelize-cli
# Install express
RUN bitnami-pkg install express-4.14.0-1 --checksum f98a7f8e85d038bb895d1105f6a0d995810b004f78b4fc0a0299237dc5070795

View File

@@ -70,6 +70,13 @@ add_database_support() {
fi
}
migrate_db() {
if [ -f .sequelizerc ]; then
log "Applying database migrations (sequelize db:migrate)"
sequelize db:migrate
fi
}
log () {
echo -e "\033[0;33m$(date "+%H:%M:%S")\033[0;37m ==> $1."
}
@@ -111,6 +118,8 @@ if [ "$1" == npm -a "$2" == "start" ]; then
log "Initialization finished"
fi
migrate_db
touch $INIT_SEM
fi