@@ -45,72 +45,53 @@ There are two main tasks required in order to use Fileset:
45
45
46
46
### Server setup
47
47
48
- Refer to the example in ` ./example/server ` or follow the steps below.
49
-
50
48
1 . Within your project, create a directory to house the server configuration, e.g.
51
49
` ./backend/server ` .
52
50
53
- 2 . Create a ` package.json ` like the below. App Engine will use ` npm start ` to
54
- run the server.
55
-
56
- ``` json
57
- {
58
- "scripts" : {
59
- "start" : " fileset serve"
60
- },
61
- "dependencies" : {
62
- "@blinkk/fileset" : " ^0.1.45"
63
- }
64
- }
65
- ```
66
-
67
- 3 . Create an ` app.yaml ` for Google App Engine deployment.
51
+ 2 . Copy the files from [ ./example/server/] ( ./example/server/ ) into this directory.
68
52
69
- ``` yaml
70
- service : fileset
71
- runtime : nodejs10
72
- handlers :
73
- - url : /.*
74
- script : auto
75
- secure : always
76
- ` ` `
53
+ 3 . Modify the settings in ` app.yaml ` and ` secrets.yaml ` .
77
54
78
- 4. Setup and deploy the app using the provided [Makefile](./example/server/Makefile).
55
+ 4 . Setup and deploy the app using the provided
56
+ [ Makefile] ( ./example/server/Makefile ) . The app will be deployed to an App
57
+ Engine service named ` fileset ` , so it will not conflict with your current
58
+ deployment.
79
59
80
60
``` bash
81
61
make project=< AppId> setup
82
62
make project=< AppId> deploy
83
63
```
84
64
85
- ### Deployment setup
65
+ ### Upload files
86
66
87
- 1 . Create a ` fileset.yaml ` configuration file. The minimum example is below. See
67
+ 1 . ** Create a ` fileset.yaml ` configuration file.** The minimum example is below. See
88
68
the [ example fileset.yaml] ( ./example/fileset.yaml ) for full configuration
89
69
options.
90
70
91
71
``` yaml
92
72
google_cloud_project : <AppId>
93
73
` ` `
94
74
95
- 2. Generate your files.
96
-
97
- Use a static site generator or just manually create a directory containing files
75
+ 2. **Generate your files.** Use a static site generator or just manually create a directory containing files
98
76
to upload. In step (3) below, the files in the directory ` ./build` are
99
77
uploaded.
100
78
101
- 3. Upload your files.
102
-
103
- The uploader will look for `fileset.yaml` within the `./build` directory
104
- first. If it's not found, it will look up in the parent folder for a
105
- ` fileset.yaml` file. If the config file doesn't exist in the `./build` or parent
106
- folder, the uploader will abort.
79
+ 3. **Upload your files.** The uploader will look for `fileset.yaml` within the
80
+ specified directory first. If it's not found, it will look up in the parent
81
+ folder. If the config file doesn't exist in either folder, the uploader will
82
+ abort.
107
83
108
84
` ` ` bash
109
- fileset upload ./build
85
+ npx fileset upload ./build
110
86
` ` `
111
87
112
- 4. That's it! Files have been uploaded to Google Cloud Storage and the uploaded
113
- directory is now being served by the application server.
88
+ That's it! Files have been uploaded to Google Cloud Storage and the uploaded
89
+ directory is now being served by the application server. You can verify by
90
+ visiting :
91
+
92
+ ` ` `
93
+ https://fileset-dot-<AppId>.appspot.com
94
+ ` ` `
114
95
115
96
# # Uploader authentication
116
97
@@ -146,7 +127,8 @@ need to add the above two permissions to the account. That can be done via the
146
127
IAM page (`https://console.cloud.google.com/access/iam?project=<AppId>`) or via
147
128
the `gcloud` CLI.
148
129
149
- The provided [Makefile](./example/server/Makefile) also does it for you :
130
+ The provided [Makefile](./example/server/Makefile) also sets up Google Cloud
131
+ Build permissions for you.
150
132
151
133
` ` ` bash
152
134
make project=<AppId> setup
@@ -165,22 +147,24 @@ The best way to understand how this works is by following the examples below:
165
147
# main branch
166
148
# ✓ public
167
149
# ✓ production URL
168
- # ✓ also available from staging URL (restricted)
150
+ # ✓ also available from staging URLs (restricted)
169
151
170
- (main) $ fileset upload build
152
+ (main) $ npx fileset upload build
171
153
...
172
- Public URL: https://appid.appspot.com
173
- Staging URL: https://f3a9abb-dot-fileset-dot-appid.appspot.com
154
+ Public URL: https://appid.appspot.com
155
+ URL (via commit): https://f3a9abb-dot-fileset-dot-appid.appspot.com
156
+ URL (via branch name): https://master-dot-fileset-dot-appid.appspot.com
174
157
` ` `
175
158
176
159
` ` ` bash
177
160
# staging branch
178
161
# ✓ not public
179
162
# ✓ staging URL only (restricted)
180
163
181
- (staging) $ fileset upload build
164
+ (staging) $ npx fileset upload build
182
165
...
183
- Staging URL: https://4fb48ce-dot-fileset-dot-appid.appspot.com
166
+ URL (via commit): https://4fb48ce-dot-fileset-dot-appid.appspot.com
167
+ URL (via branch name): https://staging-dot-fileset-dot-appid.appspot.com
184
168
` ` `
185
169
186
170
# # Testing
@@ -210,7 +194,7 @@ You can simulate geolocation behavior using query parameters:
210
194
211
195
# ## Usage within Makefile
212
196
213
- The absolute path to the `fileset` executable must be specified to invoke the CLI.
197
+ The absolute path to the `fileset` executable can be specified to invoke the CLI.
214
198
215
199
```
216
200
./node_modules/.bin/fileset upload build
@@ -222,7 +206,7 @@ First, build the site to the `./build` directory. Then, upload the directory to
222
206
223
207
```
224
208
grow build --deployment=prod
225
- fileset upload build
209
+ npx fileset upload build
226
210
```
227
211
228
212
[github-image]: https://github.com/blinkkcode/fileset/workflows/Run%20tests/badge.svg
0 commit comments