Skip to content

Commit

Permalink
chore: prepare aws-cdk for auto-publish (aws#710)
Browse files Browse the repository at this point in the history
1. Stop bundling, this is now done by the GitHub releases publisher
2. Emit all artifacts to dist/
3. Emit CHANGELOG and build.json to dist/
4. Remove signing scripts (done by publisher now)
5. Merge pack and pack-collect
  • Loading branch information
Elad Ben-Israel authored Sep 13, 2018
1 parent b4435cc commit 36a8c91
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 225 deletions.
6 changes: 3 additions & 3 deletions build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ set -euo pipefail
(cd docs && bash ./build-docs.sh)

# deploy output to 'pack/docs'
rm -fr pack/docs
mkdir pack/docs
rsync -av docs/dist/ pack/docs/
rm -fr dist/docs
mkdir dist/docs
rsync -av docs/dist/ dist/docs/
2 changes: 0 additions & 2 deletions buildspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ phases:
post_build:
commands:
- "[ -f .BUILD_COMPLETED ] && /bin/bash ./pack.sh"
- "[ -f .BUILD_COMPLETED ] && /bin/bash ./build-docs.sh"
- "[ -f .BUILD_COMPLETED ] && /bin/bash ./bundle.sh"
artifacts:
files:
- "**/*"
Expand Down
95 changes: 0 additions & 95 deletions bundle.sh

This file was deleted.

2 changes: 1 addition & 1 deletion docs/build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export PATH=${PYTHON_DEPS}/bin:$PATH
# CONFIG
staging=".staging"
output="dist"
refsrc="../pack/sphinx"
refsrc="../dist/sphinx"
refdocs="refs"
refdocsdir="${staging}/${refdocs}"
refs_index="${staging}/reference.rst"
Expand Down
10 changes: 0 additions & 10 deletions pack-collect.sh

This file was deleted.

43 changes: 39 additions & 4 deletions pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
# later read by bundle-beta.sh.
set -e
export PATH=$PWD/node_modules/.bin:$PATH
root=$PWD

packdir="$PWD/pack"
rm -fr ${packdir}
mkdir -p ${packdir}
distdir="$PWD/dist"
rm -fr ${distdir}
mkdir -p ${distdir}

scopes=$(lerna ls 2>/dev/null | grep -v "(private)" | cut -d" " -f1 | xargs -n1 -I{} echo "--scope {}" | tr "\n" " ")

Expand All @@ -16,4 +17,38 @@ scopes=$(lerna ls 2>/dev/null | grep -v "(private)" | cut -d" " -f1 | xargs -n1
lerna run ${scopes} --sort --stream package

# Collect dist/ from all modules into the root dist/
/bin/bash ./pack-collect.sh
for dir in $(find packages -name dist | grep -v node_modules); do
echo "Merging ${dir} into ${distdir}"
rsync -av $dir/ ${distdir}/
done

# Build docs
/bin/bash ./build-docs.sh

# Get version from lerna
version="$(cat ${root}/lerna.json | grep version | cut -d '"' -f4)"

# Get commit from CodePipeline (or git, if we are in CodeBuild)
# If CODEBUILD_RESOLVED_SOURCE_VERSION is not defined (i.e. local
# build or CodePipeline build), use the HEAD commit hash).
commit="${CODEBUILD_RESOLVED_SOURCE_VERSION:-}"
if [ -z "${commit}" ]; then
commit="$(git rev-parse --verify HEAD)"
fi

cat > ${distdir}/build.json <<HERE
{
"name": "aws-cdk",
"version": "${version}",
"commit": "${commit}"
}
HERE

# copy CHANGELOG.md to dist/ for github releases
cp CHANGELOG.md ${distdir}/

# for posterity, print all files in dist
echo "=============================================================================================="
echo " dist contents"
echo "=============================================================================================="
find dist/
37 changes: 0 additions & 37 deletions scripts/sign-files.sh

This file was deleted.

73 changes: 0 additions & 73 deletions scripts/with-signing-key.sh

This file was deleted.

0 comments on commit 36a8c91

Please sign in to comment.