Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit 66f955c

Browse files
committed
Update variables to be set into Makefile only if not passed to the make command
1 parent fdac57d commit 66f955c

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ SWIFT_CONFIGURATION=release
1313
# Configuration
1414

1515
# HelloWorld Example Configuration
16-
SWIFT_EXECUTABLE=HelloWorld
17-
SWIFT_PROJECT_PATH=Examples/HelloWorld
18-
LAMBDA_FUNCTION_NAME=HelloWorld
19-
LAMBDA_HANDLER=$(SWIFT_EXECUTABLE).helloWorld
16+
SWIFT_EXECUTABLE?=HelloWorld
17+
SWIFT_PROJECT_PATH?=Examples/HelloWorld
18+
LAMBDA_FUNCTION_NAME?=HelloWorld
19+
LAMBDA_HANDLER?=$(SWIFT_EXECUTABLE).helloWorld
2020

2121
# HTTPSRequest Example Configuration
2222
# SWIFT_EXECUTABLE=HTTPSRequest
@@ -46,8 +46,8 @@ DOCKER_PROJECT_PATH=aws-lambda-swift-sprinter/$(SWIFT_PROJECT_PATH)
4646
# DOCKER_PROJECT_PATH=$(SWIFT_PROJECT_PATH)
4747

4848
# AWS Configuration
49-
AWS_PROFILE=default
50-
AWS_BUCKET=my-s3-bucket
49+
AWS_PROFILE?=default
50+
AWS_BUCKET?=my-s3-bucket
5151

5252
swift_test:
5353
docker run \

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,24 @@ Edit the `Makefile` to build a different Example by commenting the following lin
146146
```
147147
...
148148
149-
SWIFT_EXECUTABLE=HelloWorld
150-
SWIFT_PROJECT_PATH=Examples/HelloWorld
151-
LAMBDA_FUNCTION_NAME=HelloWorld
152-
LAMBDA_HANDLER=$(SWIFT_EXECUTABLE).helloWorld
149+
SWIFT_EXECUTABLE?=HelloWorld
150+
SWIFT_PROJECT_PATH?=Examples/HelloWorld
151+
LAMBDA_FUNCTION_NAME?=HelloWorld
152+
LAMBDA_HANDLER?=$(SWIFT_EXECUTABLE).helloWorld
153153
154154
...
155155
```
156156

157+
You can also override these by passing values in the make command like below.
158+
159+
```
160+
SWIFT_EXECUTABLE=HTTPSRequest \
161+
SWIFT_PROJECT_PATH=Examples/HTTPSRequest \
162+
LAMBDA_FUNCTION_NAME=HTTPSRequest \
163+
LAMBDA_HANDLER=${SWIFT_EXECUTABLE}.getHttps \
164+
make invoke_lambda
165+
```
166+
157167
# Lambda Deployment Workflow
158168

159169
The folowing tutorial describes how to deploy the lambda in your AWS account from the command line using [AWS Command Line Interface](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) through the `Makefile`.

0 commit comments

Comments
 (0)