diff --git a/Jenkinsfile b/Jenkinsfile index d9b9990f..3a151f37 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ pipeline { stage('Test') { steps { sh "chmod +x $WORKSPACE/conf/scripts/test.sh" - sh "$WORKSPACE/conf/scripts/test.sh" + sh "$WORKSPACE/conf/scripts/test.sh JENKINSTESTSdendroVagrantDemo root r00t_p4ssw0rd" } } stage('Deploy') { diff --git a/conf/scripts/test.sh b/conf/scripts/test.sh index fde48907..dae90212 100755 --- a/conf/scripts/test.sh +++ b/conf/scripts/test.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash +mysql_database_to_create=$1 +mysql_username=$2 +mysql_root_password=$3 + #install NVM, Node 6.10, Node Automatic Version switcher curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash && export NVM_DIR="$HOME/.nvm" && @@ -9,6 +13,8 @@ export COVERALLS_SERVICE_NAME="Jenkins" export COVERALLS_REPO_TOKEN="kVeT2pSFVWDEoZCC5xN6wCS1j8YRaiG5e" export RUNNING_IN_JENKINS="1" +echo "create database ${mysql_database_to_create};" | mysql -u $mysql_username -p$mysql_root_password + npm run test && npm run coverage > /dev/null && npm run report-coverage