-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
stackup.laravel.yaml
68 lines (52 loc) · 1.67 KB
/
stackup.laravel.yaml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: my stack
description: laravel application stack
version: 1.0.0
init: |
vars.Set("php_version", semver(outputOf("php --version")));
vars.Set("laravel_version", semver(outputOf("php artisan --version")));
preconditions:
- name: dependencies are installed
check: binaryExists("php")
- name: PHP is at least version 7.3
check: vars.Get("php_version").Gte("7.3")
- name: running Laravel v9+
check: $laravel_version.Gte("9")
- name: project is a laravel application
check: fs.Exists(getCwd() + "/artisan") && fs.Exists(getCwd() + "/composer.json")
startup:
- task: start-containers
- task: run-migrations-fresh
- task: run-migrations-no-seed
shutdown:
- task: stop-containers
servers:
- task: horizon-queue
- task: httpd
scheduler:
- task: artisan-scheduler
cron: '* * * * *'
tasks:
- id: start-containers
if: fs.Exists("docker-compose.yml") && binaryExists("docker-compose")
command: docker-compose up -d
silent: true
- id: stop-containers
if: fs.Exists("docker-compose.yml") && binaryExists("docker-compose")
command: docker-compose down
silent: true
- name: run migrations (rebuild db)
id: run-migrations-fresh
if: hasFlag("seed")
command: php artisan migrate:fresh --seed
- name: run migrations (no seeding)
id: run-migrations-no-seed
if: hasFlag("seed") == false
command: php artisan migrate
- id: run-artisan-scheduler
command: php artisan schedule:run
- id: horizon-queue
if: dev.ComposerJson(getCwd()).HasDependency("laravel/horizon")
command: php artisan horizon
platforms: ['linux', 'darwin']
- id: httpd
command: php artisan serve