Skip to content

Commit 1b7c4cd

Browse files
committed
Update README
1 parent a8c3594 commit 1b7c4cd

File tree

2 files changed

+34
-49
lines changed

2 files changed

+34
-49
lines changed

README.md

Lines changed: 33 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -45,72 +45,53 @@ There are two main tasks required in order to use Fileset:
4545

4646
### Server setup
4747

48-
Refer to the example in `./example/server` or follow the steps below.
49-
5048
1. Within your project, create a directory to house the server configuration, e.g.
5149
`./backend/server`.
5250

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.
6852

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`.
7754

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.
7959

8060
```bash
8161
make project=<AppId> setup
8262
make project=<AppId> deploy
8363
```
8464

85-
### Deployment setup
65+
### Upload files
8666

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
8868
the [example fileset.yaml](./example/fileset.yaml) for full configuration
8969
options.
9070

9171
```yaml
9272
google_cloud_project: <AppId>
9373
```
9474
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
9876
to upload. In step (3) below, the files in the directory `./build` are
9977
uploaded.
10078

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.
10783

10884
```bash
109-
fileset upload ./build
85+
npx fileset upload ./build
11086
```
11187

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+
```
11495

11596
## Uploader authentication
11697

@@ -146,7 +127,8 @@ need to add the above two permissions to the account. That can be done via the
146127
IAM page (`https://console.cloud.google.com/access/iam?project=<AppId>`) or via
147128
the `gcloud` CLI.
148129

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.
150132

151133
```bash
152134
make project=<AppId> setup
@@ -165,22 +147,24 @@ The best way to understand how this works is by following the examples below:
165147
# main branch
166148
# ✓ public
167149
# ✓ production URL
168-
# ✓ also available from staging URL (restricted)
150+
# ✓ also available from staging URLs (restricted)
169151
170-
(main) $ fileset upload build
152+
(main) $ npx fileset upload build
171153
...
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
174157
```
175158

176159
```bash
177160
# staging branch
178161
# ✓ not public
179162
# ✓ staging URL only (restricted)
180163
181-
(staging) $ fileset upload build
164+
(staging) $ npx fileset upload build
182165
...
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
184168
```
185169

186170
## Testing
@@ -210,7 +194,7 @@ You can simulate geolocation behavior using query parameters:
210194

211195
### Usage within Makefile
212196

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.
214198

215199
```
216200
./node_modules/.bin/fileset upload build
@@ -222,7 +206,7 @@ First, build the site to the `./build` directory. Then, upload the directory to
222206
223207
```
224208
grow build --deployment=prod
225-
fileset upload build
209+
npx fileset upload build
226210
```
227211
228212
[github-image]: https://github.com/blinkkcode/fileset/workflows/Run%20tests/badge.svg

example/server/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
secrets.yaml

0 commit comments

Comments
 (0)