You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+55-18Lines changed: 55 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,9 @@
1
-
# Aligent Nx Serverless Deploy Pipe
1
+
# Aligent Serverless Deploy Pipe
2
2
3
-
This pipe is used to deploy multiple Serverless Framework applications in an Nx monorepo.
3
+
This pipe is used to deploy:
4
+
5
+
- Multiple Serverless Framework applications in an Nx monorepo.
6
+
- Single Serverless Framework application in a polyrepo.
4
7
5
8
## YAML Definition
6
9
@@ -30,28 +33,37 @@ Add the following your `bitbucket-pipelines.yml` file:
30
33
| UPLOAD_BADGE | Whether or not to upload a deployment badge to the repositories downloads section. (Accepted values: `true`/`false`) |
31
34
| APP_USERNAME | The user to upload the badge as. Required if UPLOAD_BADGE is set to `true`. |
32
35
| APP_PASSWORD | The app password of the user uploading the badge. Required if UPLOAD_BADGE is set to `true`. |
33
-
| TIMEZONE | Which time zone the time in the badge should use (Default: 'Australia/Adelaide') |
36
+
| TIMEZONE | Which time zone the time in the badge should use (Default: `Australia/Adelaide`) |
37
+
| PROFILE | The profile name that is used for deployment (Default: `bitbucket-deployer`) |
38
+
| CMD | The command that this pipe will run (Eg: `deploy`, `remove`. Default: `deploy`) |
39
+
| SERVICES_PATH | The relative path from root folder to the folder where applications are defined (Default: `services`) |
34
40
35
41
- Default pipelines variables that are available for builds: https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/
36
42
- Please check: https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/ for how to generate an app password.
37
43
38
44
## Monorepo structure
39
45
40
-
The pipe expects each application to be under a root folder called `services`, and to have a `serverless.yml` file in its own root folder.
46
+
The pipe expects:
47
+
48
+
1. A single `nx.json` file at the root folder.
49
+
2. Each application to be under a folder as defined via `SERVICES_PATH` variable above (default as `services`), and to have a `serverless.yml` and a `project.json` files in its own folder.
41
50
42
51
```
43
-
services
44
-
- application-one
45
-
- serverless.yml
46
-
- project.json
47
-
... other files
48
-
- application-two
49
-
- serverless.yml
50
-
- project.json
51
-
... other files
52
+
.
53
+
├── nx.json
54
+
├── services/
55
+
│ ├── application-one/
56
+
│ │ ├── serverless.yml
57
+
│ │ ├── project.json
58
+
│ │ └── ...other files
59
+
│ └── application-two/
60
+
│ ├── serverless.yml
61
+
│ ├── project.json
62
+
│ └── ...other files
63
+
└── ...other files
52
64
```
53
65
54
-
Each application should also have a `project.json` file defining an `nx` target called `deploy`, which implements serverless deploy.
66
+
The `project.json` file defining an Nx target called `deploy`, which implements serverless deployment command:
55
67
56
68
```json
57
69
{
@@ -70,12 +82,36 @@ Each application should also have a `project.json` file defining an `nx` target
0 commit comments