-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·61 lines (49 loc) · 1.22 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env bash
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# SPDX-License-Identifier: MIT-0
set -ex
function buildLayer() {
echo "Building Tailscale Lambda Layer..."
mkdir -p cdk.out
cd lib/layer
./build-with-docker.sh
cp ./dist/tailscale-layer.zip ../../cdk.out/tailscale-layer.zip
cd ../..
echo "Tailscale Lambda Layer built successfully"
}
function buildWebhookForwader() {
echo "Building Webhook Forwarder Lambda..."
cd lib/webhook-forwarder
npm run build
npm run lint
cd ../..
echo "Webhook Forwarder Lambda built successfully"
}
function buildAuthoriser() {
echo "Building Custom Authoriser Function Lambda..."
cd lib/authoriser
npm run build
npm run lint
cd ../..
echo "Lambda Authoriser built successfully"
}
function buildRotateCredentials() {
echo "Building Custom Authoriser Function Lambda..."
cd lib/rotate-credentials
npm run build
npm run lint
cd ../..
echo "Rotate Credentials Lambda built successfully"
}
echo "Running build.sh"
npm ci
if command -v yum >/dev/null; then
buildLayer
else
echo "Skipping layer build, this requires Amazon Linux"
fi
buildWebhookForwader
buildAuthoriser
buildRotateCredentials
echo "All done in build.sh"