-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathbuild.sh
executable file
·52 lines (42 loc) · 1.31 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
. ./tools.sh
#
# Easy initial build script.
#
echo_blue "Install grunt modules"
npm_module_install grunt-contrib-uglify
npm_module_install grunt-contrib-cssmin
npm_module_install grunt-contrib-watch
npm_module_install grunt-contrib-htmlmin
npm_module_install grunt-contrib-copy
echo_blue "Running grunt"
grunt vendor
grunt
if [ ! -f composer.phar ]; then
echo_blue "Installing composer"
curl -sS https://getcomposer.org/installer | php
else
echo_blue "Updating composer"
php composer.phar self-update
fi
echo_blue "Running composer"
php composer.phar update
if [ -f database/app.sqlite3 ]; then
echo_yellow "Skipped creating the database..."
else
echo_blue "Creating SQLite database"
cat database/create.sql | sqlite3 database/app.sqlite3
echo_blue "Create a new user"
echo -n "User name: "
read -r USER_NAME
echo -n "Password: "
read -r -s PASSWORD
php cli/run_cli.php --cli=Caco\\Slim\\Auth\\UserManagement -a create -u $USER_NAME -p $PASSWORD
fi
php cli/run_cli.php --cli=Caco\\Slim\\Auth\\UserManagement -a list
echo_blue "Set the api url (https://example.com/api/1)"
ID=`php cli/run_cli.php --cli="Caco\\Config\\CLI\\Manage" -a list | grep api-url | cut -d' ' -f 3`
echo -n "URL: "
read -r URL
php cli/run_cli.php --cli=Caco\\Config\\CLI\\Manage -a update -i $ID -v $URL
#./run_tests.sh