-
Notifications
You must be signed in to change notification settings - Fork 0
/
synth.sh
executable file
·34 lines (31 loc) · 972 Bytes
/
synth.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
#!/bin/bash -e
# TODO: get LTS?
NODE_VERSION="16.15.0"
# TODO: support custom runners on other ARCHs
ARCH="x64"
uname -a
echo "downloading node"
curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.gz"
echo "creating temp folder"
mkdir -p /tmp/node
echo "extracting files"
tar -xzf "node-v$NODE_VERSION-linux-$ARCH.tar.gz" -C /tmp/node --strip-components=1 --no-same-owner
echo "updating PATH"
export PATH="$PATH:/tmp/node/bin"
echo "checking node version"
node --version
echo "checking npm version"
npm --version
# TODO: is there a cache anywhere?
echo "installing everything"
npm i
echo "synthesise"
# TODO: silence output
npm run synth
# cleanup (I think scalr saves the current working directory?)
echo "cleanup"
rm -rf node_modules
echo "moving files to top level"
# TODO: jq cdktf.out/manifest.json to programatically get name of stack & check support for multiple stacks
mv cdktf.out/stacks/cdk/* .
terraform init