Commit 5718b5d9 authored by Jacob Priddy's avatar Jacob Priddy 👌
Browse files

Update deploy script and make a basic default endpoint for /api

parent d3a975e0
Pipeline #9836 failed with stages
in 3 minutes
......@@ -9,7 +9,7 @@ variables:
stages:
- build
# - test
- test
- deploy
build_web_backend:
......@@ -35,29 +35,30 @@ build_web_frontend:
- src/frontend/dist
expire_in: 1 day
#test_php_styles:
# stage: test
# script:
# - cd src/backend
# - vendor/bin/php-cs-fixer fix --config=.php_cs -v --dry-run --stop-on-violation --using-cache=no
#
#test_web_backend_unit:
# stage: test
# script:
# - cd src/backend
# - vendor/bin/phpunit --testsuite Unit
#
#test_web_backend_feature:
# stage: test
# script:
# - cd src/backend
# - vendor/bin/phpunit --testsuite Feature
#
#test_web_backend_database:
# stage: test
# script:
# - cd src/backend
# - vendor/bin/phpunit --testsuite Database
test_php_styles:
stage: test
script:
- cd src/backend
- vendor/bin/php-cs-fixer fix --config=.php_cs -v --dry-run --stop-on-violation --using-cache=no
test_web_backend_unit:
stage: test
script:
- cd src/backend
- vendor/bin/phpunit --testsuite Unit
test_web_backend_feature:
stage: test
script:
- cd src/backend
- vendor/bin/phpunit --testsuite Feature
test_web_backend_database:
stage: test
script:
- cd src/backend
- vendor/bin/phpunit --testsuite Database
deploy_backend_production:
stage: deploy
before_script:
......@@ -71,13 +72,13 @@ deploy_backend_production:
# Execute the deploy
- ssh $SSH_USER@$SSH_HOST "${SSH_COMMAND_STRING}"
# Make sure it is running
- "curl --insecure --location https://${SSH_HOST}/api/me | grep \"Unauthenticated\""
- "curl --insecure --location https://${SSH_HOST}/api/me | grep \"Welcome to the elock doorcode API.\""
environment:
name: production
url: https://elock.cs.wallawalla.edu/api
when: manual
only:
- 55-create-deploy-server
- master
deploy_frontend_production:
stage: deploy
......@@ -96,4 +97,4 @@ deploy_frontend_production:
url: https://elock.cs.wallawalla.edu
when: manual
only:
- 55-create-deploy-server
- master
......@@ -4,11 +4,9 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "${DIR}/.." || exit 1
docker-compose stop webserver || exit 1
git pull || exit 1
docker-compose up -d || exit 1
docker-compose restart || docker-compose up -d || exit 1
# the -T fixes the input device is not a TTY .. see https://github.com/docker/compose/issues/5696
docker-compose exec -T api ./update-prod.sh || exit 1
<?php
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\AuthController;
......@@ -14,6 +15,10 @@ use App\Http\Controllers\AuthController;
|
*/
Route::get('/', static function() {
return new JsonResponse(['welcome' => 'Welcome to the elock API.']);
});
Route::get('login', [AuthController::class, 'samlLogin']);
Route::get('handle-login', [AuthController::class, 'handle']);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment