forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbundle-beta.sh
executable file
·53 lines (41 loc) · 1.15 KB
/
bundle-beta.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
#!/bin/bash
# Creates our beta bundle for the CDK.
# Assume we have a bootstrapped and packaged repository
set -euo pipefail
root=$PWD
staging="$(mktemp -d)"
cd ${staging}
echo "Staging: ${staging}"
# Bundle structure
# ================
#
# + bin
# + docs
# + repo
# + npm
# + maven
# + node_modules
#
# Create a local npm repository
mkdir -p repo/npm
rsync -aL ${root}/pack/*.tgz repo/npm # cdk modules
rsync -aL ${root}/.local-npm/*.tgz repo/npm # jsii modules
# Create a local maven repository
mkdir -p repo/maven
cp ${root}/packages/aws-cdk-java/target/*.jar repo/maven
# Bootstrap a production-ready node_modules closure with all npm modules (jsii and CDK)
npm install --global-style --production --no-save repo/npm/*.tgz
# Symlink 'bin' to the root
ln -s node_modules/.bin bin
# Symlink the docs website to docs
ln -s node_modules/aws-cdk-docs/dist/docs docs
# Create an archive under ./dist
version="$(cat ${root}/lerna.json | grep version | cut -d '"' -f4)"
dist=${root}/dist
output=${dist}/aws-cdk-${version}.zip
rm -fr ${dist}
mkdir -p ${dist}
zip -y -r ${output} .
echo ${output}
# Sign the bundle
/bin/bash $root/sign.sh $output