Skip to content

Commit 553d558

Browse files
committed
update deployment scripts
1 parent f6a0fe3 commit 553d558

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

.github/workflows/buildAndDeployLambda.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
name: Build and deploy lambda to AWS
22

33
on:
4-
workflow_dispatch:
4+
workflow_dispatch:
5+
6+
push:
7+
branches: [main]
8+
paths:
9+
- '.github/workflows/buildAndDeployLambda.yaml'
10+
- 'scripts/deployLambda.sc'
11+
- '!**.test.scala'
12+
- '**.scala'
513

614
env:
715
AWS_CLIENT_DEBUG_MODE: ON
@@ -33,7 +41,7 @@ jobs:
3341
- name: Show changelog
3442
run: echo "CHANGELOG=$(git log --pretty='%h %al %B' ${{ github.event.before }}..${{ github.sha }})" | tr -d "\n\r\'" | cut -c -256 >> "$GITHUB_ENV"
3543
- name: Run the script
36-
run: './scripts/buildAndDeployLambdaNativePackage.sh 64m'
44+
run: ./scripts/buildAndDeployLambdaNativePackage.sh 64m '${{ env.CHANGELOG }}'
3745
shell: bash
3846

3947

scripts/buildAndDeployLambdaNativePackage.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
help() {
4-
echo "Usage: buildAndDeployLambda.sh heapsize"
4+
echo "Usage: buildAndDeployLambda.sh heapsize changelog"
55
exit 2
66
}
77

@@ -37,7 +37,9 @@ run() {
3737

3838
cd ..
3939

40-
scala --power ./scripts/deployLambda.sc
40+
scala --power ./scripts/deployLambda.sc \
41+
-- \
42+
--description="$changelog"
4143

4244
else
4345
echo "\033[31mFailure: Missing ${folder}/bin/boostrap file. Check native-package build logs.\033[0m"
@@ -49,9 +51,10 @@ run() {
4951
fi
5052
}
5153

52-
if [ $# -eq 1 ]; then
54+
if [ $# -eq 2 ]; then
5355

5456
heapsize=$1
57+
changelog=$2
5558

5659
run
5760
else

scripts/deployLambda.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ val lambdaDeploymentConfigPath = os.pwd / "lambda-deployment-config.json"
3333
val zipFilePath = os.pwd / "bin" / "function.zip"
3434

3535
val description: String =
36-
scala.util.Try(System.getenv("CHANGELOG")).toOption.flatMap(Option.apply).getOrElse("")
36+
optionalScriptParameter('d', "description")(args).getOrElse("")
3737

3838
if (!os.exists(lambdaDeploymentConfigPath)) {
3939
println(

0 commit comments

Comments
 (0)