forked from austintoddj/canvas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitpod.yml
110 lines (84 loc) · 3.19 KB
/
.gitpod.yml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# The Docker image to run the workspace in (defaults to gitpod/workspace-full)
image:
file: Dockerfile
workspaceLocation: canvas/.workspace.json
checkoutLocation: canvas
vscode:
extensions:
- octref.vetur@0.28.0:bW1RGNnmWYQO43JdJgK34w==
- eamodio.gitlens@10.2.1:WIWu3zHU4VPT8r/v866LUw==
- esbenp.prettier-vscode@5.7.1:GDba64T6G+TUi1qmc6BE3A==
github:
prebuilds:
# Enable for the master/default branch (defaults to true)
master: true
# Enable for all branches in this repo (defaults to false)
branches: true
# Enable for pull requests coming from this repo (defaults to true)
pullRequests: true
# Enable for pull requests coming from forks (defaults to false)
pullRequestsFromForks: true
# Add a check to pull requests (defaults to true)
addCheck: true
# Add a "Review in Gitpod" button as a comment to pull requests (defaults to false)
addComment: true
# Add a "Review in Gitpod" button to the pull request's description (defaults to false)
addBadge: true
# Add a label once the prebuild is ready to pull requests (defaults to false)
addLabel: true
# Command to start on workspace startup (optional)
tasks:
- init: |
# Reload the .bash_profile to utilize the composer-link() function
source ~/.bash_profile
cd /workspace
# Install a fresh Laravel app
composer create-project --prefer-dist laravel/laravel laravel
cd /workspace/laravel
# Create a new in-memory database
touch database/database.sqlite
# Write the database configuration to the .env file
sed -i 's/DB_CONNECTION=mysql/DB_CONNECTION=sqlite/g' .env
sed -i 's/DB_DATABASE=laravel/#DB_DATABASE=laravel/g' .env
# Link Canvas to the Laravel app
composer-link ../canvas/
composer require austintoddj/canvas @dev
# Install Canvas and its resources
php artisan canvas:install
php artisan storage:link
# Remove any existing assets from the Laravel app
rm -rf public/vendor/canvas/*
# Create a symlink to the local package assets
cd public/vendor/canvas
ln -s ../../../../canvas/public/* .
cd /workspace/laravel
# Trust any proxy in a chain of proxies
php artisan vendor:publish --provider="Fideloper\Proxy\TrustedProxyServiceProvider"
sed -Ei "s|'proxies' => null|'proxies' => '**'|g" config/trustedproxy.php
command: |
cd /workspace/laravel
# Write the local app URL to the .env file
export url=$(gp url 8000); sed -Ei "s|APP_URL=http://localhost|APP_URL=${url}|g" .env
# Write the local asset URL to the .env file
export url=$(gp url 8000); sed -Ei "1i\ASSET_URL=${url}" .env
# Clear and cache the app configuration
php artisan config:clear
php artisan cache:clear
php artisan config:cache
# Serve the Laravel app
php artisan serve
- init: |
# Initializing the Canvas package
# Install core PHP dependencies
composer install
# Install core JS dependencies
yarn
command: |
yarn watch
openMode: split-right
# Ports to expose on workspace startup (optional)
ports:
- port: 3306
onOpen: ignore
- port: 8000
onOpen: notify