@kirschbaum-development/sst-laravel 0.0.16 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -3
- package/laravel-sst.ts +14 -5
- package/package.json +1 -1
- package/src/laravel-env.ts +2 -2
package/README.md
CHANGED
|
@@ -48,14 +48,15 @@ And now you can start using the `Laravel` SST component. All the configuration o
|
|
|
48
48
|
|
|
49
49
|
To check the full list of options. check [here](https://github.com/kirschbaum-development/sst-laravel/blob/main/docs/api.md).
|
|
50
50
|
|
|
51
|
-
### HTTP
|
|
51
|
+
### Web (HTTP)
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
Below is an example of setting up your application to receive HTTP requests, on the `laravel-sst-demo.example.com` domain (with SSL), with auto-scaling with a max of 3 servers.
|
|
54
54
|
|
|
55
55
|
```js
|
|
56
56
|
const app = new LaravelService('MyLaravelApp', {
|
|
57
57
|
web: {
|
|
58
|
-
|
|
58
|
+
dns: sst.cloudflare.dns(),
|
|
59
|
+
domain: 'laravel-sst-demo.example.com',
|
|
59
60
|
scaling: {
|
|
60
61
|
min: 1,
|
|
61
62
|
max: 3,
|
|
@@ -64,6 +65,8 @@ const app = new LaravelService('MyLaravelApp', {
|
|
|
64
65
|
});
|
|
65
66
|
```
|
|
66
67
|
|
|
68
|
+
Check all the `web` options [here](https://github.com/kirschbaum-development/sst-laravel/blob/main/docs/api.md#web).
|
|
69
|
+
|
|
67
70
|
### Workers
|
|
68
71
|
|
|
69
72
|
Beyond HTTP requests, you can set up one or more `workers` for your Laravel application. Workers are meant to run background commands like Laravel Horizon, the Laravel Scheduler or any background command you may need to run.
|
|
@@ -120,6 +123,8 @@ const app = new LaravelService('MyLaravelApp', {
|
|
|
120
123
|
});
|
|
121
124
|
```
|
|
122
125
|
|
|
126
|
+
Check all the `workers` options [here](https://github.com/kirschbaum-development/sst-laravel/blob/main/docs/api.md#workers).
|
|
127
|
+
|
|
123
128
|
## Environment Variables
|
|
124
129
|
|
|
125
130
|
There are multiple ways to configure environment variables. If you want SST Laravel to copy an environment file, you can configure the `config.environment.file` entry.
|
package/laravel-sst.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as path from 'path';
|
|
|
4
4
|
import * as fs from 'fs';
|
|
5
5
|
import { Component } from "../../../.sst/platform/src/components/component.js";
|
|
6
6
|
import { FunctionArgs } from "../../../.sst/platform/src/components/aws/function.js";;
|
|
7
|
-
import { ComponentResourceOptions, Output, all, output } from "../../../.sst/platform/node_modules/@pulumi/pulumi
|
|
7
|
+
import { ComponentResourceOptions, Output, all, output } from "../../../.sst/platform/node_modules/@pulumi/pulumi";
|
|
8
8
|
import { Input } from "../../../.sst/platform/src/components/input.js";
|
|
9
9
|
import { ClusterArgs } from "../../../.sst/platform/src/components/aws/cluster.js";
|
|
10
10
|
import { ServiceArgs } from "../../../.sst/platform/src/components/aws/service.js";
|
|
@@ -483,8 +483,17 @@ export class LaravelService extends Component {
|
|
|
483
483
|
...customEnv,
|
|
484
484
|
};
|
|
485
485
|
|
|
486
|
-
|
|
487
|
-
|
|
486
|
+
const envFile = path.resolve(pluginBuildPath, 'deploy', '.env');
|
|
487
|
+
|
|
488
|
+
all(Object.entries(resourcesEnvVars)).apply(entries => {
|
|
489
|
+
const envContent = entries
|
|
490
|
+
.map(([key, value]) => `${key}=${value}`)
|
|
491
|
+
.join('\n');
|
|
492
|
+
|
|
493
|
+
if (envContent) {
|
|
494
|
+
fs.appendFileSync(envFile, '\n' + envContent);
|
|
495
|
+
}
|
|
496
|
+
});
|
|
488
497
|
};
|
|
489
498
|
|
|
490
499
|
/**
|
|
@@ -555,6 +564,6 @@ export class LaravelService extends Component {
|
|
|
555
564
|
}
|
|
556
565
|
}
|
|
557
566
|
|
|
558
|
-
const __pulumiType = "sst:aws:
|
|
567
|
+
const __pulumiType = "sst:aws:LaravelService";
|
|
559
568
|
// @ts-expect-error
|
|
560
|
-
|
|
569
|
+
LaravelService.__pulumiType = __pulumiType;
|
package/package.json
CHANGED
package/src/laravel-env.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { Email } from "../../../../.sst/platform/src/components/aws/email.js";
|
|
|
2
2
|
import { Mysql } from "../../../../.sst/platform/src/components/aws/mysql.js";
|
|
3
3
|
import { Postgres } from "../../../../.sst/platform/src/components/aws/postgres.js";
|
|
4
4
|
import { Redis } from "../../../../.sst/platform/src/components/aws/redis.js";
|
|
5
|
-
import { Output } from "../../../../.sst/platform/node_modules/@pulumi/pulumi
|
|
6
|
-
import * as pulumiAws from "../../../../.sst/platform/node_modules/@pulumi/aws
|
|
5
|
+
import { Output } from "../../../../.sst/platform/node_modules/@pulumi/pulumi";
|
|
6
|
+
import * as pulumiAws from "../../../../.sst/platform/node_modules/@pulumi/aws";
|
|
7
7
|
import { Queue } from "../../../../.sst/platform/src/components/aws/queue.js";
|
|
8
8
|
import { Aurora } from "../../../../.sst/platform/src/components/aws/aurora.js";
|
|
9
9
|
import { Bucket } from "../../../../.sst/platform/src/components/aws/bucket.js";
|