Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update docs for config set and remove #295

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Add a few lines to your `package.json`. Your [account id](https://console.aws.am

### Environments

Environments for a shep project are defined by the aliases on the functions associated with a project. Environments are created through `shep deploy --env new_env` and managed by using the `shep config` commands. Shep takes a strong stance against having different environments for different functions within a project. If you attempt a command which requires the listing of environments and there is a mismatch detected, then shep will throw a `EnvironmentMistmach` error until you remedy the issue. Most issues can be automatically fixed by using `shep config sync`, the only issues this can't solve are conflicting environment variable values. Conflicting value issues can be solved by using `shep config set my_env CONFLICT_VARIABLE=value`.
Environments for a shep project are defined by the aliases on the functions associated with a project. Environments are created through `shep deploy --env new_env` and managed by using the `shep config` commands. Shep takes a strong stance against having different environments for different functions within a project. If you attempt a command which requires the listing of environments and there is a mismatch detected, then shep will throw a `EnvironmentMistmach` error until you remedy the issue. Most issues can be automatically fixed by using `shep config sync`, the only issues this can't solve are conflicting environment variable values. Conflicting value issues can be solved by using `shep config set --env=my_env CONFLICT_VARIABLE=value`.

### Custom Builds Commands

Expand All @@ -73,17 +73,17 @@ By default shep builds all your functions using webpack. If your project require
##### 1. Configure AWS
Since Shep uses the same credentials as the AWS CLI, all you need to do is configure the cli. This can be accomplished via `aws configure`.
##### 2. Create a new Shep project
Run `shep new my-project`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the trailing spaces allow the newline to show in the rendered output

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my vscode auto trims whitespace 🤕

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no it's a markdown thing

Run `shep new my-project`
This will create and configure a Shep project called 'my-project' in the `my-project` directory. Change into this directory.
##### 3. Create a new endpoint and function
Run `shep generate endpoint /hello` and follow the prompts.
Run `shep generate endpoint /hello` and follow the prompts.
This creates a new endpoint as well as a new function for that endpoint. Specifically, it adds a path to `api.json` that is configured to trigger the newly created function.
##### 4. Deploy
Run `shep deploy --env development`
This command does a couple things in order to deploy your project:
Run `shep deploy --env development`
This command does a couple things in order to deploy your project:
* Uses webpack to build your functions. This is equivalent to running `shep build`.
* Creates or updates the Lambda functions associated with your project. This includes creating a new version of the function as well as updating the alias such that `development` will point to the version you just created. For more on versioning please consult Amazon's own [documentation](http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html).
* Creates or updates the API Gateway associated with your project and deploys it to the specified stage, `development` in this case.
* Creates or updates the API Gateway associated with your project and deploys it to the specified stage, `development` in this case.

You can test your endpoint by visiting the API URL printed out after the project is deployed. Visiting the `/hello` endpoint which should show `success!`.

Expand Down
2 changes: 1 addition & 1 deletion src/commands/config/remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as load from '../../util/load'
import reporter from '../../util/reporter'
import merge from 'lodash.merge'

export const command = 'remove <vars...>'
export const command = 'remove --env <env> <VARS=values...>'
export const desc = 'Remove environment variables for alias on AWS'
export function builder (yargs) {
return yargs
Expand Down
2 changes: 1 addition & 1 deletion src/commands/config/set.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import configSet from '../../config-set'
import * as load from '../../util/load'
import merge from 'lodash.merge'

export const command = 'set <vars...>'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd make the env optional because it will ask you if you don't specify one. eg set [--env=<env>]

export const command = 'set --env <env> <VARS=values...>'
export const desc = 'Set environment variables for alias on AWS'
export function builder (yargs) {
return yargs
Expand Down