diff --git a/.travis.yml b/.travis.yml index f5299d3..b3ca17c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,14 @@ matrix: - TRAVIS_NODE_VERSION="7.5" services: - memcached + - + sudo: required + php: 7.2 + env: + - APP_NAME_SUITE="application_without_frontend" + - TRAVIS_NODE_VERSION="7.5" + services: + - memcached - sudo: false php: 7.2 diff --git a/README.md b/README.md index 046e4c2..6fd1513 100644 --- a/README.md +++ b/README.md @@ -19,13 +19,23 @@ Install php dependencies using composer $ composer install ``` -Install project : +Install project ```bash $ bin/console app:install $ yarn install && yarn build (or "yarn dev" for development usage) $ symfony server:start --no-tls ``` +Remove frontend (optional) + +When building a SPA with Angular/React/VueJs or a mobile app, you may just need the administration panel and/or the API. +This command basically leaves you only with the admin, protected routes and the API. +The public part https://monofony.mobizel.com/ here is removed and redirected to the administration panel. + +```bash +$ bin/remove-frontend +``` + Documentation ------------- diff --git a/bin/remove-frontend b/bin/remove-frontend new file mode 100755 index 0000000..daa5bc6 --- /dev/null +++ b/bin/remove-frontend @@ -0,0 +1,42 @@ +#!/usr/bin/env php +remove($projectDir.'/config/routes/frontend'); + +// redirect homepage to admin dashboard +$data = <<dumpFile($projectDir.'/config/routes/frontend.yaml', $data); + +// Remote templates +$filesystem->remove($projectDir.'/templates/frontend'); + +// Remove Behat features +$filesystem->remove($projectDir.'/features/account'); + +// Remove assets +$filesystem->remove($projectDir.'/assets/frontend'); + +$data = <<dumpFile($projectDir.'/webpack.config.js', $data); diff --git a/etc/travis/suites/application/script/validate-container b/etc/travis/suites/application/script/validate-container new file mode 100755 index 0000000..0dac32d --- /dev/null +++ b/etc/travis/suites/application/script/validate-container @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../../bash/common.lib.sh" + +print_header "Validating (DI Container)" "AppName" + +run_command "bin/console lint:container" diff --git a/etc/travis/suites/application_without_frontend/before_install.sh b/etc/travis/suites/application_without_frontend/before_install.sh new file mode 100755 index 0000000..e81938f --- /dev/null +++ b/etc/travis/suites/application_without_frontend/before_install.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/common.lib.sh" + +run_command "bin/remove-frontend" +run_command "etc/travis/suites/application/before_install.sh" diff --git a/etc/travis/suites/application_without_frontend/before_script.sh b/etc/travis/suites/application_without_frontend/before_script.sh new file mode 100755 index 0000000..3aca814 --- /dev/null +++ b/etc/travis/suites/application_without_frontend/before_script.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/common.lib.sh" + +run_command "etc/travis/suites/application/before_script.sh" diff --git a/etc/travis/suites/application_without_frontend/install.sh b/etc/travis/suites/application_without_frontend/install.sh new file mode 100755 index 0000000..654c3b7 --- /dev/null +++ b/etc/travis/suites/application_without_frontend/install.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/common.lib.sh" + +run_command "etc/travis/suites/application/install.sh" diff --git a/etc/travis/suites/application_without_frontend/is_suitable.sh b/etc/travis/suites/application_without_frontend/is_suitable.sh new file mode 100755 index 0000000..9ffaa98 --- /dev/null +++ b/etc/travis/suites/application_without_frontend/is_suitable.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/common.lib.sh" + +run_command "etc/travis/suites/application/is_suitable.sh" diff --git a/etc/travis/suites/application_without_frontend/script.sh b/etc/travis/suites/application_without_frontend/script.sh new file mode 100755 index 0000000..4ef30ba --- /dev/null +++ b/etc/travis/suites/application_without_frontend/script.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/common.lib.sh" + +run_command "etc/travis/suites/application/script.sh"