Skip to content

Commit 0ea188d

Browse files
authored
Merge pull request #5 from adrianwe/patch-3
Extended readme with Windows 10 instructions
2 parents 1771633 + 06a7cb8 commit 0ea188d

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,31 @@ And modify the `src/postgraphileOptions.js` and `serverless.yml` files to your t
5555

5656
## Automatic Deployment with Serverless.js
5757

58-
#### Deployment Prerequisites
58+
This repository runs bash scripts during deployment written on Mac which you can find in the `scripts` folder. These scripts should run just fine on Mac and Linux, but you might run into problems on Windows. As a workaround you can just run Linux within Windows and run the deployment scripts there. If you're on Windows 10 you can install a command line Linux distro from the Microsoft Store - there is a guide further below. If you're using another version of Windows, you could run Linux in a VM (or possibly a Docker container).
5959

60-
- [serverless](https://serverless.com/framework/docs/providers/aws/guide/installation/) - `yarn global add serverless`
60+
#### On Mac/Linux
6161

62-
After configuring your `.env` file, ~/.aws/credentials, and postgraphileOptions.js, you can deploy to AWS using serverless.js by running:
62+
- install [serverless](https://serverless.com/framework/docs/providers/aws/guide/installation/) - `yarn global add serverless`
63+
- Make sure you configured your [aws credentials](https://serverless.com/framework/docs/providers/aws/guide/credentials/) - if you're doing that for the first time, just create the IAM role and then use the aws-cli method as described in the link (Hint: make sure that the IAM role policy you copied from the gist contains `"s3:GetBucketLocation"`)
64+
65+
Now you can deploy to AWS using serverless.js by running:
6366

6467
```
6568
yarn deploy
6669
```
6770

71+
#### On Windows 10
72+
73+
- After you completed the steps in `Setup`, go to the Microsoft Marketplace in the start menu and install a command line linux distro of your choice (we use ubuntu 18.04 in these instructions).
74+
- Run ubuntu and create a user and password.
75+
- Run `sudo apt update` to get access to the latest packages.
76+
- Install and activate a virtual environment: Follow the steps in [this tutorial](https://linuxize.com/post/how-to-create-python-virtual-environments-on-ubuntu-18-04/) until after the activation. From now on, always keep running within the virtual environment. (Why we do this: We will use the `aws-cli` to provide serverless with AWS credentials to create the stack on AWS on your behalf. `aws-cli` relies on python3 which is also used by the Linux system, but in a different version. In order to avoid version conflicts/incompatibilites, we install the `aws-cli` in a virtual environment which comes with its own python installation.)
77+
- Install the aws-cli by running `pip install --upgrade awscli` (from within the venv). You can make sure it installed correctly by running `aws --version`.
78+
- If you haven't already done that, create an IAM role for serverless as described [here](https://serverless.com/framework/docs/providers/aws/guide/credentials/). (Hint: Make sure that the IAM role policy you copied from the gist contains `"s3:GetBucketLocation"`.)
79+
- Save the credentials to aws-cli by running `aws configure` ([more details](https://serverless.com/framework/docs/providers/aws/guide/credentials#setup-with-the-aws-cli)).
80+
- Install yarn (you do need to use yarn and not npm because the scripts use yarn) as described on [their website](https://yarnpkg.com/lang/en/docs/install/#debian-stable), serverless with `yarn global add serverless` and zip with `sudo apt-get install zip`.
81+
- Cd to your postgraphile project folder you created during setup and run `yarn deploy`.
82+
6883
## Setting up a Lambda endpoint manually
6984

7085
If you prefer not to use the serverless.js framework, you can also deploy your lambda function manually.

0 commit comments

Comments
 (0)